Class method.


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 calling set_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 k runs from 0 to N_horizon and meas_name refers to the user-defined names in do_mpc.model.Model.


The structure is ordered, sucht that k=0 is the “oldest measurement” and k=N_horizon is 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([0], self.n_horizon)
    for k in range(-n_steps,0):
        y_template['y_meas',k] =[k]
        for k in range(self.n_horizon-n_steps):
            y_template['y_meas',k] =[-n_steps]
    return y_template

Which simply reads the last results from the object.

Return type:struct_symSX

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