solve_ocp

Class method.

solve_ocp(self, x0, N, discount=None)

Solves the finit horizon optimal control problem.

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

  • N (int) – Prediction horizon of the control problem.

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

Returns:

  • u_ol (array) – Optimal control sequence.

  • x_ol (array) – Optimal trajectory corresponding to the optimal control sequence.