SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
NonlinearSolver::newton_raphson Namespace Reference

Items related to the NewtonRaphson nonlinear solver. More...

Classes

struct  NewtonRaphson
 A Newton-Raphson correction scheme for nonlinear systems of equations Anonlinear(x)=b. More...
 

Functions

double next_step_length (size_t globalization_iteration_id, double step_length, double prev_step_length, double residual, double residual_slope, double next_residual, double prev_residual)
 Find the next step length for the line-search globalization. More...
 

Detailed Description

Items related to the NewtonRaphson nonlinear solver.

Function Documentation

◆ next_step_length()

double NonlinearSolver::newton_raphson::next_step_length ( size_t  globalization_iteration_id,
double  step_length,
double  prev_step_length,
double  residual,
double  residual_slope,
double  next_residual,
double  prev_residual 
)

Find the next step length for the line-search globalization.

The next step length is chosen such that it minimizes the quadratic (first globalization step, i.e., when globalization_iteration_id is 0) or cubic (subsequent globalization steps) polynomial interpolation. This function implements Algorithm A6.3.1 in (p. 325). This is how argument names map to symbols in that algorithm:

  • step_length: λ
  • prev_step_length: λprev
  • residual: fc
  • residual_slope: gTp<0
  • next_residual: f+
  • prev_residual: f+,prev

Note that the argument residual_slope is the derivative of the residual function f w.r.t. the step length, i.e. dfdλ, which must be negative. For the common scenario where f(x)=|r(x)|2, i.e. the residual function is the L2 norm of a residual vector r(x), and where that in turn is the residual of a nonlinear equation r(x)=bAnonlinear(x) in a Newton-Raphson step as described in NonlinearSolver::newton_raphson::NewtonRaphson, then the residual_slope reduces to

(1)dfdλ=dfdxidxidλ=2r(x)drdxidxidλ=2|r(x)|2=2f(x)2fc.

Here we have used the relation

(2)drdxidxidλ=δAnonlinearδxδx=r

of a Newton-Raphson step of full length δx.