model

class model(objective, system, constraints=None)[source]

Class that contains all the components of the optimal control problem.

Can be used to perform open and closed loop simulations.

Parameters:
  • objective (objective) – nMPyC-objective defining the objective of the optimal control problem.

  • system (system) – nMPyC-system defining the system dynamics of the optimal control problem.

  • constraints (constraints optional) – nMPyC-constraints defining the constraints of the optimal control problem. If constraints is None the problem is unconstrained. The default is None.

Attributes

model.N

Prediction horizon of the MPC loop.

model.constraints

Constraints of the optimal control problem.

model.objective

Objective of the optimal control problem.

model.opti

Optimizer for the optimal control problem.

model.system

System dynamics of the optimal control problem.

Methods

model.load

Loads a nMPyC model object from a file.

model.mpc

Solves the optimal control problem via model predictive control.

model.save

Saving the model to a given file with dill.

model.solve_ocp

Solves the finit horizon optimal control problem.