Attempt a homotopy solve from an easy identity system to the target.
The internal residual is , where
is the initial guess. The implementation advances t through
ten equally spaced values and calls the damped Newton routine at each
stage. It is a legacy helper with limited failure diagnostics.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| procedure(to_solve) | :: | sub |
Target residual/Jacobian callback. |
|||
| real(kind=pr), | intent(inout) | :: | x(:) |
Initial guess, updated homotopy solution. |
||
| real(kind=pr), | intent(in) | :: | tol |
Absolute residual tolerance at each stage. |
||
| integer, | intent(in) | :: | max_its |
Present for interface compatibility; current implementation uses a fixed stage limit. |
||
| integer, | intent(out) | :: | its |
Iterations reported by the last Newton stage. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | F(size(X)) | ||||
| real(kind=pr), | public | :: | G(size(X)) | ||||
| real(kind=pr), | public | :: | H(size(X)) | ||||
| real(kind=pr), | public | :: | X0(size(X)) | ||||
| real(kind=pr), | public | :: | dF(size(X),size(X)) | ||||
| real(kind=pr), | public | :: | dG(size(X),size(X)) | ||||
| real(kind=pr), | public | :: | dH(size(X),size(X)) | ||||
| real(kind=pr), | public | :: | dX(size(x)) | ||||
| real(kind=pr), | public | :: | dt | ||||
| integer, | public | :: | i |
Loop/index variable. |
|||
| integer, | public | :: | info |
Solver status code. |
|||
| integer, | public | :: | nt | ||||
| real(kind=pr), | public | :: | t |
MINPACK-style adapter for the homotopy residual callback.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
Number of unknowns. |
||
| real(kind=pr), | intent(in) | :: | x(n) |
Current unknown vector. |
||
| real(kind=pr), | intent(out) | :: | fvec(n) |
Residual vector. |
||
| integer, | intent(inout) | :: | iflag |
Solver callback status flag. |
Evaluate the homotopy residual and Jacobian at the current stage.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | X(:) |
Current homotopy unknown vector. |
||
| real(kind=pr), | intent(out) | :: | H(:) |
Homotopy residual vector. |
||
| real(kind=pr), | intent(out) | :: | dH(:,:) |
Homotopy Jacobian with respect to |