Functions
Title

Functions

CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const SXDict &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const MXDict &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const std::string &fname, const Dict &opts=Dict())
 
CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const Importer &compiler, const Dict &opts=Dict())
 
CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const NlpBuilder &nl, const Dict &opts=Dict())
 
CASADI_EXPORT Function casadi::nlpsol (const std::string &name, const std::string &solver, const Function &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT std::vector< std::string > casadi::nlpsol_in ()
 Get input scheme of NLP solvers. More...
 
CASADI_EXPORT std::vector< std::string > casadi::nlpsol_out ()
 Get NLP solver output scheme of NLP solvers. More...
 
CASADI_EXPORT std::string casadi::nlpsol_in (casadi_int ind)
 Get NLP solver input scheme name by index. More...
 
CASADI_EXPORT std::string casadi::nlpsol_out (casadi_int ind)
 Get output scheme name by index. More...
 
CASADI_EXPORT casadi_int casadi::nlpsol_n_in ()
 Number of NLP solver inputs. More...
 
CASADI_EXPORT casadi_int casadi::nlpsol_n_out ()
 Number of NLP solver outputs. More...
 
CASADI_EXPORT std::vector< std::string > casadi::nlpsol_options (const std::string &name)
 Get all options for a plugin. More...
 
CASADI_EXPORT std::string casadi::nlpsol_option_type (const std::string &name, const std::string &op)
 Get type info for a particular option. More...
 
CASADI_EXPORT std::string casadi::nlpsol_option_info (const std::string &name, const std::string &op)
 Get documentation for a particular option. More...
 
CASADI_EXPORT bool casadi::has_nlpsol (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void casadi::load_nlpsol (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string casadi::doc_nlpsol (const std::string &name)
 Get the documentation string for a plugin. More...
 
CASADI_EXPORT double casadi::nlpsol_default_in (casadi_int ind)
 Default input for an NLP solver. More...
 
CASADI_EXPORT std::vector< double > casadi::nlpsol_default_in ()
 Default input for an NLP solver. More...
 

Detailed Description

Create an NLP solver Creates a solver for the following parametric nonlinear program (NLP):

min          F(x, p)
x

subject to
LBX <=   x    <= UBX
LBG <= G(x, p) <= UBG
p  == P

nx: number of decision variables
ng: number of constraints
np: number of parameters

General information


List of available options
IdTypeDescriptionUsed in
ad_weightOT_DOUBLEWeighting factor for derivative calculation.When there is an option of either using forward or reverse mode directional derivatives, the condition ad_weight*nf<=(1-ad_weight)*na is used where nf and na are estimates of the number of forward/reverse mode directional derivatives needed. By default, ad_weight is calculated automatically, but this can be overridden by setting this option. In particular, 0 means forcing forward mode and 1 forcing reverse mode. Leave unset for (class specific) heuristics.casadi::FunctionInternal
ad_weight_spOT_DOUBLEWeighting factor for sparsity pattern calculation calculation.Overrides default behavior. Set to 0 and 1 to force forward and reverse mode respectively. Cf. option "ad_weight". When set to -1, sparsity is completely ignored and dense matrices are used.casadi::FunctionInternal
always_inlineOT_BOOLForce inlining.casadi::FunctionInternal
bound_consistencyOT_BOOLEnsure that primal-dual solution is consistent with the boundscasadi::Nlpsol
cacheOT_DICTPrepopulate the function cache. Default: emptycasadi::FunctionInternal
calc_fOT_BOOLCalculate 'f' in the Nlpsol base classcasadi::Nlpsol
calc_gOT_BOOLCalculate 'g' in the Nlpsol base classcasadi::Nlpsol
calc_lam_pOT_BOOLCalculate 'lam_p' in the Nlpsol base classcasadi::Nlpsol
calc_lam_xOT_BOOLCalculate 'lam_x' in the Nlpsol base classcasadi::Nlpsol
calc_multipliersOT_BOOLCalculate Lagrange multipliers in the Nlpsol base classcasadi::Nlpsol
common_optionsOT_DICTOptions for auto-generated functionscasadi::OracleFunction
compilerOT_STRINGJust-in-time compiler plugin to be used.casadi::FunctionInternal
custom_jacobianOT_FUNCTIONOverride CasADi's AD. Use together with 'jac_penalty': 0. Note: Highly experimental. Syntax may break often.casadi::FunctionInternal
der_optionsOT_DICTDefault options to be used to populate forward_options, reverse_options, and jacobian_options before those options are merged in.casadi::FunctionInternal
derivative_ofOT_FUNCTIONThe function is a derivative of another function. The type of derivative (directional derivative, Jacobian) is inferred from the function name.casadi::FunctionInternal
detect_simple_boundsOT_BOOLAutomatically detect simple bounds (lbx/ubx) (default false). This is hopefully beneficial to speed and robustness but may also have adverse affects: 1) Subtleties in heuristics and stopping criteria may change the solution, 2) IPOPT may lie about multipliers of simple equality bounds unless 'fixed_variable_treatment' is set to 'relax_bounds'.casadi::Nlpsol
detect_simple_bounds_is_simpleOT_BOOLVECTORFor internal use only.casadi::Nlpsol
detect_simple_bounds_partsOT_FUNCTIONFor internal use only.casadi::Nlpsol
detect_simple_bounds_target_xOT_INTVECTORFor internal use only.casadi::Nlpsol
discreteOT_BOOLVECTORIndicates which of the variables are discrete, i.e. integer-valuedcasadi::Nlpsol
dumpOT_BOOLDump function to file upon first evaluation. [false]casadi::FunctionInternal
dump_dirOT_STRINGDirectory to dump inputs/outputs to. Make sure the directory exists [.]casadi::FunctionInternal
dump_formatOT_STRINGChoose file format to dump matrices. See DM.from_file [mtx]casadi::FunctionInternal
dump_inOT_BOOLDump numerical values of inputs to file (readable with DM.from_file) [default: false]casadi::FunctionInternal
dump_outOT_BOOLDump numerical values of outputs to file (readable with DM.from_file) [default: false]casadi::FunctionInternal
enable_fdOT_BOOLEnable derivative calculation by finite differencing. [default: false]]casadi::FunctionInternal
enable_forwardOT_BOOLEnable derivative calculation using generated functions for Jacobian-times-vector products - typically using forward mode AD - if available. [default: true]casadi::FunctionInternal
enable_jacobianOT_BOOLEnable derivative calculation using generated functions for Jacobians of all differentiable outputs with respect to all differentiable inputs - if available. [default: true]casadi::FunctionInternal
enable_reverseOT_BOOLEnable derivative calculation using generated functions for transposed Jacobian-times-vector products - typically using reverse mode AD - if available. [default: true]casadi::FunctionInternal
equalityOT_BOOLVECTORIndicate an upfront hint which of the constraints are equalities. Some solvers may be able to exploit this knowledge. When true, the corresponding lower and upper bounds are assumed equal. When false, the corresponding bounds may be equal or different.casadi::Nlpsol
error_on_failOT_BOOLThrow exceptions when function evaluation fails (default true).casadi::ProtoFunction
eval_errors_fatalOT_BOOLWhen errors occur during evaluation of f,g,...,stop the iterationscasadi::Nlpsol
expandOT_BOOLReplace MX with SX expressions in problem formulation [false]casadi::OracleFunction
external_transformOT_VECTORVECTORList of external_transform instruction arguments. Default: emptycasadi::FunctionInternal
fd_methodOT_STRINGMethod for finite differencing [default 'central']casadi::FunctionInternal
fd_optionsOT_DICTOptions to be passed to the finite difference instancecasadi::FunctionInternal
forward_optionsOT_DICTOptions to be passed to a forward mode constructorcasadi::FunctionInternal
gather_statsOT_BOOLDeprecated option (ignored): Statistics are now always collected.casadi::FunctionInternal
ignore_check_vecOT_BOOLIf set to true, the input shape of F will not be checked.casadi::Nlpsol
input_schemeOT_STRINGVECTORDeprecated option (ignored)casadi::FunctionInternal
inputs_checkOT_BOOLThrow exceptions when the numerical values of the inputs don't make sensecasadi::FunctionInternal
is_diff_inOT_BOOLVECTORIndicate for each input if it should be differentiable.casadi::FunctionInternal
is_diff_outOT_BOOLVECTORIndicate for each output if it should be differentiable.casadi::FunctionInternal
iteration_callbackOT_FUNCTIONA function that will be called at each iteration with the solver as input. Check documentation of Callback.casadi::Nlpsol
iteration_callback_ignore_errorsOT_BOOLIf set to true, errors thrown by iteration_callback will be ignored.casadi::Nlpsol
iteration_callback_stepOT_INTOnly call the callback function every few iterations.casadi::Nlpsol
jac_penaltyOT_DOUBLEWhen requested for a number of forward/reverse directions, it may be cheaper to compute first the full jacobian and then multiply with seeds, rather than obtain the requested directions in a straightforward manner. Casadi uses a heuristic to decide which is cheaper. A high value of 'jac_penalty' makes it less likely for the heurstic to chose the full Jacobian strategy. The special value -1 indicates never to use the full Jacobian strategycasadi::FunctionInternal
jacobian_optionsOT_DICTOptions to be passed to a Jacobian constructorcasadi::FunctionInternal
jitOT_BOOLUse just-in-time compiler to speed up the evaluationcasadi::FunctionInternal
jit_cleanupOT_BOOLCleanup up the temporary source file that jit creates. Default: truecasadi::FunctionInternal
jit_nameOT_STRINGThe file name used to write out code. The actual file names used depend on 'jit_temp_suffix' and include extensions. Default: 'jit_tmp'casadi::FunctionInternal
jit_optionsOT_DICTOptions to be passed to the jit compiler.casadi::FunctionInternal
jit_serializeOT_STRINGSpecify behaviour when serializing a jitted function: SOURCE|link|embed.casadi::FunctionInternal
jit_temp_suffixOT_BOOLUse a temporary (seemingly random) filename suffix for generated code and libraries. This is desired for thread-safety. This behaviour may defeat caching compiler wrappers. Default: truecasadi::FunctionInternal
max_ioOT_INTAcceptable number of inputs and outputs. Warn if exceeded.casadi::FunctionInternal
max_num_dirOT_INTSpecify the maximum number of directions for derivative functions. Overrules the builtin optimized_num_dir.casadi::FunctionInternal
min_lamOT_DOUBLEMinimum allowed multiplier valuecasadi::Nlpsol
monitorOT_STRINGVECTORSet of user problem functions to be monitoredcasadi::OracleFunction
never_inlineOT_BOOLForbid inlining.casadi::FunctionInternal
no_nlp_gradOT_BOOLPrevent the creation of the 'nlp_grad' functioncasadi::Nlpsol
oracle_optionsOT_DICTOptions to be passed to the oracle functioncasadi::Nlpsol
output_schemeOT_STRINGVECTORDeprecated option (ignored)casadi::FunctionInternal
post_expandOT_BOOLAfter construction, expand this Function. Default: Falsecasadi::FunctionInternal
post_expand_optionsOT_DICTOptions to be passed to post-construction expansion. Default: emptycasadi::FunctionInternal
print_inOT_BOOLPrint numerical values of inputs [default: false]casadi::FunctionInternal
print_outOT_BOOLPrint numerical values of outputs [default: false]casadi::FunctionInternal
print_timeOT_BOOLprint information about execution time. Implies record_time.casadi::ProtoFunction
record_timeOT_BOOLrecord information about execution time, for retrieval with stats().casadi::ProtoFunction
regularity_checkOT_BOOLThrow exceptions when NaN or Inf appears during evaluationcasadi::ProtoFunction
reverse_optionsOT_DICTOptions to be passed to a reverse mode constructorcasadi::FunctionInternal
sens_linsolOT_STRINGLinear solver used for parametric sensitivities (default 'qr').casadi::Nlpsol
sens_linsol_optionsOT_DICTLinear solver options used for parametric sensitivities.casadi::Nlpsol
show_eval_warningsOT_BOOLShow warnings generated from function evaluations [true]casadi::OracleFunction
specific_optionsOT_DICTOptions for specific auto-generated functions, overwriting the defaults from common_options. Nested dictionary.casadi::OracleFunction
user_dataOT_VOIDPTRA user-defined field that can be used to identify the function or pass additional informationcasadi::FunctionInternal
verboseOT_BOOLVerbose evaluation – for debuggingcasadi::ProtoFunction
verbose_initOT_BOOLPrint out timing information about the different stages of initializationcasadi::Nlpsol
warn_initial_boundsOT_BOOLWarn if the initial guess does not satisfy LBX and UBXcasadi::Nlpsol

