# TOMLAB  
# REGISTER (TOMLAB)
# LOGIN  
# myTOMLAB
TOMLAB LOGO

« Previous « Start » Next »

4  Setting solver options

SOCS offers a big number of options to control printing output and trim the solution process. The SOCS software consists of two inner solver parts:

  • the optimal control (OC) solver
  • the non-linear programming (NLP) solver

Options for these two parts are set separately and they have a separate set of available options. For both types of options, setting an option is done by assigning a value to a field of a structure, where the field name is the name of the option to set and the value is the value to assign the option.

OC options are set in the structure problem.options.OC and NLP options are set in the structure problem.options.NLP. An example of setting options is:

    problem.options.OC.MITODE  = 10; % maximum mesh refinements
    problem.options.NLP.IOFLAG = 20; % NLP solver print level

There are also two options that are not set through these structures. See problem.options.method and problem.options.nstg (3.3.39).

A complete description of the available options follows.

4.1  Optimal control (OC) options

The optimal control options are set in problem.options.OC.


Table 2: User options for the TOMLAB /SOCS OC solver.
OptionDesriptionDefault
 
Strings
 
KEYDPLDynamic Status Display Key. A string that defines the key for the dynamic status display. KEYDPL(1:1) defines the symbol that will be displayed when an inequality constraint is satisfied. KEYDPL(2:2) defines the symbol that will be displayed when an inequality is active at its lower bound. Thus, to denote active upper bounds by a 'U', and display nothing for all other constraints, the input string should be 'KEYDPL= U '. The default display key has the following interpretation:
.Satisfied Inequality
lActive Lower Bound
uActive Upper Bound
eEquality
iIgnored
LViolated Lower Bound
UViolated Upper Bound
EViolated Equality
.lueiLUE
 
RHSTMPCharacter variable name of right hand side sparsity template file.rhstemplate.fil
RSTFILCharacter variable name of restart file.socs.restart
SOCOUTCharacter variable defining the SOCS output control menu. The complete SOCS output is divided into distinct portions. Each portion of the SOCS output is defined by an alphabetic character. The level of output for each portion is specified by a number from 0 to 9, where 0 specifies no output, and more detailed output is obtained by a larger number. A default output configuration is defined by the quantities IPGRD and IPODE. For example the options
IPGRD=20
IPODE=20
                 
are equivalent to the single option
SOCOUT=['a0b0c1d1e1f1g0' ...
'h1i2j2k2l1m1n1o1p1q1r1s1']
                 

Thus, to alter the default output such that the variables, constraints, and objective function are printed at every iteration, the following options can be set:

IPGRD=20
IPODE=20
SOCOUT='I4J4K4'
                 

The distinct portions of the SOCS output are identified as follows:

AMathematical Optimal Control Interpretation
BRight Hand Side Sparsity
CTranscription Summary
DSOCS I/O Parameters
EVariable Grid Map
FConstraint Grid Map
GOptimal Control Scale
HIndex Sets and Sparsity
IVariables
JObjective Function
KConstraints
LControl Analysis Constraint
MRelative DAE Error
NDynamic Status Display
ODynamic Constraint Adjoints
PDynamic Variable Adjoints
QControl Analysis Lagrangian Errors
RControl Analysis Optimality Error
SGrid Refinement Summary
 
 
NLPALGNonlinear Programming Algorithm (HDSNLP, HDBLSQ, HDSLSQ or HDBNLP).HDSNLP
SPRTHSRight Hand Side Sparsity Option.
SPARSECompute and use sparsity for right hand sides of the user supplied functions.
DENSEAssume user supplied functions are dense.
FILERight Hand Side Sparsity Defined by User Supplied File
SPARSE
 
Reals
 
OBJTOLRelative error in the performance index between final value and predicted optimum.10−5
ODETOLRelative error in the solution of the differential equations on any phase.10−3
PGDTOLRelative error in the projected gradient (optimality conditions).10−3
RESTOLResolution tolerance between dynamic variable values from one mesh refinement iteration to the next.10−5
SMLTOLODE variable absolute tolerance.є1 /2
PRTMSDMinimum perturbation size for sparse finite difference derivatives.10−8
PRTMXDMaximum perturbation size for sparse finite difference derivatives.10−3
PRTSFDRelative perturbation size for sparse finite difference derivatives.10−5
TOLJSDJacobian row and column tolerance for print.10−6
TOLM5AAbsolute integration tolerance. Ignored when method ≠ 5.є1 /2
TOLM5RRelative integration tolerance. Ignored when method ≠ 5.є1 /2
Integers
 
