Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTM] Not compute the defects if not in implicit #742

Merged
merged 19 commits into from
Aug 11, 2023

Conversation

EveCharbie
Copy link
Collaborator

@EveCharbie EveCharbie commented Aug 5, 2023

All Submissions:

  • Have you followed the guidelines in our Contributing document [docs/contribution.md]?
  • Have you checked to ensure there aren't other open [Pull Requests] for the same update/change?
  • Have you opened/linked the issue related to your pull request?
  • Have you used the tag [WIP] for on-going changes, and removed it when the pull request was ready?
  • When ready to merge, have you sent a comment pinging @pariterre in it?

New Feature Submissions:

  1. Does your submission pass the tests (if not please explain why this is intended)?
  2. Did you write a proper documentation (docstrings and ReadMe)
  3. Have you linted your code locally prior to submission (using the command: black . -l120 --exclude "external/*")?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new examples for your core changes, as applicable?
  • Have you written new tests for your core changes, as applicable?

This change is Reviewable

@EveCharbie
Copy link
Collaborator Author

Hoping this would decrease the RAM consumption when we are in explicit.
WARNING: there seems to be some tests missing for joint_acceleration_driven and implicit dynamics (issue #741) , so I don't know for sure if I did not break anything...

@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Patch coverage: 78.78% and project coverage change: -0.04% ⚠️

Comparison is base (31da5ab) 81.63% compared to head (ecf5c67) 81.59%.
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #742      +/-   ##
==========================================
- Coverage   81.63%   81.59%   -0.04%     
==========================================
  Files         130      130              
  Lines       16050    16054       +4     
==========================================
- Hits        13103    13100       -3     
- Misses       2947     2954       +7     
Flag Coverage Δ
unittests 81.59% <78.78%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
bioptim/dynamics/dynamics_functions.py 92.36% <76.66%> (-2.36%) ⬇️
bioptim/dynamics/ode_solver.py 88.66% <100.00%> (+0.07%) ⬆️
bioptim/examples/muscle_driven_ocp/static_arm.py 87.09% <100.00%> (ø)
bioptim/optimization/optimal_control_program.py 85.30% <100.00%> (-0.02%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EveCharbie EveCharbie changed the title Not compute the defects if not in implicit [RTR] Not compute the defects if not in implicit Aug 6, 2023
@EveCharbie
Copy link
Collaborator Author

@pariterre this one would also be a good candidate to being merge, it will not create merge conflicts I think :)

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change back to ODE default

Reviewed 4 of 4 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @EveCharbie)


bioptim/dynamics/dynamics_functions.py line 151 at r2 (raw file):

        defects = None
        # TODO: contacts and fatigue to be handled with implicit dynamics
        if rigidbody_dynamics is not None:

if rigid != RIGID.ODE:

@pariterre pariterre changed the title [RTR] Not compute the defects if not in implicit [RTM when ODE] Not compute the defects if not in implicit Aug 7, 2023
@EveCharbie
Copy link
Collaborator Author

@pariterre I don't think RigidBodyDynamics.ODE has the same meaning as None, I think it means compute defects = [qdot_from_states_dot - qdot, tau_from_inverse_dynamics - tau]
It should be computed in test_muscle_driven_ocp_implicit.py.

Should I instead create another enum : RigidBodyDynamics.NO_DEFECTS ?

@EveCharbie EveCharbie changed the title [RTM when ODE] Not compute the defects if not in implicit [RTM when question is answered] Not compute the defects if not in implicit Aug 8, 2023
pariterre
pariterre previously approved these changes Aug 10, 2023
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)

@pariterre pariterre changed the title [RTM when question is answered] Not compute the defects if not in implicit [RTM when tests are fixed] Not compute the defects if not in implicit Aug 10, 2023
@EveCharbie
Copy link
Collaborator Author

Test does not pass on Windows, I will remove it. But here is the Error message for the future:

================================== FAILURES ===================================
____________ test_arm_reaching_torque_driven_implicit[False-False] ____________

with_cholesky = False, with_scaling = False

@pytest.mark.parametrize("with_cholesky", [True, False])
@pytest.mark.parametrize("with_scaling", [True, False])
def test_arm_reaching_torque_driven_implicit(with_cholesky, with_scaling):
    from bioptim.examples.stochastic_optimal_control import arm_reaching_torque_driven_implicit as ocp_module

    final_time = 0.8
    n_shooting = 4
    ee_final_position = np.array([9.359873986980460e-12, 0.527332023564034])

    dt = 0.01
    motor_noise_std = 0.05
    wPq_std = 3e-4
    wPqdot_std = 0.0024
    motor_noise_magnitude = DM(np.array([motor_noise_std**2 / dt, motor_noise_std**2 / dt]))
    wPq_magnitude = DM(np.array([wPq_std**2 / dt, wPq_std**2 / dt]))
    wPqdot_magnitude = DM(np.array([wPqdot_std**2 / dt, wPqdot_std**2 / dt]))
    sensory_noise_magnitude = vertcat(wPq_magnitude, wPqdot_magnitude)

    bioptim_folder = os.path.dirname(ocp_module.__file__)

    ocp = ocp_module.prepare_socp(
        biorbd_model_path=bioptim_folder + "/models/LeuvenArmModel.bioMod",
        final_time=final_time,
        n_shooting=n_shooting,
        ee_final_position=ee_final_position,
        motor_noise_magnitude=motor_noise_magnitude,
        sensory_noise_magnitude=sensory_noise_magnitude,
        with_cholesky=with_cholesky,
        with_scaling=with_scaling,
    )

    # Solver parameters
    solver = Solver.IPOPT(show_online_optim=False)
    solver.set_maximum_iterations(4)
    solver.set_nlp_scaling_method("none")
  sol = ocp.solve(solver)

