newton Subroutine

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

newton

Muldimensional Newton method with simple damping.

Description

Solves a non-lineal system of equations using the Newton-Raphson method. To help with convergence a damping is done to ensure that for each step.

Arguments

Type IntentOptional Attributes Name
procedure(to_solve) :: sub

Subroutine with the system of equations to solve and its Jacobian matrix

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

Vector of variables used for initialization, updated to the solution at the end

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

Absolute tolerance on the function equations

integer, intent(in) :: max_its

Maximum number of iterations

integer, intent(out) :: its

Number of iterations used


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))
real(kind=pr), public :: J2(size(X),size(X))
real(kind=pr), public :: dX(size(X))