Input scheme: casadi::NlpsolInput (NLPSOL_NUM_IN = 8)
Full nameShortDescription
NLPSOL_X0x0Decision variables, initial guess (nx x 1)
NLPSOL_PpValue of fixed parameters (np x 1)
NLPSOL_LBXlbxDecision variables lower bound (nx x 1), default -inf.
NLPSOL_UBXubxDecision variables upper bound (nx x 1), default +inf.
NLPSOL_LBGlbgConstraints lower bound (ng x 1), default -inf.
NLPSOL_UBGubgConstraints upper bound (ng x 1), default +inf.
NLPSOL_LAM_X0lam_x0Lagrange multipliers for bounds on X, initial guess (nx x 1)
NLPSOL_LAM_G0lam_g0Lagrange multipliers for bounds on G, initial guess (ng x 1)

Output scheme: casadi::NlpsolOutput (NLPSOL_NUM_OUT = 6)
Full nameShortDescription
NLPSOL_XxDecision variables at the optimal solution (nx x 1)
NLPSOL_FfCost function value at the optimal solution (1 x 1)
NLPSOL_GgConstraints function at the optimal solution (ng x 1)
NLPSOL_LAM_Xlam_xLagrange multipliers for bounds on X at the solution (nx x 1)
NLPSOL_LAM_Glam_gLagrange multipliers for bounds on G at the solution (ng x 1)
NLPSOL_LAM_Plam_pLagrange multipliers for bounds on P at the solution (np x 1)

