Defines a constrained least-squares solver using Powell's trust region method. In the event the trust-region approach is slow to converge a backtracking type line search will be utilized. The solver also utilizes a Coleman-Li scaling approach that works to improve stability when the solution is near a constraint.
The trust region approach assumes a radius of , which can be initially defined by the user but is automatically altered by the solver, and is implemented as follows.
Gauss-Newton Step (Solved via QR decomposition):
The gradient vector for the steepest descent is calculated by utilizing the product of the Jacobian and the residual as follows.
The steepest descent step is then as follows. where .
Finally, the dogleg is computed as follows. where is found such that .
Applies the limits to the solution vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_equation_solver), | intent(in) | :: | this |
The constrained_equation_solver object. |
||
| real(kind=real64), | intent(inout), | dimension(:) | :: | x |
On input, the solution vector. On output, the clamped solution vector. |
Gets the convergence on function value tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(in) | :: | this |
The equation_solver object. |
The tolerance value.
Gets the convergence on slope of the gradient vector tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(in) | :: | this |
The equation_solver object. |
The tolerance value.
Gets the array of lower bounds constraints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_equation_solver), | intent(in) | :: | this |
The constrained_equation_solver object. |
The limit array.
Gets the maximum number of function evaluations allowed during a single solve.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(in) | :: | this |
The equation_solver object. |
The maximum number of function evaluations.
Gets a logical value determining if iteration status should be printed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(in) | :: | this |
The equation_solver object. |
True if the iteration status should be printed; else, false.
Gets the initial line-search step size scaling factor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_least_squares_solver), | intent(in) | :: | this |
The constrained_least_squares_solver object. |
The scaling factor.
Gets the initial trust-region radius.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_least_squares_solver), | intent(in) | :: | this |
The constrained_least_squares_solver object. |
The trust-region radius.
Gets the array of upper bounds constraints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_equation_solver), | intent(in) | :: | this |
The constrained_equation_solver object. |
The limit array.
Gets the convergence on change in variable tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(in) | :: | this |
The equation_solver object. |
The tolerance value.
Sets the convergence on function value tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(inout) | :: | this |
The equation_solver object. |
||
| real(kind=real64), | intent(in) | :: | x |
The tolerance value. |
Sets the convergence on slope of the gradient vector tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(inout) | :: | this |
The equation_solver object. |
||
| real(kind=real64), | intent(in) | :: | x |
The tolerance value. |
Sets the array of lower bounds constraints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_equation_solver), | intent(inout) | :: | this |
The constrained_equation_solver object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The limit array. |
Sets the maximum number of function evaluations allowed during a single solve.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(inout) | :: | this |
The equation_solver object. |
||
| integer(kind=int32), | intent(in) | :: | n |
The maximum number of function evaluations. |
Sets a logical value determining if iteration status should be printed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(inout) | :: | this |
The equation_solver object. |
||
| logical, | intent(in) | :: | x |
True if the iteration status should be printed; else, false. |
Gets the initial line-search step size scaling factor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_least_squares_solver), | intent(inout) | :: | this |
The constrained_least_squares_solver object. |
||
| real(kind=real64), | intent(in) | :: | x |
The scaling factor. |
Sets the initial trust region radius.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_least_squares_solver), | intent(inout) | :: | this |
The constrained_least_squares_solver object. |
||
| real(kind=real64), | intent(in) | :: | x |
The The trust-region radius. |
Sets the array of upper bounds constraints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_equation_solver), | intent(inout) | :: | this |
The constrained_equation_solver object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The limit array. |
Sets the convergence on change in variable tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equation_solver), | intent(inout) | :: | this |
The equation_solver object. |
||
| real(kind=real64), | intent(in) | :: | x |
The tolerance value. |
Applies the constrained least-squares solver to solve the nonlinear least-squares problem.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(constrained_least_squares_solver), | intent(inout) | :: | this |
The constrained_least_squares_solver object. |
||
| class(vecfcn_helper), | intent(in) | :: | fcn |
The vecfcn_helper object containing the equations to solve. |
||
| real(kind=real64), | intent(inout), | dimension(:) | :: | x |
On input, an N-element array containing an initial estimate to the solution. On output, the updated solution estimate. N is the number of variables. |
|
| real(kind=real64), | intent(out), | dimension(:) | :: | fvec |
An M-element array that, on output, will contain the values of each equation as evaluated at the variable values given in x. |
|
| type(iteration_behavior), | optional | :: | ib |
An optional output, that if provided, allows the caller to obtain iteration performance statistics. |
||
| class(*), | intent(inout), | optional | :: | args |
An optional argument to allow the user to communicate with the routine. |
|
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |