![]() |
minos
Purpose
MEX Interface for MINOS
For solving nonlinear programming or quadratic programming problems
Syntax
[hs, xs, pi, rc, Inform, nS, nInf, sInf, Obj, iwCount, gObj, fCon, gCon] = ...
minos(H, A, bl, bu, nnCon, nnObj, nnJac, Prob, iObj, optPar, ...
Warm, hs, xs, pi, nS, ...
SpecsFile, PrintFile, SummFile, ...
PriLev, ObjAdd, moremem, ProbName );
Description
minos either solves the following nonlinear programming
problem (NLP):
minimize f(x) + c'x subject to:
x ( x )
bl <= ( g(x) ) <= bu
( Ax )
where
A is an mA x n sparse matrix (linear constraints)
c is a n x 1 vector of linear objective coefficients.
f(x) has nnObj nonlinear variables
g(x) has dimension nnCon.
The Jacobian is d/dx g(x) has nnJac variables, and ne nonzero elements
or the quadratic programming problem (QP):
minimize 0.5 * x' * H * x + c'x subject to:
x ( x )
bl <= ( g(x) ) <= bu
( Ax )
Full input matrix A has three parts A = [d/dx g(x); A; c'];
The position of the row c' is iObj. iObj=0 means no linear part
bl, bu have dimension m=n+nnCon+mA+(iObj~=0)
If nnObj = nnJac = nnCon = 0, and g(x) is empty, a standard sparse (LP)
is solved in an efficient way.
Note that for a standard QP g(x) is empty. However, as the interface
is implemented, nonempty g(x) is handled the same way as for general NLP
If running TOMLAB
bl and bu and other inputs are generated in
minosTL for NLP problems (or
minosqpTL for QP problems, or minoslpTL
for LP problems) from Prob input.
Define nonlinear functions, constraints and gradients for the
function and constraints according to TOMLAB standard. Use
GUI, menu system tomMenu, driver routine
tomRun or mexRun. Do not call minos.m
directly.
If not running TOMLAB
The file 'funfdf.m' must be defined and contain:
function [mode,f,g]=funfdf(x,Prob,mode,nstate) to compute the
objective function f and the gradient g at the
point x.
funcdc.m' must be defined and contain:
function [mode,c,dcS]=funcdc(x,Prob,mode,nstate) to compute the
nonlinear constraint value c and the constraint
Jacobian dcS for the nonlinear constraints at the point
x.
NOTE: The matrix dcS MUST be a SPARSE MATLAB matrix.
Do dcS = sparse(dcS); after dcS has been computed.
See comments below for the INPUT variable Prob.
Input Parameters
H Matrix n x n in a quadratic programming (QP) problem.
DENSE or SPARSE. Leave empty if LP, or NLP problem.
A Constraint matrix, m x n SPARSE (nonlinear, linear and objective)
m > 0 always!!! Define dummy constraint for unconstrained
problems.
bl Lower bounds on (x,g(x),Ax,c').
bu Upper bounds on (x,g(x),Ax,c').
NOTE! The bl and bu values for the last nonlinear constraint c
must have reverse signs and be put in each other places:
If c_L <= c(x) <= c_U, then bl = -c_U and bu = -c_L.
This is because the bounds acts as the constraints on the
slack variables for the nonlinear constraints.
nnCon Number of nonlinear constraints.
nnObj Number of nonlinear objective variables.
nnJac Number of nonlinear Jacobian variables.
Prob Must be a structure. No check is made in the MEX interface.
If TOMLAB calls minos, then Prob is the standard
TOMLAB problem structure, otherwise the user should set:
Prob.P = ProblemNumber, where ProblemNumber is some integer.
If the problem is a LP or QP problem (H defined), the user
does not have to specify anything else in the structure.
For a general nonlinear objective or nonlinear constraints
names of two user written routines must be given:
funfdf, actual name stored in Prob.USER.fg, with syntax
[mode, f, g] = funfdf(x, Prob, mode, nstate)
funcdc, actual name stored in Prob.USER.cdc, with syntax
[mode, c, dcS] = funcdc(x, Prob, mode, nstate)
MINOS is calling the TOMLAB routines nlp_fg.m and nlp_cdcS.m
in the callback, and they call funfdf and funcdc, respectively.
If these fields in Prob are empty (Prob.USER.fg, Prob.USER.cdc),
the TOMLAB callback routines calls the usual function routines.
Then the Prob struct should be normally defined, and
the fields Prob.USER.f, Prob.USER.g, Prob.USER.c, Prob.USER.dc
be set in the normal way (e.g. by the routine mFiles.m, or one
of the Assign-routines like conAssign.m).
If the mode parameter is 0, funfdf should return f, otherwise
both f and the gradient vector g.
If the mode parameter is 0, funcdc should return c, otherwise
both c and dcS. Note that each row in dcS corresponds to a
constraint, and that dcS must be a SPARSE matrix.
The user could also write his own versions of the routines
nlp_fg.m and nlp_cdcS.m and put them before in the path.
iObj Says which row of A is a free row containing a linear objective
vector c. If there is no such vector, iObj = 0. Otherwise, this
row must come after any nonlinear rows, so that nnCon <= iObj <= m
optPar Vector with optimization parameters overriding defaults and the
optionally specified SPECS file.
If using only default options, set optPar as an empty matrix.
Warm Flag, if true: warm start. Default cold start (if empty)
If 'Warm Start' xs, nS and hs must be supplied with correct
values.
hs Basis status of variables + constraints (n+m x 1 vector)
State of variables: 0=nonbasic (on bl), 1=nonbasic (on bu)
2=superbasic (between bounds), 3=basic (between bounds).
xs Initial vector, optionally including m slacks at the end.
If warm start, full xs must be supplied.
pi Lagrangian multipliers for the nnCon nonlinear constraints.
If empty, set as 0.
nS # of superbasics. Only used if calling again with a Warm Start.
SpecsFile Name of the SPECS input parameter file, see MINOS Guide, ch.6.
Fortran unit 20 is used to read the SpecsFile in the interface.
PrintFile Name of the Print file. Fortran unit 9 is used if not optPar(3) > 0.
Name includes the path, maximal number of characters = 500.
SummFile Name of the Summary file. Fortran unit 8 is used if not optPar(3) > 0.
Name includes the path, maximal number of characters = 500.
PriLev Printing level in the minos m-file and minos MEX-interface.
= 0 Silent
= 1 Summary information
= 2 More detailed information
ObjAdd Constant added to the objective for printing purposes, typically 0.
moremem Add extra memory for the sparse LU, might speed up the optimization.
If empty, set as 0.
ProbName Name of the problem. <=100 characters are used in the MEX interface.
In the MINOS solver the first 8 characters are used in the printed
solution and in some routines that output BASIS files. Blank is OK.
Description of the optPar vector
Use missing value (-999 or less), when no change of parameter
setting is wanted. No call is then done to internal routines miopti
or mioptr. The default
value will then be used by MINOS, unless the value is altered in
the SPECS file.
Define: nnL = max(nnObj,nnJac)
# SPECS keyword text Lower Default Upper Comment
Printing
1. PRINT LEVEL 0 0 11111 JFLXB:
Jac, fCon, lambda, x, B=LU stats
3. PRINT FILE 0 0 99 Fortran Unit #
4. SUMMARY FILE 0 0 99 Fortran Unit #
5. PRINT FREQUENCY 0 100
6. SUMMARY FREQUENCY 0 1
7. SOLUTION YES/NO 0 1 1 1 = YES; 0 = NO
8. SUPPRESS PARAMETERS 0 0 1 1 = True
Convergence Tolerances
9. ROW TOLERANCE >0 1E-6
10. OPTIMALITY TOLERANCE >0 max(1E-6,(10eps_R)^0.5) = 1.73E-6
11. FEASIBILITY TOLERANCE >0 1E-6
Derivative checking
13. VERIFY LEVEL -1 0 3 {-1,0,1,2,3}
14. START OBJECTIVE CHECK AT COL 0 1 nnObj
15. STOP OBJECTIVE CHECK AT COL 0 nnObj nnObj
16. START CONSTRAINT CHECK AT COL 0 1 nnJac
17. STOP CONSTRAINT CHECK AT COL 0 nnJac nnJac
Scaling
18. SCALE OPTION 0 1 or 2 2 2 if LP,1 if NLP
19. SCALE TOLERANCE >0 0.9 <1
20. SCALE PRINT 0 0 1 1 = True
Other Tolerances
21. CRASH TOLERANCE 0 0.1 <1
22. LINESEARCH TOLERANCE >0 0.9 <1
23. LU FACTOR TOLERANCE 1 100 or 5 100 if LP
24. LU UPDATE TOLERANCE 1 10 or 5 10 if LP
25. LU DENSITY TOLERANCE >0 0.5
26. LU SINGULARITY TOLERANCE >0 3.25E-11 eps^(0.67)
27. PIVOT TOLERANCE >0 3.25E-11 eps^(0.67)
LP or LC subproblems
28. CRASH OPTION 0 3 3 {0,1,2,3}
29. WEIGHT ON LINEAR OBJECTIVE 0.0 0.0 during Phase 1
30. ITERATION LIMIT 0 3m + 10nnL
31. PARTIAL PRICE 1 10 or 1 10 for LP
32. MAXIMIZE 0 0 1 1=maximize
SLC method
33. LAGRANGIAN 0 1 1 1=YES, 0=NO
34. PENALTY PARAMETER 0.0 1.0
35. MAJOR ITERATIONS LIMIT >0 50
36. MINOR ITERATIONS LIMIT >0 40
37. MAJOR DAMPING PARAMETER >0 2.0
38. MINOR DAMPING PARAMETER >0 2.0
39. DERIVATIVE LEVEL 0 3 3 {0,1,2,3}
40. RADIUS OF CONVERGENCE 0.0 0.01
41. FUNCTION PRECISION >0 3.0E-13 eps^0.8=eps_R
42. DIFFERENCE INTERVAL >0 5.48E-8 eps^0.4
43. CENTRAL DIFFERENCE INTERVAL >0 6.70E-5 eps^{0.8/3}
44. COMPLETION 0 1 LC, 0 NC 1 0=PARTIAL 1=FULL
45. UNBOUNDED STEP SIZE >0 1E20
46. UNBOUNDED OBJECTIVE >0 1E10
Hessian approximation
47. HESSIAN DIMENSION 1 50 1+nnL
48. SUPERBASICS LIMIT 1 50 1+nnL
Frequencies
51. CHECK FREQUENCY >0 60
52. EXPAND FREQUENCY >0 10000
53. FACTORIZATION FREQUENCY >0 50
54. SAVE FREQUENCY >0 100
BASIS files
55. OLD BASIS file 0 0
56. NEW BASIS file 0 0
57. BACKUP BASIS file 0 0
58. INSERT file 0 0
59. PUNCH file 0 0
60. LOAD file 0 0
61. DUMP file 0 0
62. SOLUTION file 0 0
63. LU COMPLETE PIVOTING 0 0 1=complete, 0=partial
or LU PARTIAL PIVOTING
Output Parameters
hs Basis status of variables + constraints (n+m x 1 vector).
State of variables: 0=nonbasic (on bl), 1=nonbasic (on bu)
2=superbasic (between bounds), 3=basic (between bounds).
xs Solution vector (n+m by 1) with n decision variable values
together with the m slack variables.
pi Lagrangian multipliers (dual solution vector) (m x 1 vector).
rc Reduced costs, a n+m vector. If nInf=0, last m == -pi
Inform Result of MINOS run.
0 = Optimal solution found
nS # of superbasics.
nInf Number of infeasibilities.
sInf Sum of infeasibilities.
Obj Objective function value at optimum.
iwCount Number of iterations (major and minor),
function and constraint calls.
gObj Gradient of the nonlinear objective.
fCon Nonlinear constraint vector.
gCon Gradient vector (non-zeros) of the nonlinear constraint vector.
See Also
MINOS, minosTL
| minosTL | ![]() |