List of plugins

- AmplInterface

- blocksqp

- bonmin

- fatrop

- ipopt

- knitro

- madnlp

- snopt

- worhp

- feasiblesqpmethod

- qrsqp

- scpgen

- sqpmethod

Note: some of the plugins in this list might not be available on your system. Also, there might be extra plugins available to you that are not listed here. You can obtain their documentation with Nlpsol.doc("myextraplugin")


AmplInterface


List of available options
IdTypeDescription
solverOT_STRINGAMPL solver binary

blocksqp

This is a modified version of blockSQP by Janka et al.

Author
Dennis Janka, Joel Andersson
Date
2012-2015, 2016

Extra doc: https://github.com/casadi/casadi/wiki/L_224


List of available options
IdTypeDescription
block_hessOT_INTBlockwise Hessian approximation?
col_epsOT_DOUBLEEpsilon for COL scaling strategy
col_tau1OT_DOUBLEtau1 for COL scaling strategy
col_tau2OT_DOUBLEtau2 for COL scaling strategy
conv_strategyOT_INTConvexification strategy
deltaOT_DOUBLEFilter line search parameter, cf. IPOPT paper
delta_h0OT_DOUBLEFilter line search parameter, cf. IPOPT paper
epsOT_DOUBLEValues smaller than this are regarded as numerically zero
etaOT_DOUBLEFilter line search parameter, cf. IPOPT paper
fallback_scalingOT_INTIf indefinite update is used, the type of fallback strategy
fallback_updateOT_INTIf indefinite update is used, the type of fallback strategy
gamma_fOT_DOUBLEFilter line search parameter, cf. IPOPT paper
gamma_thetaOT_DOUBLEFilter line search parameter, cf. IPOPT paper
globalizationOT_BOOLEnable globalization
hess_dampOT_INTActivate Powell damping for BFGS
hess_damp_facOT_DOUBLEDamping factor for BFGS Powell modification
hess_lim_memOT_INTFull or limited memory
hess_memsizeOT_INTMemory size for L-BFGS updates
hess_scalingOT_INTScaling strategy for Hessian approximation
hess_updateOT_INTType of Hessian approximation
ini_hess_diagOT_DOUBLEInitial Hessian guess: diagonal matrix diag(iniHessDiag)
kappa_fOT_DOUBLEFilter line search parameter, cf. IPOPT paper
kappa_minusOT_DOUBLEFilter line search parameter, cf. IPOPT paper
kappa_plusOT_DOUBLEFilter line search parameter, cf. IPOPT paper
kappa_plus_maxOT_DOUBLEFilter line search parameter, cf. IPOPT paper
kappa_socOT_DOUBLEFilter line search parameter, cf. IPOPT paper
linsolOT_STRINGThe linear solver to be used by the QP method
max_consec_reduced_stepsOT_INTMaximum number of consecutive reduced steps
max_consec_skipped_updatesOT_INTMaximum number of consecutive skipped updates
max_conv_qpOT_INTHow many additional QPs may be solved for convexification per iteration?
max_it_qpOT_INTMaximum number of QP iterations per SQP iteration
max_iterOT_INTMaximum number of SQP iterations
max_line_searchOT_INTMaximum number of steps in line search
max_soc_iterOT_INTMaximum number of SOC line search iterations
max_time_qpOT_DOUBLEMaximum number of time in seconds per QP solve per SQP iteration
nlinfeastolOT_DOUBLENonlinear feasibility tolerance
obj_loOT_DOUBLELower bound on objective function [-inf]
obj_upOT_DOUBLEUpper bound on objective function [inf]
opttolOT_DOUBLEOptimality tolerance
print_headerOT_BOOLPrint solver header at startup
print_iterationOT_BOOLPrint SQP iterations
print_maxit_reachedOT_BOOLPrint error when maximum number of SQP iterations reached
qp_initOT_BOOLUse warmstarting
qpsolOT_STRINGThe QP solver to be used by the SQP method
qpsol_optionsOT_DICTOptions to be passed to the QP solver
restore_feasOT_BOOLUse feasibility restoration phase
rhoOT_DOUBLEFeasibility restoration phase parameter
s_fOT_DOUBLEFilter line search parameter, cf. IPOPT paper
s_thetaOT_DOUBLEFilter line search parameter, cf. IPOPT paper
schurOT_BOOLUse qpOASES Schur compliment approach
skip_first_globalizationOT_BOOLNo globalization strategy in first iteration
theta_maxOT_DOUBLEFilter line search parameter, cf. IPOPT paper
theta_minOT_DOUBLEFilter line search parameter, cf. IPOPT paper
warmstartOT_BOOLUse warmstarting
which_second_dervOT_INTFor which block should second derivatives be provided by the user
zetaOT_DOUBLEFeasibility restoration phase parameter