tests\shard3\test_global_stochastic.py:568:


bioptim\optimization\optimal_control_program.py:1591: in solve
self.ocp_solver.solve()
bioptim\interfaces\ipopt_interface.py:97: in solve
return generic_solve(self)
bioptim\interfaces\interface_utils.py:58: in generic_solve
interface.ocp_solver = nlpsol("solver", interface.solver_name.lower(), interface.sqp_nlp, options)


args = ('solver', 'ipopt', {'f': MX(@1=0x1, mac(ones(1x15),vertcat(MINIMIZE_CONTROL(X_scaled_0_0, U_scaled_0_0, @1, S_scaled_...acceptable_constr_viol_tol': 0.01, 'ipopt.acceptable_dual_inf_tol': 10000000000.0, 'ipopt.acceptable_tol': 1e-06, ...})

def nlpsol(*args) -> "casadi::Function":
    """
      [INTERNAL]

    ::

      nlpsol(str name, str solver, Importer compiler, dict opts) -> Function
      nlpsol(str name, str solver, NlpBuilder nl, dict opts) -> Function
      nlpsol(str name, str solver, dict:SX nlp, dict opts) -> Function
      nlpsol(str name, str solver, dict:MX nlp, dict opts) -> Function
      nlpsol(str name, str solver, str fname, dict opts) -> Function


    .......

    ::

      nlpsol(str name, str solver, dict:SX nlp, dict opts)



    [INTERNAL]

    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

    +------------------+-----------------+------------------+------------------+
    |        Id        |      Type       |   Description    |     Used in      |
    +==================+=================+==================+==================+
    | ad_weight        | OT_DOUBLE       | Weighting factor | casadi::Function |
    |                  |                 | for derivative   | Internal         |
    |                  |                 | calculation.When |                  |
    |                  |                 | there is an      |                  |
    |                  |                 | option of either |                  |
    |                  |                 | using forward or |                  |
    |                  |                 | reverse mode     |                  |
    |                  |                 | directional      |                  |
    |                  |                 | derivatives, the |                  |
    |                  |                 | condition ad_wei |                  |
    |                  |                 | ght*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.      |                  |
    +------------------+-----------------+------------------+------------------+
    | ad_weight_sp     | OT_DOUBLE       | Weighting factor | casadi::Function |
    |                  |                 | for sparsity     | Internal         |
    |                  |                 | pattern          |                  |
    |                  |                 | calculation calc |                  |
    |                  |                 | ulation.Override |                  |
    |                  |                 | s 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.        |                  |
    +------------------+-----------------+------------------+------------------+
    | always_inline    | OT_BOOL         | Force inlining.  | casadi::Function |
    |                  |                 |                  | Internal         |
    +------------------+-----------------+------------------+------------------+
    | bound_consistenc | OT_BOOL         | Ensure that      | casadi::Nlpsol   |
    | y                |                 | primal-dual      |                  |
    |                  |                 | solution is      |                  |
    |                  |                 | consistent with  |                  |
    |                  |                 | the bounds       |                  |
    +------------------+-----------------+------------------+------------------+
    | cache            | OT_DICT         | Prepopulate the  | casadi::Function |
    |                  |                 | function cache.  | Internal         |
    |                  |                 | Default: empty   |                  |
    +------------------+-----------------+------------------+------------------+
    | calc_f           | OT_BOOL         | Calculate 'f' in | casadi::Nlpsol   |
    |                  |                 | the Nlpsol base  |                  |
    |                  |                 | class            |                  |
    +------------------+-----------------+------------------+------------------+
    | calc_g           | OT_BOOL         | Calculate 'g' in | casadi::Nlpsol   |
    |                  |                 | the Nlpsol base  |                  |
    |                  |                 | class            |                  |
    +------------------+-----------------+------------------+------------------+
    | calc_lam_p       | OT_BOOL         | Calculate        | casadi::Nlpsol   |
    |                  |                 | 'lam_p' in the   |                  |
    |                  |                 | Nlpsol base      |                  |
    |                  |                 | class            |                  |
    +------------------+-----------------+------------------+------------------+
    | calc_lam_x       | OT_BOOL         | Calculate        | casadi::Nlpsol   |
    |                  |                 | 'lam_x' in the   |                  |
    |                  |                 | Nlpsol base      |                  |
    |                  |                 | class            |                  |
    +------------------+-----------------+------------------+------------------+
    | calc_multipliers | OT_BOOL         | Calculate        | casadi::Nlpsol   |
    |                  |                 | Lagrange         |                  |
    |                  |                 | multipliers in   |                  |
    |                  |                 | the Nlpsol base  |                  |
    |                  |                 | class            |                  |
    +------------------+-----------------+------------------+------------------+
    | common_options   | OT_DICT         | Options for      | casadi::OracleFu |
    |                  |                 | auto-generated   | nction           |
    |                  |                 | functions        |                  |
    +------------------+-----------------+------------------+------------------+
    | compiler         | OT_STRING       | Just-in-time     | casadi::Function |
    |                  |                 | compiler plugin  | Internal         |
    |                  |                 | to be used.      |                  |
    +------------------+-----------------+------------------+------------------+
    | custom_jacobian  | OT_FUNCTION     | Override         | casadi::Function |
    |                  |                 | CasADi's AD. Use | Internal         |
    |                  |                 | together with    |                  |
    |                  |                 | 'jac_penalty':   |                  |
    |                  |                 | 0. Note: Highly  |                  |
    |                  |                 | experimental.    |                  |
    |                  |                 | Syntax may break |                  |
    |                  |                 | often.           |                  |
    +------------------+-----------------+------------------+------------------+
    | der_options      | OT_DICT         | Default options  | casadi::Function |
    |                  |                 | to be used to    | Internal         |
    |                  |                 | populate         |                  |
    |                  |                 | forward_options, |                  |
    |                  |                 | reverse_options, |                  |
    |                  |                 | and              |                  |
    |                  |                 | jacobian_options |                  |
    |                  |                 | before those     |                  |
    |                  |                 | options are      |                  |
    |                  |                 | merged in.       |                  |
    +------------------+-----------------+------------------+------------------+
    | derivative_of    | OT_FUNCTION     | The function is  | casadi::Function |
    |                  |                 | a derivative of  | Internal         |
    |                  |                 | another          |                  |
    |                  |                 | function. The    |                  |
    |                  |                 | type of          |                  |
    |                  |                 | derivative       |                  |
    |                  |                 | (directional     |                  |
    |                  |                 | derivative,      |                  |
    |                  |                 | Jacobian) is     |                  |
    |                  |                 | inferred from    |                  |
    |                  |                 | the function     |                  |
    |                  |                 | name.            |                  |
    +------------------+-----------------+------------------+------------------+
    | detect_simple_bo | OT_BOOL         | Automatically    | casadi::Nlpsol   |
    | unds             |                 | 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 'f |                  |
    |                  |                 | ixed_variable_tr |                  |
    |                  |                 | eatment' is set  |                  |
    |                  |                 | to               |                  |
    |                  |                 | 'relax_bounds'.  |                  |
    +------------------+-----------------+------------------+------------------+
    | detect_simple_bo | OT_BOOLVECTOR   | For internal use | casadi::Nlpsol   |
    | unds_is_simple   |                 | only.            |                  |
    +------------------+-----------------+------------------+------------------+
    | detect_simple_bo | OT_FUNCTION     | For internal use | casadi::Nlpsol   |
    | unds_parts       |                 | only.            |                  |
    +------------------+-----------------+------------------+------------------+
    | detect_simple_bo | OT_INTVECTOR    | For internal use | casadi::Nlpsol   |
    | unds_target_x    |                 | only.            |                  |
    +------------------+-----------------+------------------+------------------+
    | discrete         | OT_BOOLVECTOR   | Indicates which  | casadi::Nlpsol   |
    |                  |                 | of the variables |                  |
    |                  |                 | are discrete,    |                  |
    |                  |                 | i.e. integer-    |                  |
    |                  |                 | valued           |                  |
    +------------------+-----------------+------------------+------------------+
    | dump             | OT_BOOL         | Dump function to | casadi::Function |
    |                  |                 | file upon first  | Internal         |
    |                  |                 | evaluation.      |                  |
    |                  |                 | [false]          |                  |
    +------------------+-----------------+------------------+------------------+
    | dump_dir         | OT_STRING       | Directory to     | casadi::Function |
    |                  |                 | dump             | Internal         |
    |                  |                 | inputs/outputs   |                  |
    |                  |                 | to. Make sure    |                  |
    |                  |                 | the directory    |                  |
    |                  |                 | exists [.]       |                  |
    +------------------+-----------------+------------------+------------------+
    | dump_format      | OT_STRING       | Choose file      | casadi::Function |
    |                  |                 | format to dump   | Internal         |
    |                  |                 | matrices. See    |                  |
    |                  |                 | DM.from_file     |                  |
    |                  |                 | [mtx]            |                  |
    +------------------+-----------------+------------------+------------------+
    | dump_in          | OT_BOOL         | Dump numerical   | casadi::Function |
    |                  |                 | values of inputs | Internal         |
    |                  |                 | to file          |                  |
    |                  |                 | (readable with   |                  |
    |                  |                 | DM.from_file )   |                  |
    |                  |                 | [default: false] |                  |
    +------------------+-----------------+------------------+------------------+
    | dump_out         | OT_BOOL         | Dump numerical   | casadi::Function |
    |                  |                 | values of        | Internal         |
    |                  |                 | outputs to file  |                  |
    |                  |                 | (readable with   |                  |
    |                  |                 | DM.from_file )   |                  |
    |                  |                 | [default: false] |                  |
    +------------------+-----------------+------------------+------------------+
    | enable_fd        | OT_BOOL         | Enable           | casadi::Function |
    |                  |                 | derivative       | Internal         |
    |                  |                 | calculation by   |                  |
    |                  |                 | finite           |                  |
    |                  |                 | differencing.    |                  |
    |                  |                 | [default:        |                  |
    |                  |                 | false]]          |                  |
    +------------------+-----------------+------------------+------------------+
    | enable_forward   | OT_BOOL         | Enable           | casadi::Function |
    |                  |                 | derivative       | Internal         |
    |                  |                 | calculation      |                  |
    |                  |                 | using generated  |                  |
    |                  |                 | functions for    |                  |
    |                  |                 | Jacobian-times-  |                  |
    |                  |                 | vector products  |                  |
    |                  |                 | - typically      |                  |
    |                  |                 | using forward    |                  |
    |                  |                 | mode AD - if     |                  |
    |                  |                 | available.       |                  |
    |                  |                 | [default: true]  |                  |
    +------------------+-----------------+------------------+------------------+
    | enable_jacobian  | OT_BOOL         | Enable           | casadi::Function |
    |                  |                 | derivative       | Internal         |
    |                  |                 | calculation      |                  |
    |                  |                 | using generated  |                  |
    |                  |                 | functions for    |                  |
    |                  |                 | Jacobians of all |                  |
    |                  |                 | differentiable   |                  |
    |                  |                 | outputs with     |                  |
    |                  |                 | respect to all   |                  |
    |                  |                 | differentiable   |                  |
    |                  |                 | inputs - if      |                  |
    |                  |                 | available.       |                  |
    |                  |                 | [default: true]  |                  |
    +------------------+-----------------+------------------+------------------+
    | enable_reverse   | OT_BOOL         | Enable           | casadi::Function |
    |                  |                 | derivative       | Internal         |
    |                  |                 | calculation      |                  |
    |                  |                 | using generated  |                  |
    |                  |                 | functions for    |                  |
    |                  |                 | transposed       |                  |
    |                  |                 | Jacobian-times-  |                  |
    |                  |                 | vector products  |                  |
    |                  |                 | - typically      |                  |
    |                  |                 | using reverse    |                  |
    |                  |                 | mode AD - if     |                  |
    |                  |                 | available.       |                  |
    |                  |                 | [default: true]  |                  |
    +------------------+-----------------+------------------+------------------+
    | error_on_fail    | OT_BOOL         | Throw exceptions | casadi::ProtoFun |
    |                  |                 | when function    | ction            |
    |                  |                 | evaluation fails |                  |
    |                  |                 | (default true).  |                  |
    +------------------+-----------------+------------------+------------------+
    | eval_errors_fata | OT_BOOL         | When errors      | casadi::Nlpsol   |
    | l                |                 | occur during     |                  |
    |                  |                 | evaluation of    |                  |
    |                  |                 | f,g,...,stop the |                  |
    |                  |                 | iterations       |                  |
    +------------------+-----------------+------------------+------------------+
    | expand           | OT_BOOL         | Replace MX with  | casadi::OracleFu |
    |                  |                 | SX expressions   | nction           |
    |                  |                 | in problem       |                  |
    |                  |                 | formulation      |                  |
    |                  |                 | [false]          |                  |
    +------------------+-----------------+------------------+------------------+
    | fd_method        | OT_STRING       | Method for       | casadi::Function |
    |                  |                 | finite           | Internal         |
    |                  |                 | differencing     |                  |
    |                  |                 | [default         |                  |
    |                  |                 | 'central']       |                  |
    +------------------+-----------------+------------------+------------------+
    | fd_options       | OT_DICT         | Options to be    | casadi::Function |
    |                  |                 | passed to the    | Internal         |
    |                  |                 | finite           |                  |
    |                  |                 | difference       |                  |
    |                  |                 | instance         |                  |
    +------------------+-----------------+------------------+------------------+
    | forward_options  | OT_DICT         | Options to be    | casadi::Function |
    |                  |                 | passed to a      | Internal         |
    |                  |                 | forward mode     |                  |
    |                  |                 | constructor      |                  |
    +------------------+-----------------+------------------+------------------+
    | gather_stats     | OT_BOOL         | Deprecated       | casadi::Function |
    |                  |                 | option           | Internal         |
    |                  |                 | (ignored):       |                  |
    |                  |                 | Statistics are   |                  |
    |                  |                 | now always       |                  |
    |                  |                 | collected.       |                  |
    +------------------+-----------------+------------------+------------------+
    | ignore_check_vec | OT_BOOL         | If set to true,  | casadi::Nlpsol   |
    |                  |                 | the input shape  |                  |
    |                  |                 | of F will not be |                  |
    |                  |                 | checked.         |                  |
    +------------------+-----------------+------------------+------------------+
    | input_scheme     | OT_STRINGVECTOR | Deprecated       | casadi::Function |
    |                  |                 | option (ignored) | Internal         |
    +------------------+-----------------+------------------+------------------+
    | inputs_check     | OT_BOOL         | Throw exceptions | casadi::Function |
    |                  |                 | when the         | Internal         |
    |                  |                 | numerical values |                  |
    |                  |                 | of the inputs    |                  |
    |                  |                 | don't make sense |                  |
    +------------------+-----------------+------------------+------------------+
    | is_diff_in       | OT_BOOLVECTOR   | Indicate for     | casadi::Function |
    |                  |                 | each input if it | Internal         |
    |                  |                 | should be        |                  |
    |                  |                 | differentiable.  |                  |
    +------------------+-----------------+------------------+------------------+
    | is_diff_out      | OT_BOOLVECTOR   | Indicate for     | casadi::Function |
    |                  |                 | each output if   | Internal         |
    |                  |                 | it should be     |                  |
    |                  |                 | differentiable.  |                  |
    +------------------+-----------------+------------------+------------------+
    | iteration_callba | OT_FUNCTION     | A function that  | casadi::Nlpsol   |
    | ck               |                 | will be called   |                  |
    |                  |                 | at each          |                  |
    |                  |                 | iteration with   |                  |
    |                  |                 | the solver as    |                  |
    |                  |                 | input. Check     |                  |
    |                  |                 | documentation of |                  |
    |                  |                 | Callback .       |                  |
    +------------------+-----------------+------------------+------------------+
    | iteration_callba | OT_BOOL         | If set to true,  | casadi::Nlpsol   |
    | ck_ignore_errors |                 | errors thrown by |                  |
    |                  |                 | iteration_callba |                  |
    |                  |                 | ck will be       |                  |
    |                  |                 | ignored.         |                  |
    +------------------+-----------------+------------------+------------------+
    | iteration_callba | OT_INT          | Only call the    | casadi::Nlpsol   |
    | ck_step          |                 | callback         |                  |
    |                  |                 | function every   |                  |
    |                  |                 | few iterations.  |                  |
    +------------------+-----------------+------------------+------------------+
    | jac_penalty      | OT_DOUBLE       | When requested   | casadi::Function |
    |                  |                 | for a number of  | Internal         |
    |                  |                 | 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         |                  |
    +------------------+-----------------+------------------+------------------+
    | jacobian_options | OT_DICT         | Options to be    | casadi::Function |
    |                  |                 | passed to a      | Internal         |
    |                  |                 | Jacobian         |                  |
    |                  |                 | constructor      |                  |
    +------------------+-----------------+------------------+------------------+
    | jit              | OT_BOOL         | Use just-in-time | casadi::Function |
    |                  |                 | compiler to      | Internal         |
    |                  |                 | speed up the     |                  |
    |                  |                 | evaluation       |                  |
    +------------------+-----------------+------------------+------------------+
    | jit_cleanup      | OT_BOOL         | Cleanup up the   | casadi::Function |
    |                  |                 | temporary source | Internal         |
    |                  |                 | file that jit    |                  |
    |                  |                 | creates.         |                  |
    |                  |                 | Default: true    |                  |
    +------------------+-----------------+------------------+------------------+
    | jit_name         | OT_STRING       | The file name    | casadi::Function |
    |                  |                 | used to write    | Internal         |
    |                  |                 | out code. The    |                  |
    |                  |                 | actual file      |                  |
    |                  |                 | names used       |                  |
    |                  |                 | depend on 'jit_t |                  |
    |                  |                 | emp_suffix' and  |                  |
    |                  |                 | include          |                  |
    |                  |                 | extensions.      |                  |
    |                  |                 | Default:         |                  |
    |                  |                 | 'jit_tmp'        |                  |
    +------------------+-----------------+------------------+------------------+
    | jit_options      | OT_DICT         | Options to be    | casadi::Function |
    |                  |                 | passed to the    | Internal         |
    |                  |                 | jit compiler.    |                  |
    +------------------+-----------------+------------------+------------------+
    | jit_serialize    | OT_STRING       | Specify          | casadi::Function |
    |                  |                 | behaviour when   | Internal         |
    |                  |                 | serializing a    |                  |
    |                  |                 | jitted function: |                  |
    |                  |                 | SOURCE|link|embe |                  |
    |                  |                 | d.               |                  |
    +------------------+-----------------+------------------+------------------+
    | jit_temp_suffix  | OT_BOOL         | Use a temporary  | casadi::Function |
    |                  |                 | (seemingly       | Internal         |
    |                  |                 | random) filename |                  |
    |                  |                 | suffix for       |                  |
    |                  |                 | generated code   |                  |
    |                  |                 | and libraries.   |                  |
    |                  |                 | This is desired  |                  |
    |                  |                 | for thread-      |                  |
    |                  |                 | safety. This     |                  |
    |                  |                 | behaviour may    |                  |
    |                  |                 | defeat caching   |                  |
    |                  |                 | compiler         |                  |
    |                  |                 | wrappers.        |                  |
    |                  |                 | Default: true    |                  |
    +------------------+-----------------+------------------+------------------+
    | max_io           | OT_INT          | Acceptable       | casadi::Function |
    |                  |                 | number of inputs | Internal         |
    |                  |                 | and outputs.     |                  |
    |                  |                 | Warn if          |                  |
    |                  |                 | exceeded.        |                  |
    +------------------+-----------------+------------------+------------------+
    | max_num_dir      | OT_INT          | Specify the      | casadi::Function |
    |                  |                 | maximum number   | Internal         |
    |                  |                 | of directions    |                  |
    |                  |                 | for derivative   |                  |
    |                  |                 | functions.       |                  |
    |                  |                 | Overrules the    |                  |
    |                  |                 | builtin optimize |                  |
    |                  |                 | d_num_dir.       |                  |
    +------------------+-----------------+------------------+------------------+
    | min_lam          | OT_DOUBLE       | Minimum allowed  | casadi::Nlpsol   |
    |                  |                 | multiplier value |                  |
    +------------------+-----------------+------------------+------------------+
    | monitor          | OT_STRINGVECTOR | Set of user      | casadi::OracleFu |
    |                  |                 | problem          | nction           |
    |                  |                 | functions to be  |                  |
    |                  |                 | monitored        |                  |
    +------------------+-----------------+------------------+------------------+
    | never_inline     | OT_BOOL         | Forbid inlining. | casadi::Function |
    |                  |                 |                  | Internal         |
    +------------------+-----------------+------------------+------------------+
    | no_nlp_grad      | OT_BOOL         | Prevent the      | casadi::Nlpsol   |
    |                  |                 | creation of the  |                  |
    |                  |                 | 'nlp_grad'       |                  |
    |                  |                 | function         |                  |
    +------------------+-----------------+------------------+------------------+
    | oracle_options   | OT_DICT         | Options to be    | casadi::Nlpsol   |
    |                  |                 | passed to the    |                  |
    |                  |                 | oracle function  |                  |
    +------------------+-----------------+------------------+------------------+
    | output_scheme    | OT_STRINGVECTOR | Deprecated       | casadi::Function |
    |                  |                 | option (ignored) | Internal         |
    +------------------+-----------------+------------------+------------------+
    | post_expand      | OT_BOOL         | After            | casadi::Function |
    |                  |                 | construction,    | Internal         |
    |                  |                 | expand this      |                  |
    |                  |                 | Function .       |                  |
    |                  |                 | Default: False   |                  |
    +------------------+-----------------+------------------+------------------+
    | post_expand_opti | OT_DICT         | Options to be    | casadi::Function |
    | ons              |                 | passed to post-  | Internal         |
    |                  |                 | construction     |                  |
    |                  |                 | expansion.       |                  |
    |                  |                 | Default: empty   |                  |
    +------------------+-----------------+------------------+------------------+
    | print_in         | OT_BOOL         | Print numerical  | casadi::Function |
    |                  |                 | values of inputs | Internal         |
    |                  |                 | [default: false] |                  |
    +------------------+-----------------+------------------+------------------+
    | print_out        | OT_BOOL         | Print numerical  | casadi::Function |
    |                  |                 | values of        | Internal         |
    |                  |                 | outputs          |                  |
    |                  |                 | [default: false] |                  |
    +------------------+-----------------+------------------+------------------+
    | print_time       | OT_BOOL         | print            | casadi::ProtoFun |
    |                  |                 | information      | ction            |
    |                  |                 | about execution  |                  |
    |                  |                 | time. Implies    |                  |
    |                  |                 | record_time.     |                  |
    +------------------+-----------------+------------------+------------------+
    | record_time      | OT_BOOL         | record           | casadi::ProtoFun |
    |                  |                 | information      | ction            |
    |                  |                 | about execution  |                  |
    |                  |                 | time, for        |                  |
    |                  |                 | retrieval with   |                  |
    |                  |                 | stats().         |                  |
    +------------------+-----------------+------------------+------------------+
    | regularity_check | OT_BOOL         | Throw exceptions | casadi::ProtoFun |
    |                  |                 | when NaN or Inf  | ction            |
    |                  |                 | appears during   |                  |
    |                  |                 | evaluation       |                  |
    +------------------+-----------------+------------------+------------------+
    | reverse_options  | OT_DICT         | Options to be    | casadi::Function |
    |                  |                 | passed to a      | Internal         |
    |                  |                 | reverse mode     |                  |
    |                  |                 | constructor      |                  |
    +------------------+-----------------+------------------+------------------+
    | sens_linsol      | OT_STRING       | Linear solver    | casadi::Nlpsol   |
    |                  |                 | used for         |                  |
    |                  |                 | parametric       |                  |
    |                  |                 | sensitivities    |                  |
    |                  |                 | (default 'qr').  |                  |
    +------------------+-----------------+------------------+------------------+
    | sens_linsol_opti | OT_DICT         | Linear solver    | casadi::Nlpsol   |
    | ons              |                 | options used for |                  |
    |                  |                 | parametric       |                  |
    |                  |                 | sensitivities.   |                  |
    +------------------+-----------------+------------------+------------------+
    | show_eval_warnin | OT_BOOL         | Show warnings    | casadi::OracleFu |
    | gs               |                 | generated from   | nction           |
    |                  |                 | function         |                  |
    |                  |                 | evaluations      |                  |
    |                  |                 | [true]           |                  |
    +------------------+-----------------+------------------+------------------+
    | specific_options | OT_DICT         | Options for      | casadi::OracleFu |
    |                  |                 | specific auto-   | nction           |
    |                  |                 | generated        |                  |
    |                  |                 | functions,       |                  |
    |                  |                 | overwriting the  |                  |
    |                  |                 | defaults from    |                  |
    |                  |                 | common_options.  |                  |
    |                  |                 | Nested           |                  |
    |                  |                 | dictionary.      |                  |
    +------------------+-----------------+------------------+------------------+
    | user_data        | OT_VOIDPTR      | A user-defined   | casadi::Function |
    |                  |                 | field that can   | Internal         |
    |                  |                 | be used to       |                  |
    |                  |                 | identify the     |                  |
    |                  |                 | function or pass |                  |
    |                  |                 | additional       |                  |
    |                  |                 | information      |                  |
    +------------------+-----------------+------------------+------------------+
    | verbose          | OT_BOOL         | Verbose          | casadi::ProtoFun |
    |                  |                 | evaluation  for  | ction            |
    |                  |                 | debugging        |                  |
    +------------------+-----------------+------------------+------------------+
    | verbose_init     | OT_BOOL         | Print out timing | casadi::Nlpsol   |
    |                  |                 | information      |                  |
    |                  |                 | about the        |                  |
    |                  |                 | different stages |                  |
    |                  |                 | of               |                  |
    |                  |                 | initialization   |                  |
    +------------------+-----------------+------------------+------------------+
    | warn_initial_bou | OT_BOOL         | Warn if the      | casadi::Nlpsol   |
    | nds              |                 | initial guess    |                  |
    |                  |                 | does not satisfy |                  |
    |                  |                 | LBX and UBX      |                  |
    +------------------+-----------------+------------------+------------------+

    >Input scheme: casadi::NlpsolInput (NLPSOL_NUM_IN = 8)

    +---------------+--------+-------------------------------------------------+
    |   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)                                  |
    +---------------+--------+-------------------------------------------------+

    >Output scheme: casadi::NlpsolOutput (NLPSOL_NUM_OUT = 6)

    +--------------+-------+---------------------------------------------------+
    |  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)                                 |
    +--------------+-------+---------------------------------------------------+

    List of plugins
    - AmplInterface

    - blocksqp

    - bonmin

    - ipopt

    - knitro

    - 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

    +--------+-----------+--------------------+
    |   Id   |   Type    |    Description     |
    +========+===========+====================+
    | solver | OT_STRING | AMPL solver binary |
    +--------+-----------+--------------------+



    --------------------------------------------------------------------------------

    blocksqp
    --------



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

    Dennis Janka, Joel Andersson

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

    >List of available options

    +----------------------------+-----------+---------------------------------+
    |             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                       |
    +----------------------------+-----------+---------------------------------+



    --------------------------------------------------------------------------------

    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:
    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

    >List of available options

    +-------------------------+-----------------------+------------------------+
    |           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_constrai | OT_BOOL               | Pass list of           |
    | nts                     |                       | constraints entering   |
    |                         |                       | nonlinearly to BONMIN  |
    +-------------------------+-----------------------+------------------------+
    | pass_nonlinear_variable | OT_BOOL               | Pass list of variables |
    | s                       |                       | 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              |
    +-------------------------+-----------------------+------------------------+



    --------------------------------------------------------------------------------

    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:
    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

    >List of available options

    +--------------------------+-------------+---------------------------------+
    |            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
    ------



    KNITRO interface

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

    >List of available options

    +--------------------------+--------------------+--------------------------+
    |            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_constraint | OT_BOOL            | Detect type of           |
    | s                        |                    | constraints              |
    +--------------------------+--------------------+--------------------------+
    | knitro                   | OT_DICT            | Options to be passed to  |
    |                          |                    | KNITRO                   |
    +--------------------------+--------------------+--------------------------+
    | options_file             | OT_STRING          | Read options from file   |
    |                          |                    | (solver specific)        |
    +--------------------------+--------------------+--------------------------+



    --------------------------------------------------------------------------------

    snopt
    -----



    SNOPT interface

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

    >List of available options

    +-------+-----------+---------------------------------------------+
    |  Id   |   Type    |                 Description                 |
    +=======+===========+=============================================+
    | snopt | OT_DICT   | Options to be passed to SNOPT               |
    +-------+-----------+---------------------------------------------+
    | start | OT_STRING | Warm-start options for Worhp: cold|warm|hot |
    +-------+-----------+---------------------------------------------+



    --------------------------------------------------------------------------------

    worhp
    -----



    WORHP interface

    Designed for Worhp 1.12

    >List of available options

    +-------+---------+-------------------------------+
    |  Id   |  Type   |          Description          |
    +=======+=========+===============================+
    | worhp | OT_DICT | Options to be passed to WORHP |
    +-------+---------+-------------------------------+



    --------------------------------------------------------------------------------

    feasiblesqpmethod
    -----------------



    A textbook FeasibleSQPMethod

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

    >List of available options

    +----------------------------+-----------------+---------------------------+
    |             Id             |      Type       |        Description        |
    +============================+=================+===========================+
    | anderson_memory            | OT_INT          | Anderson memory. If       |
    |                            |                 | Anderson is used default  |
    |                            |                 | is 1, else default is 0.  |
    +----------------------------+-----------------+---------------------------+
    | contraction_acceptance_val | OT_DOUBLE       | If the empirical          |
    | ue                         |                 | 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.               |
    +----------------------------+-----------------+---------------------------+



    --------------------------------------------------------------------------------

    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

    +-----------------------+-----------------+--------------------------------+
    |          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                 |
    +-----------------------+-----------------+--------------------------------+



    --------------------------------------------------------------------------------

    sqpmethod
    ---------



    A textbook SQPMethod

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

    >List of available options

    +--------------------------+-------------+---------------------------------+
    |            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                   |
    +--------------------------+-------------+---------------------------------+

    Joel Andersson

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

    Doc source:
    https://github.com/casadi/casadi/blob/develop/casadi/core/nlpsol.hpp#L115

    Implementation:
    https://github.com/casadi/casadi/blob/develop/casadi/core/nlpsol.cpp#L115-L118



    .............


    .......

    ::

      nlpsol(str name, str solver, Importer compiler, dict opts)
      nlpsol(str name, str solver, NlpBuilder nl, dict opts)
      nlpsol(str name, str solver, dict:MX nlp, dict opts)
      nlpsol(str name, str solver, str fname, dict opts)



    [INTERNAL]

    .............



    """
  return _casadi.nlpsol(*args)

E RuntimeError: D:\bld\casadi_1685976412967\work\casadi\core\function_internal.cpp:146: Error calling IpoptInterface::init for 'solver':
E Error in Function::factory for 'nlp' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:1759:
E Failed to create nlp_hess_l:[x, p, lam:f, lam:g]->[triu:hess:gamma:x:x] with {"gamma": [f, g]}:
E D:\bld\casadi_1685976412967\work\casadi\core/factory.hpp:591: Hessian generation failed:
E D:\bld\casadi_1685976412967\work\casadi\core/factory.hpp:512: Calculating Hessian of gamma w.r.t. [x] and [x]: Error in MX::hessian at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:1724:
E Error in MX::jacobian at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:1708:
E Error in XFunction::jac for 'helper_jacobian_MX' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:804:
E Error in MXFunction::ad_forward at D:\bld\casadi_1685976412967\work\casadi\core\mx_function.cpp:890:
E Error in MX::ad_forward for node of type class casadi::Call at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:2301:
E Error in Call::ad_forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\casadi_call.cpp:121:
E Error in Function::forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:1083:
E Error in XFunction::get_forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:856:
E Error in MXFunction::ad_forward at D:\bld\casadi_1685976412967\work\casadi\core\mx_function.cpp:890:
E Error in MX::ad_forward for node of type class casadi::Call at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:2301:
E Error in Call::ad_forward for 'adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\casadi_call.cpp:121:
E Error in XFunction::get_jacobian for 'adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:961:
E Error in Function::Function for 'jac_adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:249:
E D:\bld\casadi_1685976412967\work\casadi\core\function_internal.cpp:146: Error calling MXFunction::init for 'jac_adj1_reach_target_consistantly':
E bad allocation

C:\Miniconda3\envs\bioptim\Lib\site-packages\casadi\casadi.py:28956: RuntimeError
============================== warnings summary ===============================
bioptim\gui\check_conditioning.py:454
D:\a\bioptim\bioptim\bioptim\gui\check_conditioning.py:454: DeprecationWarning: invalid escape sequence '\ '
condition_number.append(" /!\ Ev_min is 0")

tests\shard3\test_parameters.py:55
D:\a\bioptim\bioptim\tests\shard3\test_parameters.py:55: DeprecationWarning: invalid escape sequence '('
ValueError, match=f"The shape (2) of the scaling of parameter gravity_z does not match the params shape."

tests\shard3\test_parameters.py:60
D:\a\bioptim\bioptim\tests\shard3\test_parameters.py:60: DeprecationWarning: invalid escape sequence '('
ValueError, match=f"Invalid ncols for Parameter Scaling (ncols = 2), the expected number of column is 1"

tests/shard3/test_global_getting_started.py::test_parameter_optimization[RK4-True]
tests/shard3/test_global_getting_started.py::test_parameter_optimization[RK4-False]
D:\a\bioptim\bioptim\tests\shard3\test_global_getting_started.py:774: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.fromiter(generator)) or the python sum builtin instead.
cost_values_all = np.sum(cost["cost_value_weighted"] for cost in sol.detailed_cost)

tests/shard3/test_global_getting_started.py::test_parameter_optimization[RK8-True]
D:\a\bioptim\bioptim\tests\shard3\test_global_getting_started.py:791: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.fromiter(generator)) or the python sum builtin instead.
cost_values_all = np.sum(sol.detailed_cost[i]["cost_value_weighted"] for i in range(len(sol.detailed_cost)))

tests/shard3/test_global_getting_started.py::test_parameter_optimization[COLLOCATION-True]
D:\a\bioptim\bioptim\tests\shard3\test_global_getting_started.py:808: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.fromiter(generator)) or the python sum builtin instead.
cost_values_all = np.sum(sol.detailed_cost[i]["cost_value_weighted"] for i in range(len(sol.detailed_cost)))

tests/shard3/test_global_symmetrical_torque_driven_ocp.py: 15 warnings
tests/shard3/test_mappings.py: 6 warnings
D:\a\bioptim\bioptim\bioptim\misc\mapping.py:387: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
dependency_matrix[i] = int(first[i] - 1)

tests/shard3/test_global_symmetrical_torque_driven_ocp.py::test_symmetry_by_mapping[RK4-True]
tests/shard3/test_global_symmetrical_torque_driven_ocp.py::test_symmetry_by_mapping[RK4-False]
tests/shard3/test_global_symmetrical_torque_driven_ocp.py::test_symmetry_by_mapping[COLLOCATION-True]
tests/shard3/test_global_symmetrical_torque_driven_ocp.py::test_symmetry_by_mapping[IRK-True]
tests/shard3/test_global_symmetrical_torque_driven_ocp.py::test_symmetry_by_mapping[IRK-False]
tests/shard3/test_mappings.py::test_bidirectional_selection_mapping
D:\a\bioptim\bioptim\bioptim\misc\mapping.py:390: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
dependency_matrix[i] = int(abs(first[i]) - 1)

tests/shard3/test_graph.py: 16 warnings
D:\a\bioptim\bioptim\bioptim\gui\graph.py:63: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
condensed_vector += f"{round(float(var), decimal):.{decimal}f} "

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ===========================
FAILED tests/shard3/test_global_stochastic.py::test_arm_reaching_torque_driven_implicit[False-False] - RuntimeError: D:\bld\casadi_1685976412967\work\casadi\core\function_internal.cpp:146: Error calling IpoptInterface::init for 'solver':
Error in Function::factory for 'nlp' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:1759:
Failed to create nlp_hess_l:[x, p, lam:f, lam:g]->[triu:hess:gamma:x:x] with {"gamma": [f, g]}:
D:\bld\casadi_1685976412967\work\casadi\core/factory.hpp:591: Hessian generation failed:
D:\bld\casadi_1685976412967\work\casadi\core/factory.hpp:512: Calculating Hessian of gamma w.r.t. [x] and [x]: Error in MX::hessian at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:1724:
Error in MX::jacobian at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:1708:
Error in XFunction::jac for 'helper_jacobian_MX' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:804:
Error in MXFunction::ad_forward at D:\bld\casadi_1685976412967\work\casadi\core\mx_function.cpp:890:
Error in MX::ad_forward for node of type class casadi::Call at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:2301:
Error in Call::ad_forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\casadi_call.cpp:121:
Error in Function::forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:1083:
Error in XFunction::get_forward for 'adj1_Multinode_Phase_0_node_0_Phase_0_node_1_Phase_0_node_2_Phase_0_node_3_Phase_0_node_4' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:856:
Error in MXFunction::ad_forward at D:\bld\casadi_1685976412967\work\casadi\core\mx_function.cpp:890:
Error in MX::ad_forward for node of type class casadi::Call at D:\bld\casadi_1685976412967\work\casadi\core\mx.cpp:2301:
Error in Call::ad_forward for 'adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\casadi_call.cpp:121:
Error in XFunction::get_jacobian for 'adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core/x_function.hpp:961:
Error in Function::Function for 'jac_adj1_reach_target_consistantly' [MXFunction] at D:\bld\casadi_1685976412967\work\casadi\core\function.cpp:249:
D:\bld\casadi_1685976412967\work\casadi\core\function_internal.cpp:146: Error calling MXFunction::init for 'jac_adj1_reach_target_consistantly':
bad allocation

@EveCharbie
Copy link
Collaborator Author

@pariterre can be merged :)

@EveCharbie EveCharbie changed the title [RTM when tests are fixed] Not compute the defects if not in implicit [RTM] Not compute the defects if not in implicit Aug 11, 2023
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)

@pariterre pariterre merged commit 7867a71 into pyomeca:master Aug 11, 2023
14 of 16 checks passed
@EveCharbie EveCharbie deleted the defects_none branch August 11, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants