add_terminalconstr

Class method.

add_terminalconstr(self, cons_type, *args)

Add linear or nonlinear terminal constraints to the OCP.

Nonlinear terminal inequality constraints are of the form

\[g(t,x) \geq 0 \quad \text{or} \quad g(x) \geq 0.\]

Nonlinear terminal equality constraints are of the form

\[h(t,x) = 0 \quad \text{or} \quad h(x) = 0.\]

Linear terminal inequality constraints are of the form

\[Ex \geq h.\]

Linear terminal equality constraints are of the form

\[Ex = h.\]
Parameters:
  • cons_type (str) – String that defines the type of the terminal constraints. Possible values are eq or ineq.

  • *args (callable or arrays) – Function defining the (nonlinear) terminal constraints or arrays defining the linear constraints. In the letter case the order of arguments are E, h and if h is undefined this array is set to zero.

For example

>>> constraints.add_terminalconstr('ineq', E, F, h)

will add a linear inequality terminal constraint to linear_constr while

>>> constraints.add_constr('eq',h)

will add a nonlinear equality terminal constraint to nonlinear_constr.