mpc

Class method.

mpc(self, x0, N, K, discount=None)

Solves the optimal control problem via model predictive control.

Parameters:
  • x0 (array) – Initial state of the optimal control problem.

  • N (int) – MPC horizon.

  • K (int) – Number of MPC itertaions.

  • discount (float, optional) – Discountfactor of the objective. The default is None.

Returns:

res – nMPyC result object containing the optimiaztion results of the closed and open loop simulations.

Return type:

result