opti

Class property.

model.opti

Optimizer for the optimal control problem.

This property can be used to set different optimization options. A distinction is made between basic settings of the optimizer and solver-specific settings.

The basic settings can be adjusted by calling

>>> model.opti.set_options({..})

The dictionary that is passed can contain the following entries

Parameter

Description

Default value

solver

String defining which solver is for

optimization. Currently supported solvers are

  • ipotpt

  • sqpmethod

  • ospq

  • SLSQP

  • trust-constr

For auto a suitable solver depending on other

options and parameters is selected.

auto

full_discretization

If True, the method of full discretiziation is

used for optimization. Otherwise the the system

dynamics is resolved in the objective function.

True

tol

The toleranz of the solver.

If the solver distinguishes between relative

and absolute tolerances, both are set to this

value.

1e-06

maxiter

Maximal number of iterations during the

optimization progress.

5000

verbose

If True, the verbose option of the selected

solver ist activated.

False

initial_guess

Initial guess for the optimization variable u.

Must be an array of shape (nx,N).

If the initial guess has not the right shape or

is None it will be set to nmpyc.ones((nu,N))*0.1

by default.

None

The auto option of the solver selection follows the rule

  1. If the optimal control problem is recognized as a LQP and a fixed step discretization of the system is given, osqp is selected.

  2. If a condition of 1. is violated and not a SciPy discretization method is choosen, ipopt is selected.

  3. Otherwise SLSQP is selected.

The solver-specific settings can be custamized by calling

>>> model.opt.set_solverOptions({..})

Valid parameters which the passed dictionary can contain are depending on the selected solver. For a list of these settings take a look at

Type:

opti