nonlinear_solvers Module

Damped Newton solver

Solve small nonlinear systems using Newton steps and Armijo backtracking.

Description

newton_solve accepts a callback returning residuals and a dense Jacobian, updates the initial guess in place, and reports a convergence code. It is imported by solve_TP in this source file, although that routine currently calls newton from yaeos__math_nonlinearsolvers instead.

Examples

call newton_solve(fun, x, tol, max_iter, its, info)

Uses

  • module~~nonlinear_solvers~~UsesGraph module~nonlinear_solvers nonlinear_solvers module~yaeos__constants yaeos__constants module~nonlinear_solvers->module~yaeos__constants module~yaeos__math_linalg yaeos__math_linalg module~nonlinear_solvers->module~yaeos__math_linalg iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__math_linalg->module~yaeos__constants

Used by

  • module~~nonlinear_solvers~~UsedByGraph module~nonlinear_solvers nonlinear_solvers proc~solve_tp solve_TP proc~solve_tp->module~nonlinear_solvers

Subroutines

public subroutine newton_solve(fun, x, tol, max_iter, its, info)

Solve a nonlinear system by damped Newton iteration.

Read more…

Arguments

Type IntentOptional Attributes Name
public subroutine fun(x, f, J)
Arguments
Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(:)

Current unknown vector.

real(kind=dp), intent(out) :: f(:)

Residual vector.

real(kind=dp), intent(out) :: J(:,:)

Residual Jacobian.

real(kind=dp), intent(inout) :: x(:)

Initial guess; last iterate on return.

real(kind=dp), intent(in) :: tol

Absolute residual convergence tolerance.

integer, intent(in) :: max_iter

Maximum Newton iterations.

integer, intent(out) :: its

Iteration count at termination.

integer, intent(out) :: info

0 = converged (max-norm of residuals below tol), 1 = iteration limit reached