constraints

class constraints[source]

Class used to define the constraints of the optimnal control problem.

Support for nonlinear, linear and box constraints are implemented and provided.

To define the constraints, first, an empty object have to be created. Then the individual constraints can be added with the help of the methods add_bound() and add_constr().

Attributes

constraints.linear_constr

Collection of all linear constraints.

constraints.lower_bndend

Lower bound \(l_x \in \mathbb{R}^{nx}\) of the terminal state.

constraints.lower_bndu

Lower bound \(l_u \in \mathbb{R}^{nu}\) for the control.

constraints.lower_bndx

Lower bound \(l_x \in \mathbb{R}^{nx}\) of the state.

constraints.nonlinear_constr

Collection of all nonlinear constraints.

constraints.type

Indicating whether all constraints are linear.

constraints.upper_bndend

Upper bound \(u_x \in \mathbb{R}^{nx}\) of the terminal state.

constraints.upper_bndu

Upper bound \(u_u \in \mathbb{R}^{nu}\) of the control.

constraints.upper_bndx

Upper bound \(u_x \in \mathbb{R}^{nx}\) of the state.

Methods

constraints.add_bound

Add bounds as linear constraints to the OCP.

constraints.add_constr

Add linear or nonlinear constraints to the OCP.

constraints.add_terminalconstr

Add linear or nonlinear terminal constraints to the OCP.

constraints.load

Loads a nMPyC constraints object from a file.

constraints.save

Saving the constraints to a given file with dill.