IDTSFDDefault derivative type and index set construction algorithm for sparse finite differences (may be superceded by NLP).
IDTSFD>0Curtis-Powell-Reid (greedy) algorithm.
IDTSFD<0Coleman-Moré (graph coloring) algorithm.
|IDTSFD|=1forward difference (1-sided) derivatives.
|IDTSFD|=2central difference (2-sided) derivatives.
1
 
IPRSFDPertubation size option.
IPRSFD=0Pertubation size fixed at PRTSFD.
IPRSFD=+1Pertubation size between PRTMSD and PRTMXD computed to minimze truncation and roundoff error.
1
 
INCOREFlag determining “in core” usage. Large hold arrays are saved on scratch files in out of core mode.
INCORE=−1Out of core mode.
INCORE=0Out of core if necessary.
INCORE=+1Do not go out of core.
0
 
ISCALEAutomatic scaling option.
ISCALE= 0Automatic row and column scaling.
ISCALE= 1Automatic row, simple column scaling.
ISCALE= 2Simple row and column scaling.
0
 
IRSTRTFlag determining usage of restart file RSTFIL.
IRSTRT=−1Save file during solution process (write only).
IRSTRT=0Do not use file.
IRSTRT=+1Use file to start problem and update during solution process (read and write).
IRSTRT=+2Use file to start problem but do not update during solution process (read only).
0
 
ITSWCHMesh refinement iteration number to switch discretization from low order to high order.2
MITODEMaximum number of mesh refinement iterations (grids).5
MORDOCMaximum order of optimal control solution analysis.
MORDOC=0No analysis associated with first order necessary conditions (adjoint variables).
MORDOC=1First order analysis (necessary conditions).
0
 
MTSWCHHigh order discretization method for mesh refinement. If MTSWCH < 0 and NSSWCH < 0, high order discretization will be selected to minimize predicted solution time.-1
 
M5DTYPMethod 5 Derivative Type.
M5DTYP=0Internal (variational) derivatives.
M5DTYP=+1External (finite difference) derivatives.
0
 
NSSWCHHigh order stage number for mesh refinement.-1
IDSCPHDiscontinuity diagnostic phase number. Display diagnostic information on phase IDSCPH, where 1 ≤ IDSCPH ≤ N (number of phases). No diagnostic information is displayed unless IPGRD ≥ 10, and the inputs IDSCND, IDSCVR, and IDSCFN are also set.0
 
IDSCNDDiscontinuity diagnostic phase end. Display diagnostic information at the beginning of the phase when IDSCND = − 1, during the phase when IDSCND = 0, and at the end of the phase when IDSCND = + 1. No diagnostic information is displayed unless IPGRD ≥ 10, and the inputs IDSCPH, IDSCVR, and IDSCFN are also set.0
 
IDSCVRDiscontinuity diagnostic variable number. Display diagnostic information for variable IDSCVR, where 1 ≤ IDSCVR ≤ ns + nc + np. To display state variable k, set IDSCVR = k. To display control variable k, set IDSCVR = k + ns. To display parameter k, set IDSCVR = k + nc + ns. No diagnostic information is displayed unless IPGRD ≥ 10, and the inputs IDSCPH, IDSCND, and IDSCFN are also set.0
 
IDSCFNDiscontinuity diagnostic function number. When IDSCND = +1, or -1, set IDSCND = k to display point function k. When IDSCND = 0, set IDSCFN = k to display differential equation k. When IDSCND = 0, set IDSCFN = ns + k to display algebraic equation k. When IDSCND = 0, set IDSCFN = ns + npcon (nonlinear) + k to display quadrature equation k. No diagnostic information is displayed unless IPGRD ≥ 10, and the inputs IDSCPH, IDSCND, and IDSCVR are also set.0
 
IPFSFDSparse finite difference output level.
0=IPFSFDNo Output.
1=IPFSFDError messages and summary statistics.
2=IPFSFDComplete statistics.
3=IPFSFDDiagnostic output.
0
 
IPGRDOptimal control output level.
IPGRD=0No Output.
0<IPGRD<10Terse Output.
10≤IPGRD<20Phase level grid and errors.
20≤IPGRDState level errors, mathematical input interpretation, NLP variable and constraint maps.
10
 
