newton Subroutine

public subroutine newton(sub, x, tol, max_its, its)

newton

Multidimensional Newton method with simple step damping.

Description

Solves with Newton-Raphson. Each step is repeatedly halved until its largest component is at most 0.1; this limits step size but is not a residual-based line search. its is the loop count and does not distinguish all convergence/failure cases.

Arguments

Type IntentOptional Attributes Name
procedure(to_solve) :: sub

Callback returning residuals and the Jacobian.

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

Initial guess, overwritten by the current solution estimate.

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

Absolute infinity-norm tolerance on the residual.

integer, intent(in) :: max_its

Maximum number of Newton iterations.

integer, intent(out) :: its

Iteration count at exit.


Calls

proc~~newton~2~~CallsGraph proc~newton~2 newton proc~solve_system solve_system proc~newton~2->proc~solve_system none~dgesv dgesv proc~solve_system->none~dgesv

Called by

proc~~newton~2~~CalledByGraph proc~newton~2 newton proc~homotopy homotopy proc~homotopy->proc~newton~2 proc~solve_tp solve_TP proc~solve_tp->proc~newton~2 proc~saturation_pressure saturation_pressure proc~saturation_pressure->proc~solve_tp proc~saturation_temperature saturation_temperature proc~saturation_temperature->proc~solve_tp

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: F(size(X))
real(kind=pr), public :: F2(size(X))
real(kind=pr), public :: J(size(X),size(X))

Jacobian matrix.

real(kind=pr), public :: J2(size(X),size(X))
real(kind=pr), public :: dX(size(X))