prediction¶
Class method.
-
do_mpc.data.MPCData.prediction(self, ind, t_ind=-1)¶ Query the MPC trajectories. Use this method to obtain specific MPC trajectories from the data object.
Warning
This method requires that the optimal solution is stored in the
do_mpc.data.MPCDatainstance. Storing the optimal solution must be activated withdo_mpc.controller.MPC.set_param().Querying predicted trajectories requires the use of power indices, which is passed as tuple e.g.:
data.prediction((var_type, var_name, i), t_ind)
where
var_typerefers to_x,_u,_z,_tvp,_p,_auxvar_namerefers to the user-defined names in thedo_mpc.model.Model- Use
ito index vector valued variables.
The method returns a multidimensional numpy.ndarray. The dimensions refer to:
arr = data.prediction(('_x', 'x_1')) arr.shape >> (n_size, n_horizon, n_scenario)
with:
n_sizedenoting the number of elements inx_1, wheren_size = 1is a scalar variable.n_horizonis the MPC horizon defined withdo_mpc.controller.MPC.set_param()n_scenariorefers to the number of uncertain scenarios (for robust MPC).
Additional to the power index tuple, a time index (
t_ind) can be passed to access the prediction for a certain time.Parameters: ind (tuple) – Power index to query the prediction of a specific variable. Returns: Predicted trajectories for the queries variable. Return type: numpy.ndarray
This page is auto-generated. Page source is not available on Github.