IPNLPSparse NLP output level (equivalent to IOFLAG in NLP options); 0≤IPNLP≤30.
IPNLP=0No Output.
0<IPNLP<10Terse Output.
10≤IPNLP<20Standard Output.
20≤IPNLP<30Interpretive Output.
30=IPNLPDiagnostic Output.
10
 
IPODEDifferential equation output level; ; 0≤IPODE≤40.
0≤IPODE<10No Output.
10≤IPODE<20Phase end states, max constraint error.
20≤IPODE<30States/Constraints at every grid point.
30≤IPODE<40Gradient, Jacobian, and Hessian.
40≤IPODEDebug print at initial point.
0
 
 
 

4.2  Non-linear programming (NLP) options

The non-linear programming options are set in problem.options.NLP.


Table 3: User options for the TOMLAB /SOCS NLP solver.
OptionDesriptionDefault
 
Convergence and Termination Tolerances
 
CONTOLConstraint tolerance.є 1/2
OBJTOLObjective function tolerance.10−7
PGDTOLProjected gradient tolerance.10−5
MAXNFEMaximum number of function evaluations.10000
NITMAXMaximum number of iterations.100
NITMINMinimum number of iterations.0
 
Line Search
 
IT1MAXMaximum number of steps for line search.20
SLPTOLSlope tolerance δs for line search during optimization phase, where 10−5 < δs < 1. (SQP Only)0.9
SFZTOLSlope tolerance δs for line search during feasibility phase, where 10−5 < δs < 1. (SQP Only)0.01
 
Dense Algorithm Options
The following inputs can be used to control the calculation of gradient and Hessian information for the dense algorithms HDNLPD, HDBNPD, HDNLPR and HDBNPR
 
EPSRLFRelative perturbation size parameter, єR. The forward difference perturbation size is δF = (1 + |x|)|єR|.9 and the central difference perturbation size is δC = (1 + |x|)|єR|.6. For analytic functions it is appropriate to set єR = є1 /2 where є = machine epsilon. For EPSRLF ≥ є1 /2 finite difference perturbation sizes are fixed for all iterations. For EPSRLF ≤ −є1 /2 finite difference perturbation sizes are adjusted from iteration to iteration to minimize the finite difference error. EPSRLF is only used by the forward communication algorithm HDNLPD.є1 /2
 
IHESHNHessian matrix evaluation option; 0≤ |IHESHN| ≤3. When IHESHN ≤ 0, the Hessian diagonal elements are initialized to finite difference estimates.
IHESHN=0Finite difference or analytic.
IHESHN=1SR1 (Symmetric Rank One); the default for HDNLPD.
IHESHN=2BFGS (Symmetric Positive Definite).
IHESHN=3SSQN (Self-Scaling Quasi-Newton).
0
 
Barrier Algorithm Options
The following control the behavior of the barrier algorithms HDBNPD, HDBNPR, HDBNLP and HDBLPQ.
 
BIGCONUpper Bound on Equality Constraint Error.100
FEATOLInitial Variable Offset for Feasibility..001
PMULWRLower Bound on Initial Barrier Parameter..1
PTHTOLCentral Path Convergence Tolerance.10
RHOLWRLower Bound on Initial Relaxation Parameter. ρ100
IMAXMUMaximum Number of Iterations Nu with Fixed Barrier Parameter.10
MUCALCBarrier/Multiplier Initialization Option.; MUCALC 1,± 2, ± 3. There are three basic options where the symbol ∼ denotes the minimum norm least squares solution.

Option 1 (MUCALC = 1). Solve

   µ=PMULWR 
λ=µ Db−1 e 
CTηg − BTλ. 

Option 2 (MUCALC = ± 2). Solve

   ⎛
⎝
CTBTDb−1 e 
 ⎞
⎠
⎛
⎜
⎝
η 
 µ 
 ⎞
⎟
⎠
g 
   λ = max[µ, PMULWR ]Db−1 e

If MUCALC = 2 and µ < PMULWR, recompute using Option 1.

Option 3 (MUCALC = ± 3). Solve

   ⎛
⎜
⎝
CTBT
0Dbe 
 ⎞
⎟
⎠
⎛
⎜
⎜
⎝
η 
 λ 
 µ 
 ⎞
