# plot_predictions¶

Class method.

do_mpc.graphics.Graphics.plot_predictions(self, 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 do_mpc.data.MPCData object.

Warning

This method requires that the optimal solution is stored in the do_mpc.data.MPCData 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.

Parameters: 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 None
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.41097575426101685, "perplexity": 2048.764005624776}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703537796.45/warc/CC-MAIN-20210123094754-20210123124754-00479.warc.gz"}