bonmin

When in warmstart mode, output NLPSOL_LAM_X may be used as input

NOTE: Even when max_iter == 0, it is not guaranteed that input(NLPSOL_X0) == output(NLPSOL_X). Indeed if bounds on X or constraints are unmet, they will differ.

For a good tutorial on BONMIN, see http://drops.dagstuhl.de/volltexte/2009/2089/pdf/09061.WaechterAndreas.Paper.2089.pdf

A good resource about the algorithms in BONMIN is: Wachter and L. T. Biegler, On the Implementation of an Interior-Point Filter Line-Search Algorithm for Large-Scale Nonlinear Programming, Mathematical Programming 106(1), pp. 25-57, 2006 (As Research Report RC 23149, IBM T. J. Watson Research Center, Yorktown, USA

Caveats:


List of available options
IdTypeDescription
bonminOT_DICTOptions to be passed to BONMIN
con_integer_mdOT_DICTInteger metadata (a dictionary with lists of integers) about constraints to be passed to BONMIN
con_numeric_mdOT_DICTNumeric metadata (a dictionary with lists of reals) about constraints to be passed to BONMIN
con_string_mdOT_DICTString metadata (a dictionary with lists of strings) about constraints to be passed to BONMIN
grad_fOT_FUNCTIONFunction for calculating the gradient of the objective (column, autogenerated by default)
grad_f_optionsOT_DICTOptions for the autogenerated gradient of the objective.
hess_lagOT_FUNCTIONFunction for calculating the Hessian of the Lagrangian (autogenerated by default)
hess_lag_optionsOT_DICTOptions for the autogenerated Hessian of the Lagrangian.
jac_gOT_FUNCTIONFunction for calculating the Jacobian of the constraints (autogenerated by default)
jac_g_optionsOT_DICTOptions for the autogenerated Jacobian of the constraints.
pass_nonlinear_constraintsOT_BOOLPass list of constraints entering nonlinearly to BONMIN
pass_nonlinear_variablesOT_BOOLPass list of variables entering nonlinearly to BONMIN
sos1_groupsOT_INTVECTORVECTOROptions for the autogenerated gradient of the objective.
sos1_prioritiesOT_INTVECTOROptions for the autogenerated gradient of the objective.
sos1_weightsOT_DOUBLEVECTORVECTOROptions for the autogenerated gradient of the objective.
var_integer_mdOT_DICTInteger metadata (a dictionary with lists of integers) about variables to be passed to BONMIN
var_numeric_mdOT_DICTNumeric metadata (a dictionary with lists of reals) about variables to be passed to BONMIN
var_string_mdOT_DICTString metadata (a dictionary with lists of strings) about variables to be passed to BONMIN

fatrop


List of available options
IdTypeDescription
NOT_INTOCP horizon
convexify_marginOT_DOUBLEWhen using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7).
convexify_strategyOT_STRINGNONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver.
debugOT_BOOLProduce debug information (default: false)
fatropOT_DICTOptions to be passed to fatrop
ngOT_INTVECTORNumber of non-dynamic constraints, length N+1
nuOT_INTVECTORNumber of controls, length N+1
nxOT_INTVECTORNumber of states, length N+1
structure_detectionOT_STRINGNONE | auto | manual