⎟
⎟
⎠
⎛
⎜
⎝
g 
 0 
⎞
⎟
⎠
   λ = max[є, λ]. 

where є = machine epsilon. If MUCALC = 3 and µ < PMULWR, recompute using Option 1.

3
 
MXQPITMaximum Number of Barrier QP Iterations.1
 
Algorithm Strategy Control
 
TOLFILTolerance used to detect excessive fill in the multifrontal method. A larger value of TOLFIL will permit additional fill.2
TOLKTCTolerance for the condition number of the KKT matrix. Iterative refinement is initiated when the condition number exceeds TOLKTC.є−1.6
TOLPVTMultifrontal pivot tolerance used to balance between sparsity and numeric stability. A small value reduces fill, and a large value improves stability.10−3
IRELAXConstraint relaxation strategy option flag.
IRELAX=0Do not switch to relaxation strategy.
IRELAX=1Switch to relaxation strategy if necessary to make progress.
IRELAX=2Always use relaxation strategy. (Barrier Only)
1
NEWTONNewton method option flag.
NEWTON=0Evaluate Hessian as needed to make good progress (not necessarily each optimization iteration).
NEWTON=1Evaluate Hessian on each optimization iteration.
NEWTON=2Do not evaluate Hessian on any iteration. (Barrier Only)
0
 
ALGOPTAlgorithm control option.
ALGOPT=FMFind feasible point then minimize (SQP Default).
ALGOPT=FMEFind feasible point then minimize with equalities binding. (SQP Only)
ALGOPT=MMinimize from the initial point (Barrier Default).
ALGOPT=FFind feasible point only.
ALGOPT=MWRMMinimize from the initial point (warm start). (SQP Only)
ALGOPT=MHOTMinimize from the initial point (hot start). (SQP Only)
ALGOPT=FWRMFind feasible point only (warm start). (SQP Only)
ALGOPT=FHOTFind feasible point only (hot start). (SQP Only)
ALGOPT=LLSQLinear Least Squares (only valid for HDSLSQ).
FM
 
KTOPTNKKT Matrix Factorization option.
KTOPTN=SMALLFactor KKT matrix consisting of active contraints (SQP Default). This is the default and is recommended for problems with many inequality constraints. Factor the condensed KKT matrix (Barrier Default).
KTOPTN=LARGEFactor the augmented KKT matrix with all constraints.
SMALL
 
QPOPTNQuadratic Programming Algorithm option.
QPOPTN=SPARSESolve QP subproblem using sparse Schur-complement method. This is the default for HDSNLP and HDSLSQ.
QPOPTN=DENSESolve QP subproblem using dense null-space method. This is the default for HDNLPD and HDNLPR. (SQP Only)
SPARSE
 
Postoptimality Options
Additional analysis of the Kuhn-Tucker optimality conditions can be invoked for diagnostic and/or interpretative purposes. This analysis utilizes the rank revealing sparse QR (RRQR) software (cf BCSLIB-EXT), and can be invoked only when QPOPTN=SPARSE. Two types of postoptimality analysis are possible. A first order analysis constructs information using gradient and Jacobian matrices (i.e. first derivative information). A second order analysis constructs information from the Jacobian and Hessian matrices. A second order analysis is performed when the active set and Lagrange multipliers are available, otherwise the analysis is first order. Execution of the postoptimality analysis is controlled by the following option.
 
IPOSTOPostoptimality analysis flag.
IPOSTO=0No Postoptimality Analysis.
IPOSTO=1Conditional Postoptimality Analysis. An analysis is performed at the final point when the NLP terminates with one of the following (nonstandard) values: IER = −131, −132, −133, +101, +105, +107, +108, +110, +111, +112, +113, +114.
IPOSTO=2Postoptimality Analysis at Termination. An analysis is performed at the final point regardless of the value of IER.
IPOSTO=3Postoptimality Analysis at Initial Point. An analysis is performed at the initial point, and the NLP is terminated with IER = +121.

The postoptimality algorithm displays diagnostic information in the print file.

0
 
Output Control Options
 
IOFLAGOutput level.
IOFLAG=0No Output.
0<IOFLAG<10Terse Output.
10≤IOFLAG<20Standard Output.
20≤IOFLAG<30Interpretive Output.
30=IOFLAGDiagnostic Output.

10
 
 

« Previous « Start » Next »