Trace a one-dimensional solution manifold of a nonlinear system.
At each point the tangent is obtained from
The tangent predicts the next point; solver (or the default Newton
corrector) then solves the residual equations there. The default
specification update selects the component of the tangent with the
largest magnitude, rescales the tangent to it and converts the step to
that variable (no step-size limit is applied). Tracing stops when the
corrector reaches its iteration limit (500), the residual is NaN,
dS becomes zero, or stop returns true. The returned array has max_points rows; rows not reached
before termination remain zero.
curve = continuation(fun, X0, ns0, S0, dS0, &
max_points=100, solver_tol=1.0e-8_pr)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| procedure(continuation_function) | :: | f |
Residual and derivative callback for . |
|||
| real(kind=pr), | intent(in) | :: | X0(:) |
Initial converged unknown vector. |
||
| integer, | intent(in) | :: | ns0 |
Index of the initially specified variable in |
||
| real(kind=pr), | intent(in) | :: | S0 |
Initial value of the specified variable. |
||
| real(kind=pr), | intent(in) | :: | dS0 |
Signed first step in the specification. |
||
| integer, | intent(in) | :: | max_points |
Maximum number of continuation points to store. |
||
| real(kind=pr), | intent(in) | :: | solver_tol |
Residual tolerance for the point corrector. |
||
| procedure(process), | optional | :: | update_specification |
Optional callback to select the next specification and step. If absent, the tangent component of largest magnitude is selected and the step is scaled using that component: |
||
| procedure(process), | optional | :: | postprocess |
Optional callback to modify the state or step after specification selection, for example to enforce bounds or change step direction. |
||
| procedure(continuation_solver), | optional | :: | solver |
Optional point corrector. The built-in Newton solver is used by default. |
||
| procedure(continuation_stopper), | optional | :: | stop |
Optional callback evaluated after each accepted point; true terminates continuation. |
Stored solution vectors, one per row.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | S | ||||
| real(kind=pr), | public | :: | X(size(X0)) | ||||
| real(kind=pr), | public | :: | dF(size(X0),size(X0)) | ||||
| real(kind=pr), | public | :: | dFdS(size(X0)) | ||||
| real(kind=pr), | public | :: | dS | ||||
| real(kind=pr), | public | :: | dXdS(size(X0)) | ||||
| real(kind=pr), | public | :: | fval(size(X0)) | ||||
| integer, | public | :: | i |
Loop/index variable. |
|||
| integer, | public | :: | max_iters | = | 500 | ||
| integer, | public | :: | newton_its | ||||
| integer, | public | :: | ns |