Fatrop is a solver developed at KU Leuven by Lander Vanroye and Wilm Decre. The algorithm is based on IPOPT, but the linear algebra is much more efficient.

With structure_detection = 'none' (default), it will behave as a general-purpose dense nonlinear program solver.

With structure_detection = 'manual', you can specify a block structure.

Let's say you perform multiply shooting with a system

x_k+1 = A_k x_k + B_k u_k

Suppose your constraint Jacobian looks like:

 nx0  nu0  nx1  nu1  nx2  nu2
 -----------------------------

nx1 |A0 B0 I0
ng1 |C0 D0
nx2 | A1 B1 I1
ng2 | C1 D1
ng3 | C2 D2

with n* capturing the number of states, inputs, and constraints in each block.

You can then specify this structure with:

N = 2 nx = [nx0 ,nx1, nx2] nu = [nu0, nu1, nu2] ng = [ng1, ng2, ng3]

With structure_detection = 'auto', the block-defining parameters nx, nu, ng, and N are automatically detected from the sparsity pattern.


ipopt

When in warmstart mode, output NLPSOL_LAM_X may be used as input

NOTE: Even when max_iter == 0, it is not guaranteed that input(NLPSOL_X0) == output(NLPSOL_X). Indeed if bounds on X or constraints are unmet, they will differ.

