get_y_template¶
Class method.
-
do_mpc.estimator.MHE.get_y_template(self)¶ Obtain output template for
set_y_fun().Use this structure as the return of a user defined parameter function (
y_fun) that is called at each MHE step. Pass this function to the MHE by callingset_y_fun().The structure carries a set of measurements for each time step of the horizon and can be accessed as follows:
y_template['y_meas', k, 'meas_name'] # Slicing is possible, e.g.: y_template['y_meas', :, 'meas_name']
where
kruns from0toN_horizonandmeas_namerefers to the user-defined names indo_mpc.model.Model.Note
The structure is ordered, sucht that
k=0is the “oldest measurement” andk=N_horizonis the newest measurement.By default, the following measurement function is choosen:
y_template = self.get_y_template() def y_fun(t_now): n_steps = min(self.data._y.shape[0], self.n_horizon) for k in range(-n_steps,0): y_template['y_meas',k] = self.data._y[k] try: for k in range(self.n_horizon-n_steps): y_template['y_meas',k] = self.data._y[-n_steps] except: None return y_template
Which simply reads the last results from the
MHE.dataobject.Returns: y_template Return type: struct_symSX
This page is auto-generated. Page source is not available on Github.