CONMIN is a Fortran package for the solution of linear or nonlinear constrained optimization problems. The basic optimization algorithm is the Method of Feasible Directions. The user must provide a main calling program and an external routine to evaluate the objective and constraint functions and to provide gradient information. If analytic gradients of the objective or constraint functions are not available, this information is calculated by finite difference. While the program is intended primarily for efficient solution of constrained problems, unconstrained function minimization problems may also be solved, and the conjugate direction method of Fletcher and Reeves is used for this purpose.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | wp | = | real64 |
Real working precision if not specified [8 bytes] |
| integer, | public, | parameter | :: | conmin_wp | = | wp |
Working real precision |
Report function to call once per iteration to report the solution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | iter |
Iteration number |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
Decision variables |
|
| real(kind=wp), | intent(in) | :: | obj |
Objective function value |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | g |
Constraint functions |
main class.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | small | = | 1.0e-20_wp |
Small number |
|
| real(kind=wp), | public | :: | large | = | 1.0e+20_wp |
Large number |
|
| real(kind=wp), | public | :: | delfun | = | 0.001_wp |
Minimum relative change in the objective
function to indicate convergence. If in |
|
| real(kind=wp), | public | :: | dabfun | = | 0.0_wp |
Default value = 0.001 times the initial function value. Same
as DELFUN except comparison is on absolute change in the
objective function, |
|
| real(kind=wp), | public | :: | fdch | = | 0.01_wp |
Not used if |
|
| real(kind=wp), | public | :: | fdchm | = | 0.01_wp |
Not used if |
|
| real(kind=wp), | public | :: | ct | = | -0.1_wp |
Not used if |
|
| real(kind=wp), | public | :: | ctmin | = | 0.004_wp |
Not used if |
|
| real(kind=wp), | public | :: | ctl | = | -0.01_wp |
Not used if |
|
| real(kind=wp), | public | :: | ctlmin | = | 0.001_wp |
Not used if |
|
| real(kind=wp), | public | :: | alphax | = | 0.1_wp |
the maximum fractional change in any component of X as an initial estimate for ALPHA in the one-dimensional search. That is, the initial ALPHA will be such that no component of X is changed by more than this amount. This only applies to those X(i) of magnitude greater than 0.1. If an optimization run shows numerous ALPHA = 0 results for the one-dimensional search, it may help to try ALPHAX less than the default. ALPHAX is changed by CONMIN depending on the progress of the optimization. |
|
| real(kind=wp), | public | :: | abobj1 | = | 0.1_wp |
the fractional change attempted as a first step in
the one-dimensional search and is based on a linear approximation.
ABOBJ1 is updated during the optimization, depending on progress.
The initial step in the one-dimensional search is taken as the amount
necessary to change |
|
| real(kind=wp), | public | :: | theta | = | 1.0_wp |
Not used if |
|
| real(kind=wp), | public | :: | obj |
Value of objective function for the current decision variables,
|
|||
| integer, | public | :: | ndv |
Number of decision variables, |
|||
| integer, | public | :: | ncon |
Number of constraint functions, |
|||
| integer, | public | :: | nside |
Side constraint parameter. |
|||
| integer, | public | :: | iunit | = | output_unit |
Unit number for printing. Should be non-zero. |
|
| integer, | public | :: | iprint | = | 0 |
Print control. All printing is done on unit number |
|
| integer, | public | :: | nfdg |
the finite difference gradient parameter: |
|||
| integer, | public | :: | nscal |
Scaling control parameter. The decision variables will be scaled linearly. |
|||
| integer, | public | :: | linobj | = | 0 |
Not used if NCON = NSIDE = 0. Linear objective function
identifier. If the objective, OBJ, is specifically known to
be a strictly linear function of the decision variables, |
|
| integer, | public | :: | itmax | = | 10 |
Maximum number of iterations in the
minimization process. If |
|
| integer, | public | :: | itrm | = | 3 |
Number of consecutive iterations to indicate
convergence by relative or absolute changes, |
|
| integer, | public | :: | icndir |
Default value = |
|||
| integer, | public | :: | igoto | = | 0 |
Reverse communication flag. CONMIN executes according to the parameter IGOTO which must be initialized to zero. |
|
| integer, | public | :: | nac |
Number of active and violated constraints ( |
|||
| integer, | public | :: | info |
|
|||
| integer, | public | :: | infog |
|
|||
| integer, | public | :: | iter |
Iteration number. The optimization process is iterative so
that the vector of decision variables at the Kth iteration
is defined by |
|||
| real(kind=wp), | public | :: | dct | ||||
| real(kind=wp), | public | :: | dctl | ||||
| real(kind=wp), | public | :: | abobj | ||||
| real(kind=wp), | public | :: | cta | ||||
| real(kind=wp), | public | :: | ctam | ||||
| real(kind=wp), | public | :: | ctbm | ||||
| real(kind=wp), | public | :: | obj1 | ||||
| real(kind=wp), | public | :: | slope | ||||
| real(kind=wp), | public | :: | dx | ||||
| real(kind=wp), | public | :: | dx1 | ||||
| real(kind=wp), | public | :: | fi | ||||
| real(kind=wp), | public | :: | xi | ||||
| real(kind=wp), | public | :: | dftdf1 | ||||
| real(kind=wp), | public | :: | alp | ||||
| real(kind=wp), | public | :: | fff | ||||
| real(kind=wp), | public | :: | a1 | ||||
| real(kind=wp), | public | :: | a2 | ||||
| real(kind=wp), | public | :: | a3 | ||||
| real(kind=wp), | public | :: | a4 | ||||
| real(kind=wp), | public | :: | f1 | ||||
| real(kind=wp), | public | :: | f2 | ||||
| real(kind=wp), | public | :: | f3 | ||||
| real(kind=wp), | public | :: | f4 | ||||
| real(kind=wp), | public | :: | cv1 | ||||
| real(kind=wp), | public | :: | cv2 | ||||
| real(kind=wp), | public | :: | cv3 | ||||
| real(kind=wp), | public | :: | cv4 | ||||
| real(kind=wp), | public | :: | app | ||||
| real(kind=wp), | public | :: | alpca | ||||
| real(kind=wp), | public | :: | alpfes | ||||
| real(kind=wp), | public | :: | alpln | ||||
| real(kind=wp), | public | :: | alpmin | ||||
| real(kind=wp), | public | :: | alpnc | ||||
| real(kind=wp), | public | :: | alpsav | ||||
| real(kind=wp), | public | :: | alpsid | ||||
| real(kind=wp), | public | :: | alptot | ||||
| real(kind=wp), | public | :: | rspace | ||||
| real(kind=wp), | public | :: | phi | = | 5.0_wp |
Not used if |
|
| integer, | public | :: | jdir | ||||
| integer, | public | :: | iobj | ||||
| integer, | public | :: | kobj | ||||
| integer, | public | :: | kcount | ||||
| integer, | public | :: | nfeas | ||||
| integer, | public | :: | mscal | ||||
| integer, | public | :: | ncobj | ||||
| integer, | public | :: | nvc | ||||
| integer, | public | :: | kount | ||||
| integer, | public | :: | icount | ||||
| integer, | public | :: | igood1 | ||||
| integer, | public | :: | igood2 | ||||
| integer, | public | :: | igood3 | ||||
| integer, | public | :: | igood4 | ||||
| integer, | public | :: | ibest | ||||
| integer, | public | :: | iii | ||||
| integer, | public | :: | nlnc | ||||
| integer, | public | :: | jgoto | ||||
| integer, | public | :: | ispace(2) | ||||
| integer, | public | :: | ncal(2) |
Bookkeeping information. NCAL(1) gives the number of times external routine SUB1 was called with INFO = 1. NCAL(2) gives the number of times INFO = 2. NCAL(3) gives the number of times INFO = 3 and NCAL(4) gives the number of times INFO = 4. |
|||
| procedure(report_f), | public, | pointer | :: | report | => | null() |
a function to call once per iteration to report the solution |
| procedure, public :: solve => conmin | |
| procedure, private :: cnmn01 | |
| procedure, private :: cnmn02 | |
| procedure, private :: cnmn03 | |
| procedure, private :: cnmn04 | |
| procedure, private :: cnmn05 | |
| procedure, private :: cnmn06 | |
| procedure, private :: cnmn07 |
Routine to solve constrained or unconstrained function minimization.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(inout) | :: | x(n1) |
Vector of decision variables, |
||
| real(kind=wp), | intent(inout) | :: | vlb(n1) |
Used only if |
||
| real(kind=wp), | intent(inout) | :: | vub(n1) |
Used only if |
||
| real(kind=wp), | intent(inout) | :: | g(n2) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | scal(n1) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | df(n1) |
Analytic gradient of the objective function for the current
decision variables, |
||
| real(kind=wp), | intent(inout) | :: | a(n1,n3) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | s(n1) |
Move direction in the NDV-dimensional optimization space. |
||
| real(kind=wp), | intent(inout) | :: | g1(n2) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | g2(n2) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | b(n3,n3) |
Not used if |
||
| real(kind=wp), | intent(inout) | :: | c(n4) |
Not used in |
||
| integer, | intent(inout) | :: | isc(n2) |
Not used if |
||
| integer, | intent(inout) | :: | ic(n3) |
Identifies which constraints are active or violated. |
||
| integer, | intent(inout) | :: | ms1(n5) |
Not used if |
||
| integer, | intent(in) | :: | n1 |
|
||
| integer, | intent(in) | :: | n2 |
|
||
| integer, | intent(in) | :: | n3 |
|
||
| integer, | intent(in) | :: | n4 |
|
||
| integer, | intent(in) | :: | n5 |
|
Routine to calculate gradient information by finite difference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| integer, | intent(inout) | :: | jgoto | |||
| real(kind=wp), | intent(inout) | :: | x(:) | |||
| real(kind=wp), | intent(inout) | :: | df(:) | |||
| real(kind=wp), | intent(inout) | :: | g(n2) | |||
| integer, | intent(in) | :: | isc(n2) | |||
| integer, | intent(inout) | :: | ic(n3) | |||
| real(kind=wp), | intent(inout) | :: | a(n1,n3) | |||
| real(kind=wp), | intent(inout) | :: | g1(n2) | |||
| real(kind=wp), | intent(in) | :: | vub(:) | |||
| real(kind=wp), | intent(in) | :: | scal(:) | |||
| integer, | intent(inout) | :: | ncal(2) | |||
| real(kind=wp), | intent(out) | :: | dx | |||
| real(kind=wp), | intent(out) | :: | dx1 | |||
| real(kind=wp), | intent(out) | :: | fi | |||
| real(kind=wp), | intent(out) | :: | xi | |||
| integer, | intent(out) | :: | iii | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 |
Routine to determine conjugate direction vector or direction of steepest descent for unconstrained function minimization.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| integer, | intent(inout) | :: | ncalc |
NCALC = CALCULATION CONTROL. |
||
| real(kind=wp), | intent(out) | :: | slope | |||
| real(kind=wp), | intent(inout) | :: | dftdf1 | |||
| real(kind=wp), | intent(in) | :: | df(:) | |||
| real(kind=wp), | intent(inout) | :: | s(:) |
Routine to solve one-dimensional search in unconstrained minimization using 2-point quadratic interpolation, 3-point cubic interpolation and 4-point cubic interpolation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(inout) | :: | x(:) | |||
| real(kind=wp), | intent(inout) | :: | s(:) | |||
| real(kind=wp), | intent(inout) | :: | slope |
SLOPE = INITIAL FUNCTION SLOPE = S-TRANSPOSE TIMES DF. SLOPE MUST BE NEGATIVE. |
||
| real(kind=wp), | intent(inout) | :: | alp |
PROPOSED MOVE PARAMETER |
||
| real(kind=wp), | intent(inout) | :: | fff | |||
| real(kind=wp), | intent(inout) | :: | a1 | |||
| real(kind=wp), | intent(inout) | :: | a2 | |||
| real(kind=wp), | intent(inout) | :: | a3 | |||
| real(kind=wp), | intent(inout) | :: | a4 | |||
| real(kind=wp), | intent(inout) | :: | f1 | |||
| real(kind=wp), | intent(inout) | :: | f2 | |||
| real(kind=wp), | intent(inout) | :: | f3 | |||
| real(kind=wp), | intent(inout) | :: | f4 | |||
| real(kind=wp), | intent(inout) | :: | app | |||
| integer, | intent(inout) | :: | ncal(2) | |||
| integer, | intent(out) | :: | kount | |||
| integer, | intent(inout) | :: | jgoto |
Routine to find first xbar>=eps corresponding to a minimum
of a one-dimensional real function by polynomial interpolation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| integer, | intent(inout) | :: | ii |
CALCULATION CONTROL: |
||
| real(kind=wp), | intent(out) | :: | xbar | |||
| real(kind=wp), | intent(in) | :: | eps |
may be negative |
||
| real(kind=wp), | intent(in) | :: | x1 | |||
| real(kind=wp), | intent(in) | :: | y1 | |||
| real(kind=wp), | intent(in) | :: | slope | |||
| real(kind=wp), | intent(in) | :: | x2 | |||
| real(kind=wp), | intent(in) | :: | y2 | |||
| real(kind=wp), | intent(in) | :: | x3 | |||
| real(kind=wp), | intent(in) | :: | y3 | |||
| real(kind=wp), | intent(in) | :: | x4 | |||
| real(kind=wp), | intent(in) | :: | y4 |
Routine to solve direction finding problem in modified method of feasible directions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(inout) | :: | g(n2) | |||
| real(kind=wp), | intent(inout) | :: | df(:) | |||
| real(kind=wp), | intent(inout) | :: | a(n1,n3) | |||
| real(kind=wp), | intent(inout) | :: | s(:) | |||
| real(kind=wp), | intent(inout) | :: | b(n3,n3) | |||
| real(kind=wp), | intent(inout) | :: | c(n4) | |||
| real(kind=wp), | intent(inout) | :: | slope | |||
| real(kind=wp), | intent(inout) | :: | phi | |||
| integer, | intent(inout) | :: | isc(n2) | |||
| integer, | intent(inout) | :: | ic(n3) | |||
| integer, | intent(inout) | :: | ms1(n5) | |||
| integer, | intent(inout) | :: | nvc | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 | |||
| integer, | intent(in) | :: | n4 | |||
| integer, | intent(in) | :: | n5 |
Routine to solve one-dimensional search problem for constrained function minimization.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(inout) | :: | x(:) | |||
| real(kind=wp), | intent(inout) | :: | vlb(:) | |||
| real(kind=wp), | intent(inout) | :: | vub(:) | |||
| real(kind=wp), | intent(inout) | :: | g(:) | |||
| real(kind=wp), | intent(inout) | :: | scal(:) | |||
| real(kind=wp), | intent(inout) | :: | df(:) | |||
| real(kind=wp), | intent(inout) | :: | s(:) | |||
| real(kind=wp), | intent(inout) | :: | g1(:) | |||
| real(kind=wp), | intent(inout) | :: | g2(:) | |||
| real(kind=wp), | intent(inout) | :: | ctam | |||
| real(kind=wp), | intent(inout) | :: | ctbm | |||
| real(kind=wp), | intent(inout) | :: | slope | |||
| real(kind=wp), | intent(inout) | :: | alp | |||
| real(kind=wp), | intent(inout) | :: | a2 | |||
| real(kind=wp), | intent(inout) | :: | a3 | |||
| real(kind=wp), | intent(inout) | :: | a4 | |||
| real(kind=wp), | intent(inout) | :: | f1 | |||
| real(kind=wp), | intent(inout) | :: | f2 | |||
| real(kind=wp), | intent(inout) | :: | f3 | |||
| real(kind=wp), | intent(inout) | :: | cv1 | |||
| real(kind=wp), | intent(inout) | :: | cv2 | |||
| real(kind=wp), | intent(inout) | :: | cv3 | |||
| real(kind=wp), | intent(inout) | :: | cv4 | |||
| real(kind=wp), | intent(inout) | :: | alpca | |||
| real(kind=wp), | intent(inout) | :: | alpfes | |||
| real(kind=wp), | intent(inout) | :: | alpln | |||
| real(kind=wp), | intent(inout) | :: | alpmin | |||
| real(kind=wp), | intent(inout) | :: | alpnc | |||
| real(kind=wp), | intent(inout) | :: | alpsav | |||
| real(kind=wp), | intent(inout) | :: | alpsid | |||
| real(kind=wp), | intent(inout) | :: | alptot | |||
| integer, | intent(inout) | :: | isc(:) | |||
| integer, | intent(inout) | :: | ncal(2) | |||
| integer, | intent(inout) | :: | nvc | |||
| integer, | intent(inout) | :: | icount | |||
| integer, | intent(inout) | :: | igood1 | |||
| integer, | intent(inout) | :: | igood2 | |||
| integer, | intent(inout) | :: | igood3 | |||
| integer, | intent(inout) | :: | igood4 | |||
| integer, | intent(inout) | :: | ibest | |||
| integer, | intent(inout) | :: | iii | |||
| integer, | intent(inout) | :: | nlnc | |||
| integer, | intent(inout) | :: | jgoto |
Routine to find first xbar>=epscorresponding to a real zero
of a one-dimensional function by polynomial interpolation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conmin_class), | intent(inout) | :: | me | |||
| integer, | intent(inout) | :: | ii |
CALCULATION CONTROL: |
||
| real(kind=wp), | intent(out) | :: | xbar | |||
| real(kind=wp), | intent(in) | :: | eps |
may be negative |
||
| real(kind=wp), | intent(in) | :: | x1 | |||
| real(kind=wp), | intent(in) | :: | y1 | |||
| real(kind=wp), | intent(in) | :: | x2 | |||
| real(kind=wp), | intent(in) | :: | y2 | |||
| real(kind=wp), | intent(in) | :: | x3 | |||
| real(kind=wp), | intent(in) | :: | y3 |
Routine to solve special linear problem for imposing s-transpose times s<=1 bounds in the modified method of feasible directions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ndb | |||
| integer, | intent(out) | :: | ner |
NER = ERROR FLAG. IF NER/=0 ON RETURN, PROCESS HAS NOT CONVERGED IN 5*NDB ITERATIONS. |
||
| real(kind=wp), | intent(inout) | :: | c(n4) | |||
| integer, | intent(out) | :: | ms1(:) |
VECTOR MS1 IDENTIFIES THE SET OF BASIC VARIABLES. |
||
| real(kind=wp), | intent(inout) | :: | b(n3,n3) | |||
| integer, | intent(in) | :: | n3 | |||
| integer, | intent(in) | :: | n4 |