For a good tutorial on IPOPT, see http://drops.dagstuhl.de/volltexte/2009/2089/pdf/09061.WaechterAndreas.Paper.2089.pdf

A good resource about the algorithms in IPOPT is: Wachter and L. T. Biegler, On the Implementation of an Interior-Point Filter Line-Search Algorithm for Large-Scale Nonlinear Programming, Mathematical Programming 106(1), pp. 25-57, 2006 (As Research Report RC 23149, IBM T. J. Watson Research Center, Yorktown, USA

Caveats:


List of available options
IdTypeDescription
clip_inactive_lamOT_BOOLExplicitly set Lagrange multipliers to 0 when bound is deemed inactive (default: false).
con_integer_mdOT_DICTInteger metadata (a dictionary with lists of integers) about constraints to be passed to IPOPT
con_numeric_mdOT_DICTNumeric metadata (a dictionary with lists of reals) about constraints to be passed to IPOPT
con_string_mdOT_DICTString metadata (a dictionary with lists of strings) about constraints to be passed to IPOPT
convexify_marginOT_DOUBLEWhen using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7).
convexify_strategyOT_STRINGNONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver.
grad_fOT_FUNCTIONFunction for calculating the gradient of the objective (column, autogenerated by default)
hess_lagOT_FUNCTIONFunction for calculating the Hessian of the Lagrangian (autogenerated by default)
inactive_lam_strategyOT_STRINGStrategy to detect if a bound is inactive. RELTOL: use solver-defined constraint tolerance * inactive_lam_value|abstol: use inactive_lam_value
inactive_lam_valueOT_DOUBLEValue used in inactive_lam_strategy (default: 10).
ipoptOT_DICTOptions to be passed to IPOPT
jac_gOT_FUNCTIONFunction for calculating the Jacobian of the constraints (autogenerated by default)
max_iter_eigOT_DOUBLEMaximum number of iterations to compute an eigenvalue decomposition (default: 50).
pass_nonlinear_variablesOT_BOOLPass list of variables entering nonlinearly to IPOPT
var_integer_mdOT_DICTInteger metadata (a dictionary with lists of integers) about variables to be passed to IPOPT
var_numeric_mdOT_DICTNumeric metadata (a dictionary with lists of reals) about variables to be passed to IPOPT
var_string_mdOT_DICTString metadata (a dictionary with lists of strings) about variables to be passed to IPOPT

knitro

KNITRO interface

Extra doc: https://github.com/casadi/casadi/wiki/L_22c


List of available options
IdTypeDescription
complem_variablesOT_INTVECTORVECTORList of complementary constraints on simple bounds. Pair (i, j) encodes complementarity between the bounds on variable i and variable j.
contypeOT_INTVECTORType of constraint
detect_linear_constraintsOT_BOOLDetect type of constraints
knitroOT_DICTOptions to be passed to KNITRO
options_fileOT_STRINGRead options from file (solver specific)

madnlp


List of available options
IdTypeDescription
convexify_marginOT_DOUBLEWhen using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7).
convexify_strategyOT_STRINGNONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver.
madnlpOT_DICTOptions to be passed to madnlp
ngOT_INTVECTORNumber of constraints
nwOT_INTVECTORNumber of variables

snopt

SNOPT interface

Extra doc: https://github.com/casadi/casadi/wiki/L_22m


List of available options
IdTypeDescription
snoptOT_DICTOptions to be passed to SNOPT
startOT_STRINGWarm-start options for Worhp: cold|warm|hot

worhp

WORHP interface

Designed for Worhp 1.12


List of available options
IdTypeDescription
worhpOT_DICTOptions to be passed to WORHP

feasiblesqpmethod

A textbook FeasibleSQPMethod

Extra doc: https://github.com/casadi/casadi/wiki/L_241


