Classes | Functions
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 \(A_\mathrm{nonlinear}(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) noexcept
 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 
)
noexcept

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.1.3 in [25] (p. 325). This is how argument names map to symbols in that algorithm:

  • step_length: \(\lambda\)
  • prev_step_length: \(\lambda_\mathrm{prev}\)
  • residual: \(f_c\)
  • residual_slope: \(g^T p < 0\)
  • next_residual: \(f_+\)
  • prev_residual: \(f_{+,\mathrm{prev}}\)

Note that the argument residual_slope is the derivative of the residual function \(f\) w.r.t. the step length, i.e. \(\frac{\mathrm{d}f}{\mathrm{d}\lambda}\), which must be negative. For the common scenario where \(f(x)=|\boldsymbol{r}(x)|^2\), i.e. the residual function is the L2 norm of a residual vector \(\boldsymbol{r}(x)\), and where that in turn is the residual of a nonlinear equation \(\boldsymbol{r}(x)=b-A_\mathrm{nonlinear}(x)\) in a Newton-Raphson step as described in NonlinearSolver::newton_raphson::NewtonRaphson, then the residual_slope reduces to

\begin{equation} \frac{\mathrm{d}f}{\mathrm{d}\lambda} = \frac{\mathrm{d}f}{\mathrm{d}x^i} \frac{\mathrm{d}x^i}{\mathrm{d}\lambda} = 2 \boldsymbol{r}(x) \cdot \frac{\mathrm{d}\boldsymbol{r}}{\mathrm{d}x^i} \frac{\mathrm{d}x^i}{\mathrm{d}\lambda} = -2 |\boldsymbol{r}(x)|^2 = -2 f(x) \equiv -2 f_c \text{.} \end{equation}

Here we have used the relation

\begin{equation} \frac{\mathrm{d}\boldsymbol{r}}{\mathrm{d}x^i} \frac{\mathrm{d}x^i}{\mathrm{d}\lambda} = -\frac{\delta A_\mathrm{nonlinear}}{\delta x}\cdot\delta x = -r \end{equation}

of a Newton-Raphson step of full length \(\delta x\).