nonlin 1.5.2
A library that provides routines to compute the solutions to systems of nonlinear equations.
|
Defines a solver based upon Nelder and Mead's simplex algorithm for minimization of functions of multiple variables. More...
Public Member Functions | |
procedure, public | solve nm_solve |
Utilizes the Nelder-Mead simplex method for finding a minimum value of the specified function. | |
procedure, public | get_simplex nm_get_simplex |
Gets an N-by-(N+1) matrix containing the current simplex. | |
procedure, public | set_simplex nm_set_simplex |
Sets an N-by-(N+1) matrix as the current simplex. Notice, if this matrix is different in size from the problem dimensionallity, the Nelder-Mead routine will replace it with an appropriately sized matrix. | |
procedure, public | get_initial_size nm_get_size |
Gets the size of the initial simplex that will be utilized by the Nelder-Mead algorithm in the event that the user does not supply a simplex geometry, or if the user supplies an invalid simplex geometry. | |
procedure, public | set_initial_size nm_set_size |
Sets the size of the initial simplex that will be utilized by the Nelder-Mead algorithm in the event that the user does not supply a simplex geometry, or if the user supplies an invalid simplex geometry. | |
Public Member Functions inherited from nonlin_core::equation_optimizer | |
procedure, public | get_max_fcn_evals oe_get_max_eval |
Gets the maximum number of function evaluations allowed. | |
procedure, public | set_max_fcn_evals oe_set_max_eval |
Sets the maximum number of function evaluations allowed. | |
procedure, public | get_tolerance oe_get_tol |
Gets the tolerance on convergence. | |
procedure, public | set_tolerance oe_set_tol |
Sets the tolerance on convergence. | |
procedure, public | get_print_status oe_get_print_status |
Gets a logical value determining if iteration status should be printed. | |
procedure, public | set_print_status oe_set_print_status |
Sets a logical value determining if iteration status should be printed. | |
Public Attributes | |
real(real64) | m_initsize = 1.0d0 |
A scaling parameter used to define the size of the simplex in each coordinate direction. | |
Public Attributes inherited from nonlin_core::equation_optimizer | |
real(real64) | m_tol = 1.0d-12 |
The error tolerance used to determine convergence. | |
logical | m_printstatus = .false. |
Set to true to print iteration status; else, false. | |
Private Member Functions | |
procedure, private | extrapolate nm_extrapolate |
Extrapolates by the specified factor through the simplex across from the largest point. If the extrapolation results in a better estimate, the current high point is replaced with the new estimate. | |
Private Attributes | |
real(real64), dimension(:,:), allocatable | m_simplex |
The simplex vertices. | |
Defines a solver based upon Nelder and Mead's simplex algorithm for minimization of functions of multiple variables.
Definition at line 32 of file nonlin_optimize.f90.
|
private |
Extrapolates by the specified factor through the simplex across from the largest point. If the extrapolation results in a better estimate, the current high point is replaced with the new estimate.
[in,out] | this | The nelder_mead object. |
[in] | fcn | The function to evaluate. |
[in,out] | y | An array containing the function values at each vertex. |
[in,out] | pcent | An array containing the centroid of vertex position information. |
[in] | ihi | The index of the largest magnitude vertex. |
[in,out] | neval | The number of function evaluations. |
[out] | work | An N-element workspace array where N is the number of dimensions of the problem. |
Definition at line 213 of file nonlin_optimize.f90.
procedure, public nonlin_optimize::nelder_mead::get_initial_size |
Gets the size of the initial simplex that will be utilized by the Nelder-Mead algorithm in the event that the user does not supply a simplex geometry, or if the user supplies an invalid simplex geometry.
[in] | this | The nelder_mead object. |
Definition at line 175 of file nonlin_optimize.f90.
procedure, public nonlin_optimize::nelder_mead::get_simplex |
Gets an N-by-(N+1) matrix containing the current simplex.
[in] | this | The nelder_mead object. |
Definition at line 144 of file nonlin_optimize.f90.
procedure, public nonlin_optimize::nelder_mead::set_initial_size |
Sets the size of the initial simplex that will be utilized by the Nelder-Mead algorithm in the event that the user does not supply a simplex geometry, or if the user supplies an invalid simplex geometry.
[in,out] | this | The nelder_mead object. |
[in] | x | The size of the simplex (length of an edge). |
Definition at line 192 of file nonlin_optimize.f90.
procedure, public nonlin_optimize::nelder_mead::set_simplex |
Sets an N-by-(N+1) matrix as the current simplex. Notice, if this matrix is different in size from the problem dimensionallity, the Nelder-Mead routine will replace it with an appropriately sized matrix.
[in,out] | this | The nelder_mead object. |
[in] | x | The simplex matrix. Each column of the matrix must contain the coordinates of each vertex of the simplex. |
Definition at line 162 of file nonlin_optimize.f90.
|
virtual |
Utilizes the Nelder-Mead simplex method for finding a minimum value of the specified function.
[in,out] | this | The nelder_mead object. |
[in] | fcn | The fcnnvar_helper object containing the equation to optimize. |
[in,out] | x | On input, the initial guess at the optimal point. On output, the updated optimal point estimate. |
[out] | fout | An optional output, that if provided, returns the value of the function at x . |
[out] | ib | An optional output, that if provided, allows the caller to obtain iteration performance statistics. |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Implements nonlin_core::equation_optimizer.
Definition at line 133 of file nonlin_optimize.f90.
real(real64) nonlin_optimize::nelder_mead::m_initsize = 1.0d0 |
A scaling parameter used to define the size of the simplex in each coordinate direction.
Definition at line 38 of file nonlin_optimize.f90.
|
private |
The simplex vertices.
Definition at line 35 of file nonlin_optimize.f90.