List of available options
IdTypeDescription
anderson_memoryOT_INTAnderson memory. If Anderson is used default is 1, else default is 0.
contraction_acceptance_valueOT_DOUBLEIf the empirical contraction rate in the feasibility iterations is above this value in the heuristics the iterations are aborted.
convexify_marginOT_DOUBLEWhen using a convexification strategy, make sure that the smallest eigenvalue4 is at least this (default: 1e-7).
convexify_strategyOT_STRINGNONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver.
fOT_FUNCTIONFunction for calculating the objective function (autogenerated by default)
feas_tolOT_DOUBLEFeasibility tolerance. Below this tolerance an iterate is considered to be feasible.
gOT_FUNCTIONFunction for calculating the constraints (autogenerated by default)
grad_fOT_FUNCTIONFunction for calculating the gradient of the objective (autogenerated by default)
hess_lagOT_FUNCTIONFunction for calculating the Hessian of the Lagrangian (autogenerated by default)
hessian_approximationOT_STRINGlimited-memory|exact
init_feasibleOT_BOOLInitialize the QP subproblems with a feasible initial value (default: false).
jac_gOT_FUNCTIONFunction for calculating the Jacobian of the constraints (autogenerated by default)
lbfgs_memoryOT_INTSize of L-BFGS memory.
max_inner_iterOT_DOUBLEMaximum number of inner iterations.
max_iterOT_INTMaximum number of SQP iterations
max_iter_eigOT_DOUBLEMaximum number of iterations to compute an eigenvalue decomposition (default: 50).
merit_memoryOT_INTSize of memory to store history of merit function values
min_iterOT_INTMinimum number of SQP iterations
optim_tolOT_DOUBLEOptimality tolerance. Below this value an iterate is considered to be optimal.
print_headerOT_BOOLPrint the header with problem statistics
print_iterationOT_BOOLPrint the iterations
print_statusOT_BOOLPrint a status message after solving
qpsolOT_STRINGThe QP solver to be used by the SQP method [qpoases]
qpsol_optionsOT_DICTOptions to be passed to the QP solver
solve_typeOT_STRINGThe solver type: Either SQP or SLP. Defaults to SQP
tol_duOT_DOUBLEStopping criterion for dual infeasability
tol_prOT_DOUBLEStopping criterion for primal infeasibility
tr_acceptanceOT_DOUBLEIs the trust-region ratio above this value, the step is accepted.
tr_alpha1OT_DOUBLELower alpha in trust-region size criterion.
tr_alpha2OT_DOUBLEUpper alpha in trust-region size criterion.
tr_eta1OT_DOUBLELower eta in trust-region acceptance criterion.
tr_eta2OT_DOUBLEUpper eta in trust-region acceptance criterion.
tr_rad0OT_DOUBLEInitial trust-region radius.
tr_rad_maxOT_DOUBLEMaximum trust-region radius.
tr_rad_minOT_DOUBLEMinimum trust-region radius.
tr_scale_vectorOT_DOUBLEVECTORVector that tells where trust-region is applied.
tr_tolOT_DOUBLETrust-region tolerance. Below this value another scalar is equal to the trust region radius.
use_andersonOT_BOOLUse Anderson Acceleration. (default false)
watchdogOT_INTNumber of watchdog iterations in feasibility iterations. After this amount of iterations, it is checked with the contraction acceptance value, if iterations are converging.

qrsqp

A textbook SQPMethod

Extra doc: https://github.com/casadi/casadi/wiki/L_22u


scpgen

A structure-exploiting sequential quadratic programming (to be come sequential convex programming) method for nonlinear programming.

Extra doc: https://github.com/casadi/casadi/wiki/L_232


List of available options
IdTypeDescription
betaOT_DOUBLELine-search parameter, restoration factor of stepsize
c1OT_DOUBLEArmijo condition, coefficient of decrease in merit
codegenOT_BOOLC-code generation
hessian_approximationOT_STRINGgauss-newton|exact
lbfgs_memoryOT_INTSize of L-BFGS memory.
max_iterOT_INTMaximum number of SQP iterations
max_iter_lsOT_INTMaximum number of linesearch iterations
merit_memsizeOT_INTSize of memory to store history of merit function values
merit_startOT_DOUBLELower bound for the merit function parameter
name_xOT_STRINGVECTORNames of the variables.
print_headerOT_BOOLPrint the header with problem statistics
print_xOT_INTVECTORWhich variables to print.
qpsolOT_STRINGThe QP solver to be used by the SQP method
qpsol_optionsOT_DICTOptions to be passed to the QP solver
reg_thresholdOT_DOUBLEThreshold for the regularization.
regularizeOT_BOOLAutomatic regularization of Lagrange Hessian.
tol_duOT_DOUBLEStopping criterion for dual infeasability
tol_prOT_DOUBLEStopping criterion for primal infeasibility
tol_pr_stepOT_DOUBLEStopping criterion for the step size
tol_regOT_DOUBLEStopping criterion for regularization

sqpmethod

A textbook SQPMethod

Extra doc: https://github.com/casadi/casadi/wiki/L_22x


