Class method., t_ind=-1)

Plots the predicted trajectories for the plot configuration. The predicted trajectories are part of the optimal solution at each timestep and are optionally stored in the object.


This method requires that the optimal solution is stored in the instance. Storing the optimal solution must be activated with do_mpc.controller.MPC.set_param().

The plot_predictions method can only be called with data from the do_mpc.controller.MPC object and raises an error if called with data from other objects. Use the t_ind parameter to plot the prediction for the given time instance. This can be used in post-processing for animations.


t_ind (int) – Plot predictions at this time index.

  • assertion – Can only call plot_predictions with data object from do-mpc optimizer
  • Exception – Cannot plot predictions if full solution is not stored or supplied when calling the method
  • assertion – t_ind argument must be a int
  • assertion – t_ind argument must not exceed the length of the results


This page is auto-generated. Page source is not available on Github.