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... | |
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
Id | Type | Description | Used in |
---|---|---|---|
ad_weight | OT_DOUBLE | Weighting 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_sp | OT_DOUBLE | Weighting 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_inline | OT_BOOL | Force inlining. | casadi::FunctionInternal |
bound_consistency | OT_BOOL | Ensure that primal-dual solution is consistent with the bounds | casadi::Nlpsol |
cache | OT_DICT | Prepopulate the function cache. Default: empty | casadi::FunctionInternal |
calc_f | OT_BOOL | Calculate 'f' in the Nlpsol base class | casadi::Nlpsol |
calc_g | OT_BOOL | Calculate 'g' in the Nlpsol base class | casadi::Nlpsol |
calc_lam_p | OT_BOOL | Calculate 'lam_p' in the Nlpsol base class | casadi::Nlpsol |
calc_lam_x | OT_BOOL | Calculate 'lam_x' in the Nlpsol base class | casadi::Nlpsol |
calc_multipliers | OT_BOOL | Calculate Lagrange multipliers in the Nlpsol base class | casadi::Nlpsol |
common_options | OT_DICT | Options for auto-generated functions | casadi::OracleFunction |
compiler | OT_STRING | Just-in-time compiler plugin to be used. | casadi::FunctionInternal |
custom_jacobian | OT_FUNCTION | Override CasADi's AD. Use together with 'jac_penalty': 0. Note: Highly experimental. Syntax may break often. | casadi::FunctionInternal |
der_options | OT_DICT | Default options to be used to populate forward_options, reverse_options, and jacobian_options before those options are merged in. | casadi::FunctionInternal |
derivative_of | OT_FUNCTION | The function is a derivative of another function. The type of derivative (directional derivative, Jacobian) is inferred from the function name. | casadi::FunctionInternal |
detect_simple_bounds | OT_BOOL | Automatically 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_simple | OT_BOOLVECTOR | For internal use only. | casadi::Nlpsol |
detect_simple_bounds_parts | OT_FUNCTION | For internal use only. | casadi::Nlpsol |
detect_simple_bounds_target_x | OT_INTVECTOR | For internal use only. | casadi::Nlpsol |
discrete | OT_BOOLVECTOR | Indicates which of the variables are discrete, i.e. integer-valued | casadi::Nlpsol |
dump | OT_BOOL | Dump function to file upon first evaluation. [false] | casadi::FunctionInternal |
dump_dir | OT_STRING | Directory to dump inputs/outputs to. Make sure the directory exists [.] | casadi::FunctionInternal |
dump_format | OT_STRING | Choose file format to dump matrices. See DM.from_file [mtx] | casadi::FunctionInternal |
dump_in | OT_BOOL | Dump numerical values of inputs to file (readable with DM.from_file) [default: false] | casadi::FunctionInternal |
dump_out | OT_BOOL | Dump numerical values of outputs to file (readable with DM.from_file) [default: false] | casadi::FunctionInternal |
enable_fd | OT_BOOL | Enable derivative calculation by finite differencing. [default: false]] | casadi::FunctionInternal |
enable_forward | OT_BOOL | Enable derivative calculation using generated functions for Jacobian-times-vector products - typically using forward mode AD - if available. [default: true] | casadi::FunctionInternal |
enable_jacobian | OT_BOOL | Enable derivative calculation using generated functions for Jacobians of all differentiable outputs with respect to all differentiable inputs - if available. [default: true] | casadi::FunctionInternal |
enable_reverse | OT_BOOL | Enable derivative calculation using generated functions for transposed Jacobian-times-vector products - typically using reverse mode AD - if available. [default: true] | casadi::FunctionInternal |
equality | OT_BOOLVECTOR | Indicate 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_fail | OT_BOOL | Throw exceptions when function evaluation fails (default true). | casadi::ProtoFunction |
eval_errors_fatal | OT_BOOL | When errors occur during evaluation of f,g,...,stop the iterations | casadi::Nlpsol |
expand | OT_BOOL | Replace MX with SX expressions in problem formulation [false] | casadi::OracleFunction |
external_transform | OT_VECTORVECTOR | List of external_transform instruction arguments. Default: empty | casadi::FunctionInternal |
fd_method | OT_STRING | Method for finite differencing [default 'central'] | casadi::FunctionInternal |
fd_options | OT_DICT | Options to be passed to the finite difference instance | casadi::FunctionInternal |
forward_options | OT_DICT | Options to be passed to a forward mode constructor | casadi::FunctionInternal |
gather_stats | OT_BOOL | Deprecated option (ignored): Statistics are now always collected. | casadi::FunctionInternal |
ignore_check_vec | OT_BOOL | If set to true, the input shape of F will not be checked. | casadi::Nlpsol |
input_scheme | OT_STRINGVECTOR | Deprecated option (ignored) | casadi::FunctionInternal |
inputs_check | OT_BOOL | Throw exceptions when the numerical values of the inputs don't make sense | casadi::FunctionInternal |
is_diff_in | OT_BOOLVECTOR | Indicate for each input if it should be differentiable. | casadi::FunctionInternal |
is_diff_out | OT_BOOLVECTOR | Indicate for each output if it should be differentiable. | casadi::FunctionInternal |
iteration_callback | OT_FUNCTION | A function that will be called at each iteration with the solver as input. Check documentation of Callback. | casadi::Nlpsol |
iteration_callback_ignore_errors | OT_BOOL | If set to true, errors thrown by iteration_callback will be ignored. | casadi::Nlpsol |
iteration_callback_step | OT_INT | Only call the callback function every few iterations. | casadi::Nlpsol |
jac_penalty | OT_DOUBLE | When 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 strategy | casadi::FunctionInternal |
jacobian_options | OT_DICT | Options to be passed to a Jacobian constructor | casadi::FunctionInternal |
jit | OT_BOOL | Use just-in-time compiler to speed up the evaluation | casadi::FunctionInternal |
jit_cleanup | OT_BOOL | Cleanup up the temporary source file that jit creates. Default: true | casadi::FunctionInternal |
jit_name | OT_STRING | The 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_options | OT_DICT | Options to be passed to the jit compiler. | casadi::FunctionInternal |
jit_serialize | OT_STRING | Specify behaviour when serializing a jitted function: SOURCE|link|embed. | casadi::FunctionInternal |
jit_temp_suffix | OT_BOOL | Use 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: true | casadi::FunctionInternal |
max_io | OT_INT | Acceptable number of inputs and outputs. Warn if exceeded. | casadi::FunctionInternal |
max_num_dir | OT_INT | Specify the maximum number of directions for derivative functions. Overrules the builtin optimized_num_dir. | casadi::FunctionInternal |
min_lam | OT_DOUBLE | Minimum allowed multiplier value | casadi::Nlpsol |
monitor | OT_STRINGVECTOR | Set of user problem functions to be monitored | casadi::OracleFunction |
never_inline | OT_BOOL | Forbid inlining. | casadi::FunctionInternal |
no_nlp_grad | OT_BOOL | Prevent the creation of the 'nlp_grad' function | casadi::Nlpsol |
oracle_options | OT_DICT | Options to be passed to the oracle function | casadi::Nlpsol |
output_scheme | OT_STRINGVECTOR | Deprecated option (ignored) | casadi::FunctionInternal |
post_expand | OT_BOOL | After construction, expand this Function. Default: False | casadi::FunctionInternal |
post_expand_options | OT_DICT | Options to be passed to post-construction expansion. Default: empty | casadi::FunctionInternal |
print_in | OT_BOOL | Print numerical values of inputs [default: false] | casadi::FunctionInternal |
print_out | OT_BOOL | Print numerical values of outputs [default: false] | casadi::FunctionInternal |
print_time | OT_BOOL | print information about execution time. Implies record_time. | casadi::ProtoFunction |
record_time | OT_BOOL | record information about execution time, for retrieval with stats(). | casadi::ProtoFunction |
regularity_check | OT_BOOL | Throw exceptions when NaN or Inf appears during evaluation | casadi::ProtoFunction |
reverse_options | OT_DICT | Options to be passed to a reverse mode constructor | casadi::FunctionInternal |
sens_linsol | OT_STRING | Linear solver used for parametric sensitivities (default 'qr'). | casadi::Nlpsol |
sens_linsol_options | OT_DICT | Linear solver options used for parametric sensitivities. | casadi::Nlpsol |
show_eval_warnings | OT_BOOL | Show warnings generated from function evaluations [true] | casadi::OracleFunction |
specific_options | OT_DICT | Options for specific auto-generated functions, overwriting the defaults from common_options. Nested dictionary. | casadi::OracleFunction |
user_data | OT_VOIDPTR | A user-defined field that can be used to identify the function or pass additional information | casadi::FunctionInternal |
verbose | OT_BOOL | Verbose evaluation – for debugging | casadi::ProtoFunction |
verbose_init | OT_BOOL | Print out timing information about the different stages of initialization | casadi::Nlpsol |
warn_initial_bounds | OT_BOOL | Warn if the initial guess does not satisfy LBX and UBX | casadi::Nlpsol |
Full name | Short | Description |
---|---|---|
NLPSOL_X0 | x0 | Decision variables, initial guess (nx x 1) |
NLPSOL_P | p | Value of fixed parameters (np x 1) |
NLPSOL_LBX | lbx | Decision variables lower bound (nx x 1), default -inf. |
NLPSOL_UBX | ubx | Decision variables upper bound (nx x 1), default +inf. |
NLPSOL_LBG | lbg | Constraints lower bound (ng x 1), default -inf. |
NLPSOL_UBG | ubg | Constraints upper bound (ng x 1), default +inf. |
NLPSOL_LAM_X0 | lam_x0 | Lagrange multipliers for bounds on X, initial guess (nx x 1) |
NLPSOL_LAM_G0 | lam_g0 | Lagrange multipliers for bounds on G, initial guess (ng x 1) |
Full name | Short | Description |
---|---|---|
NLPSOL_X | x | Decision variables at the optimal solution (nx x 1) |
NLPSOL_F | f | Cost function value at the optimal solution (1 x 1) |
NLPSOL_G | g | Constraints function at the optimal solution (ng x 1) |
NLPSOL_LAM_X | lam_x | Lagrange multipliers for bounds on X at the solution (nx x 1) |
NLPSOL_LAM_G | lam_g | Lagrange multipliers for bounds on G at the solution (ng x 1) |
NLPSOL_LAM_P | lam_p | Lagrange multipliers for bounds on P at the solution (np x 1) |
- blocksqp
- bonmin
- fatrop
- ipopt
- knitro
- madnlp
- snopt
- worhp
- qrsqp
- scpgen
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")
This is a modified version of blockSQP by Janka et al.
Extra doc: https://github.com/casadi/casadi/wiki/L_224
Id | Type | Description |
---|---|---|
block_hess | OT_INT | Blockwise Hessian approximation? |
col_eps | OT_DOUBLE | Epsilon for COL scaling strategy |
col_tau1 | OT_DOUBLE | tau1 for COL scaling strategy |
col_tau2 | OT_DOUBLE | tau2 for COL scaling strategy |
conv_strategy | OT_INT | Convexification strategy |
delta | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
delta_h0 | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
eps | OT_DOUBLE | Values smaller than this are regarded as numerically zero |
eta | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
fallback_scaling | OT_INT | If indefinite update is used, the type of fallback strategy |
fallback_update | OT_INT | If indefinite update is used, the type of fallback strategy |
gamma_f | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
gamma_theta | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
globalization | OT_BOOL | Enable globalization |
hess_damp | OT_INT | Activate Powell damping for BFGS |
hess_damp_fac | OT_DOUBLE | Damping factor for BFGS Powell modification |
hess_lim_mem | OT_INT | Full or limited memory |
hess_memsize | OT_INT | Memory size for L-BFGS updates |
hess_scaling | OT_INT | Scaling strategy for Hessian approximation |
hess_update | OT_INT | Type of Hessian approximation |
ini_hess_diag | OT_DOUBLE | Initial Hessian guess: diagonal matrix diag(iniHessDiag) |
kappa_f | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
kappa_minus | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
kappa_plus | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
kappa_plus_max | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
kappa_soc | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
linsol | OT_STRING | The linear solver to be used by the QP method |
max_consec_reduced_steps | OT_INT | Maximum number of consecutive reduced steps |
max_consec_skipped_updates | OT_INT | Maximum number of consecutive skipped updates |
max_conv_qp | OT_INT | How many additional QPs may be solved for convexification per iteration? |
max_it_qp | OT_INT | Maximum number of QP iterations per SQP iteration |
max_iter | OT_INT | Maximum number of SQP iterations |
max_line_search | OT_INT | Maximum number of steps in line search |
max_soc_iter | OT_INT | Maximum number of SOC line search iterations |
max_time_qp | OT_DOUBLE | Maximum number of time in seconds per QP solve per SQP iteration |
nlinfeastol | OT_DOUBLE | Nonlinear feasibility tolerance |
obj_lo | OT_DOUBLE | Lower bound on objective function [-inf] |
obj_up | OT_DOUBLE | Upper bound on objective function [inf] |
opttol | OT_DOUBLE | Optimality tolerance |
print_header | OT_BOOL | Print solver header at startup |
print_iteration | OT_BOOL | Print SQP iterations |
print_maxit_reached | OT_BOOL | Print error when maximum number of SQP iterations reached |
qp_init | OT_BOOL | Use warmstarting |
qpsol | OT_STRING | The QP solver to be used by the SQP method |
qpsol_options | OT_DICT | Options to be passed to the QP solver |
restore_feas | OT_BOOL | Use feasibility restoration phase |
rho | OT_DOUBLE | Feasibility restoration phase parameter |
s_f | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
s_theta | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
schur | OT_BOOL | Use qpOASES Schur compliment approach |
skip_first_globalization | OT_BOOL | No globalization strategy in first iteration |
theta_max | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
theta_min | OT_DOUBLE | Filter line search parameter, cf. IPOPT paper |
warmstart | OT_BOOL | Use warmstarting |
which_second_derv | OT_INT | For which block should second derivatives be provided by the user |
zeta | OT_DOUBLE | Feasibility restoration phase parameter |
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:
with default options, multipliers for the decision variables are wrong for equality constraints. Change the 'fixed_variable_treatment' to 'make_constraint' or 'relax_bounds' to obtain correct results.
Extra doc: https://github.com/casadi/casadi/wiki/L_223
Id | Type | Description |
---|---|---|
bonmin | OT_DICT | Options to be passed to BONMIN |
con_integer_md | OT_DICT | Integer metadata (a dictionary with lists of integers) about constraints to be passed to BONMIN |
con_numeric_md | OT_DICT | Numeric metadata (a dictionary with lists of reals) about constraints to be passed to BONMIN |
con_string_md | OT_DICT | String metadata (a dictionary with lists of strings) about constraints to be passed to BONMIN |
grad_f | OT_FUNCTION | Function for calculating the gradient of the objective (column, autogenerated by default) |
grad_f_options | OT_DICT | Options for the autogenerated gradient of the objective. |
hess_lag | OT_FUNCTION | Function for calculating the Hessian of the Lagrangian (autogenerated by default) |
hess_lag_options | OT_DICT | Options for the autogenerated Hessian of the Lagrangian. |
jac_g | OT_FUNCTION | Function for calculating the Jacobian of the constraints (autogenerated by default) |
jac_g_options | OT_DICT | Options for the autogenerated Jacobian of the constraints. |
pass_nonlinear_constraints | OT_BOOL | Pass list of constraints entering nonlinearly to BONMIN |
pass_nonlinear_variables | OT_BOOL | Pass list of variables entering nonlinearly to BONMIN |
sos1_groups | OT_INTVECTORVECTOR | Options for the autogenerated gradient of the objective. |
sos1_priorities | OT_INTVECTOR | Options for the autogenerated gradient of the objective. |
sos1_weights | OT_DOUBLEVECTORVECTOR | Options for the autogenerated gradient of the objective. |
var_integer_md | OT_DICT | Integer metadata (a dictionary with lists of integers) about variables to be passed to BONMIN |
var_numeric_md | OT_DICT | Numeric metadata (a dictionary with lists of reals) about variables to be passed to BONMIN |
var_string_md | OT_DICT | String metadata (a dictionary with lists of strings) about variables to be passed to BONMIN |
Id | Type | Description |
---|---|---|
N | OT_INT | OCP horizon |
convexify_margin | OT_DOUBLE | When using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7). |
convexify_strategy | OT_STRING | NONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver. |
debug | OT_BOOL | Produce debug information (default: false) |
fatrop | OT_DICT | Options to be passed to fatrop |
ng | OT_INTVECTOR | Number of non-dynamic constraints, length N+1 |
nu | OT_INTVECTOR | Number of controls, length N+1 |
nx | OT_INTVECTOR | Number of states, length N+1 |
structure_detection | OT_STRING | NONE | 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.
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:
with default options, multipliers for the decision variables are wrong for equality constraints. Change the 'fixed_variable_treatment' to 'make_constraint' or 'relax_bounds' to obtain correct results.
Extra doc: https://github.com/casadi/casadi/wiki/L_21y
Id | Type | Description |
---|---|---|
clip_inactive_lam | OT_BOOL | Explicitly set Lagrange multipliers to 0 when bound is deemed inactive (default: false). |
con_integer_md | OT_DICT | Integer metadata (a dictionary with lists of integers) about constraints to be passed to IPOPT |
con_numeric_md | OT_DICT | Numeric metadata (a dictionary with lists of reals) about constraints to be passed to IPOPT |
con_string_md | OT_DICT | String metadata (a dictionary with lists of strings) about constraints to be passed to IPOPT |
convexify_margin | OT_DOUBLE | When using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7). |
convexify_strategy | OT_STRING | NONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver. |
grad_f | OT_FUNCTION | Function for calculating the gradient of the objective (column, autogenerated by default) |
hess_lag | OT_FUNCTION | Function for calculating the Hessian of the Lagrangian (autogenerated by default) |
inactive_lam_strategy | OT_STRING | Strategy to detect if a bound is inactive. RELTOL: use solver-defined constraint tolerance * inactive_lam_value|abstol: use inactive_lam_value |
inactive_lam_value | OT_DOUBLE | Value used in inactive_lam_strategy (default: 10). |
ipopt | OT_DICT | Options to be passed to IPOPT |
jac_g | OT_FUNCTION | Function for calculating the Jacobian of the constraints (autogenerated by default) |
max_iter_eig | OT_DOUBLE | Maximum number of iterations to compute an eigenvalue decomposition (default: 50). |
pass_nonlinear_variables | OT_BOOL | Pass list of variables entering nonlinearly to IPOPT |
var_integer_md | OT_DICT | Integer metadata (a dictionary with lists of integers) about variables to be passed to IPOPT |
var_numeric_md | OT_DICT | Numeric metadata (a dictionary with lists of reals) about variables to be passed to IPOPT |
var_string_md | OT_DICT | String metadata (a dictionary with lists of strings) about variables to be passed to IPOPT |
KNITRO interface
Extra doc: https://github.com/casadi/casadi/wiki/L_22c
Id | Type | Description |
---|---|---|
complem_variables | OT_INTVECTORVECTOR | List of complementary constraints on simple bounds. Pair (i, j) encodes complementarity between the bounds on variable i and variable j. |
contype | OT_INTVECTOR | Type of constraint |
detect_linear_constraints | OT_BOOL | Detect type of constraints |
knitro | OT_DICT | Options to be passed to KNITRO |
options_file | OT_STRING | Read options from file (solver specific) |
Id | Type | Description |
---|---|---|
convexify_margin | OT_DOUBLE | When using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7). |
convexify_strategy | OT_STRING | NONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver. |
madnlp | OT_DICT | Options to be passed to madnlp |
ng | OT_INTVECTOR | Number of constraints |
nw | OT_INTVECTOR | Number of variables |
SNOPT interface
Extra doc: https://github.com/casadi/casadi/wiki/L_22m
Id | Type | Description |
---|---|---|
snopt | OT_DICT | Options to be passed to SNOPT |
start | OT_STRING | Warm-start options for Worhp: cold|warm|hot |
WORHP interface
Designed for Worhp 1.12
Extra doc: https://github.com/casadi/casadi/wiki/L_241
Id | Type | Description |
---|---|---|
anderson_memory | OT_INT | Anderson memory. If Anderson is used default is 1, else default is 0. |
contraction_acceptance_value | OT_DOUBLE | If the empirical contraction rate in the feasibility iterations is above this value in the heuristics the iterations are aborted. |
convexify_margin | OT_DOUBLE | When using a convexification strategy, make sure that the smallest eigenvalue4 is at least this (default: 1e-7). |
convexify_strategy | OT_STRING | NONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver. |
f | OT_FUNCTION | Function for calculating the objective function (autogenerated by default) |
feas_tol | OT_DOUBLE | Feasibility tolerance. Below this tolerance an iterate is considered to be feasible. |
g | OT_FUNCTION | Function for calculating the constraints (autogenerated by default) |
grad_f | OT_FUNCTION | Function for calculating the gradient of the objective (autogenerated by default) |
hess_lag | OT_FUNCTION | Function for calculating the Hessian of the Lagrangian (autogenerated by default) |
hessian_approximation | OT_STRING | limited-memory|exact |
init_feasible | OT_BOOL | Initialize the QP subproblems with a feasible initial value (default: false). |
jac_g | OT_FUNCTION | Function for calculating the Jacobian of the constraints (autogenerated by default) |
lbfgs_memory | OT_INT | Size of L-BFGS memory. |
max_inner_iter | OT_DOUBLE | Maximum number of inner iterations. |
max_iter | OT_INT | Maximum number of SQP iterations |
max_iter_eig | OT_DOUBLE | Maximum number of iterations to compute an eigenvalue decomposition (default: 50). |
merit_memory | OT_INT | Size of memory to store history of merit function values |
min_iter | OT_INT | Minimum number of SQP iterations |
optim_tol | OT_DOUBLE | Optimality tolerance. Below this value an iterate is considered to be optimal. |
print_header | OT_BOOL | Print the header with problem statistics |
print_iteration | OT_BOOL | Print the iterations |
print_status | OT_BOOL | Print a status message after solving |
qpsol | OT_STRING | The QP solver to be used by the SQP method [qpoases] |
qpsol_options | OT_DICT | Options to be passed to the QP solver |
solve_type | OT_STRING | The solver type: Either SQP or SLP. Defaults to SQP |
tol_du | OT_DOUBLE | Stopping criterion for dual infeasability |
tol_pr | OT_DOUBLE | Stopping criterion for primal infeasibility |
tr_acceptance | OT_DOUBLE | Is the trust-region ratio above this value, the step is accepted. |
tr_alpha1 | OT_DOUBLE | Lower alpha in trust-region size criterion. |
tr_alpha2 | OT_DOUBLE | Upper alpha in trust-region size criterion. |
tr_eta1 | OT_DOUBLE | Lower eta in trust-region acceptance criterion. |
tr_eta2 | OT_DOUBLE | Upper eta in trust-region acceptance criterion. |
tr_rad0 | OT_DOUBLE | Initial trust-region radius. |
tr_rad_max | OT_DOUBLE | Maximum trust-region radius. |
tr_rad_min | OT_DOUBLE | Minimum trust-region radius. |
tr_scale_vector | OT_DOUBLEVECTOR | Vector that tells where trust-region is applied. |
tr_tol | OT_DOUBLE | Trust-region tolerance. Below this value another scalar is equal to the trust region radius. |
use_anderson | OT_BOOL | Use Anderson Acceleration. (default false) |
watchdog | OT_INT | Number of watchdog iterations in feasibility iterations. After this amount of iterations, it is checked with the contraction acceptance value, if iterations are converging. |
A textbook SQPMethod
Extra doc: https://github.com/casadi/casadi/wiki/L_22u
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
Id | Type | Description |
---|---|---|
beta | OT_DOUBLE | Line-search parameter, restoration factor of stepsize |
c1 | OT_DOUBLE | Armijo condition, coefficient of decrease in merit |
codegen | OT_BOOL | C-code generation |
hessian_approximation | OT_STRING | gauss-newton|exact |
lbfgs_memory | OT_INT | Size of L-BFGS memory. |
max_iter | OT_INT | Maximum number of SQP iterations |
max_iter_ls | OT_INT | Maximum number of linesearch iterations |
merit_memsize | OT_INT | Size of memory to store history of merit function values |
merit_start | OT_DOUBLE | Lower bound for the merit function parameter |
name_x | OT_STRINGVECTOR | Names of the variables. |
print_header | OT_BOOL | Print the header with problem statistics |
print_x | OT_INTVECTOR | Which variables to print. |
qpsol | OT_STRING | The QP solver to be used by the SQP method |
qpsol_options | OT_DICT | Options to be passed to the QP solver |
reg_threshold | OT_DOUBLE | Threshold for the regularization. |
regularize | OT_BOOL | Automatic regularization of Lagrange Hessian. |
tol_du | OT_DOUBLE | Stopping criterion for dual infeasability |
tol_pr | OT_DOUBLE | Stopping criterion for primal infeasibility |
tol_pr_step | OT_DOUBLE | Stopping criterion for the step size |
tol_reg | OT_DOUBLE | Stopping criterion for regularization |
A textbook SQPMethod
Extra doc: https://github.com/casadi/casadi/wiki/L_22x
Id | Type | Description |
---|---|---|
beta | OT_DOUBLE | Line-search parameter, restoration factor of stepsize |
c1 | OT_DOUBLE | Armijo condition, coefficient of decrease in merit |
convexify_margin | OT_DOUBLE | When using a convexification strategy, make sure that the smallest eigenvalue is at least this (default: 1e-7). |
convexify_strategy | OT_STRING | NONE|regularize|eigen-reflect|eigen-clip. Strategy to convexify the Lagrange Hessian before passing it to the solver. |
elastic_mode | OT_BOOL | Enable the elastic mode which is used when the QP is infeasible (default: false). |
gamma_0 | OT_DOUBLE | Starting value for the penalty parameter of elastic mode (default: 1). |
gamma_1_min | OT_DOUBLE | Minimum value for gamma_1 (default: 1e-5). |
gamma_max | OT_DOUBLE | Maximum value for the penalty parameter of elastic mode (default: 1e20). |
hess_lag | OT_FUNCTION | Function for calculating the Hessian of the Lagrangian (autogenerated by default) |
hessian_approximation | OT_STRING | limited-memory|exact |
init_feasible | OT_BOOL | Initialize the QP subproblems with a feasible initial value (default: false). |
jac_fg | OT_FUNCTION | Function for calculating the gradient of the objective and Jacobian of the constraints (autogenerated by default) |
lbfgs_memory | OT_INT | Size of L-BFGS memory. |
max_iter | OT_INT | Maximum number of SQP iterations |
max_iter_eig | OT_DOUBLE | Maximum number of iterations to compute an eigenvalue decomposition (default: 50). |
max_iter_ls | OT_INT | Maximum number of linesearch iterations |
merit_memory | OT_INT | Size of memory to store history of merit function values |
min_iter | OT_INT | Minimum number of SQP iterations |
min_step_size | OT_DOUBLE | The size (inf-norm) of the step size should not become smaller than this. |
print_header | OT_BOOL | Print the header with problem statistics |
print_iteration | OT_BOOL | Print the iterations |
print_status | OT_BOOL | Print a status message after solving |
qpsol | OT_STRING | The QP solver to be used by the SQP method [qpoases] |
qpsol_options | OT_DICT | Options to be passed to the QP solver |
second_order_corrections | OT_BOOL | Enable second order corrections. These are used when a step is considered bad by the merit function and constraint norm (default: false). |
tol_du | OT_DOUBLE | Stopping criterion for dual infeasability |
tol_pr | OT_DOUBLE | Stopping criterion for primal infeasibility |
Extra doc: https://github.com/casadi/casadi/wiki/L_21q
CASADI_EXPORT std::string casadi::doc_nlpsol | ( | const std::string & | name | ) |
CASADI_EXPORT bool casadi::has_nlpsol | ( | const std::string & | name | ) |
CASADI_EXPORT void casadi::load_nlpsol | ( | const std::string & | name | ) |
CASADI_EXPORT Function casadi::nlpsol | ( | const std::string & | name, |
const std::string & | solver, | ||
const Function & | nlp, | ||
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 MXDict & | nlp, | ||
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 std::string & | fname, | ||
const Dict & | opts = Dict() |
||
) |
CASADI_EXPORT Function casadi::nlpsol | ( | const std::string & | name, |
const std::string & | solver, | ||
const SXDict & | nlp, | ||
const Dict & | opts = Dict() |
||
) |
CASADI_EXPORT std::vector<double> casadi::nlpsol_default_in | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t4
CASADI_EXPORT double casadi::nlpsol_default_in | ( | casadi_int | ind | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t4
CASADI_EXPORT std::vector<std::string> casadi::nlpsol_in | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1sy
CASADI_EXPORT std::string casadi::nlpsol_in | ( | casadi_int | ind | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t0
CASADI_EXPORT casadi_int casadi::nlpsol_n_in | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t2
CASADI_EXPORT casadi_int casadi::nlpsol_n_out | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t3
CASADI_EXPORT std::string casadi::nlpsol_option_info | ( | const std::string & | name, |
const std::string & | op | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t7
CASADI_EXPORT std::string casadi::nlpsol_option_type | ( | const std::string & | name, |
const std::string & | op | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t6
CASADI_EXPORT std::vector<std::string> casadi::nlpsol_options | ( | const std::string & | name | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t5
CASADI_EXPORT std::vector<std::string> casadi::nlpsol_out | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1sz
CASADI_EXPORT std::string casadi::nlpsol_out | ( | casadi_int | ind | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1t1