List of available options
IdTypeDescription
betaOT_DOUBLELine-search parameter, restoration factor of stepsize
c1OT_DOUBLEArmijo condition, coefficient of decrease in merit
convexify_marginOT_DOUBLEWhen using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7).
convexify_strategyOT_STRINGNONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver.
elastic_modeOT_BOOLEnable the elastic mode which is used when the QP is infeasible (default: false).
gamma_0OT_DOUBLEStarting value for the penalty parameter of elastic mode (default: 1).
gamma_1_minOT_DOUBLEMinimum value for gamma_1 (default: 1e-5).
gamma_maxOT_DOUBLEMaximum value for the penalty parameter of elastic mode (default: 1e20).
hess_lagOT_FUNCTIONFunction for calculating the Hessian of the Lagrangian (autogenerated by default)
hessian_approximationOT_STRINGlimited-memory|exact
init_feasibleOT_BOOLInitialize the QP subproblems with a feasible initial value (default: false).
jac_fgOT_FUNCTIONFunction for calculating the gradient of the objective and Jacobian of the constraints (autogenerated by default)
lbfgs_memoryOT_INTSize of L-BFGS memory.
max_iterOT_INTMaximum number of SQP iterations
max_iter_eigOT_DOUBLEMaximum number of iterations to compute an eigenvalue decomposition (default: 50).
max_iter_lsOT_INTMaximum number of linesearch iterations
merit_memoryOT_INTSize of memory to store history of merit function values
min_iterOT_INTMinimum number of SQP iterations
min_step_sizeOT_DOUBLEThe size (inf-norm) of the step size should not become smaller than this.
print_headerOT_BOOLPrint the header with problem statistics
print_iterationOT_BOOLPrint the iterations
print_statusOT_BOOLPrint a status message after solving
qpsolOT_STRINGThe QP solver to be used by the SQP method [qpoases]
qpsol_optionsOT_DICTOptions to be passed to the QP solver
second_order_correctionsOT_BOOLEnable second order corrections. These are used when a step is considered bad by the merit function and constraint norm (default: false).
tol_duOT_DOUBLEStopping criterion for dual infeasability
tol_prOT_DOUBLEStopping criterion for primal infeasibility
Author
Joel Andersson
Date
2011-2015

Extra doc: https://github.com/casadi/casadi/wiki/L_21q

Function Documentation

◆ doc_nlpsol()

CASADI_EXPORT std::string casadi::doc_nlpsol ( const std::string &  name)

◆ has_nlpsol()

CASADI_EXPORT bool casadi::has_nlpsol ( const std::string &  name)

◆ load_nlpsol()

CASADI_EXPORT void casadi::load_nlpsol ( const std::string &  name)

◆ nlpsol() [1/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const Function nlp,
const Dict opts = Dict() 
)

◆ nlpsol() [2/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const Importer compiler,
const Dict opts = Dict() 
)

◆ nlpsol() [3/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const MXDict nlp,
const Dict opts = Dict() 
)

◆ nlpsol() [4/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const NlpBuilder nl,
const Dict opts = Dict() 
)

◆ nlpsol() [5/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const std::string &  fname,
const Dict opts = Dict() 
)

◆ nlpsol() [6/6]

CASADI_EXPORT Function casadi::nlpsol ( const std::string &  name,
const std::string &  solver,
const SXDict nlp,
const Dict opts = Dict() 
)

◆ nlpsol_default_in() [1/2]

CASADI_EXPORT std::vector<double> casadi::nlpsol_default_in ( )

◆ nlpsol_default_in() [2/2]

CASADI_EXPORT double casadi::nlpsol_default_in ( casadi_int  ind)

◆ nlpsol_in() [1/2]

CASADI_EXPORT std::vector<std::string> casadi::nlpsol_in ( )

◆ nlpsol_in() [2/2]

CASADI_EXPORT std::string casadi::nlpsol_in ( casadi_int  ind)

◆ nlpsol_n_in()

CASADI_EXPORT casadi_int casadi::nlpsol_n_in ( )

◆ nlpsol_n_out()

CASADI_EXPORT casadi_int casadi::nlpsol_n_out ( )

◆ nlpsol_option_info()

CASADI_EXPORT std::string casadi::nlpsol_option_info ( const std::string &  name,
const std::string &  op 
)

◆ nlpsol_option_type()

CASADI_EXPORT std::string casadi::nlpsol_option_type ( const std::string &  name,
const std::string &  op 
)

◆ nlpsol_options()

CASADI_EXPORT std::vector<std::string> casadi::nlpsol_options ( const std::string &  name)

◆ nlpsol_out() [1/2]

CASADI_EXPORT std::vector<std::string> casadi::nlpsol_out ( )

◆ nlpsol_out() [2/2]

CASADI_EXPORT std::string casadi::nlpsol_out ( casadi_int  ind)