# make_step¶

Class method.

do_mpc.simulator.Simulator.make_step(self, u0, v0=None, w0=None)

Main method of the simulator class during control runtime. This method is called at each timestep and computes the next state or the current control input u0. The method returns the resulting measurement, as defined in do_mpc.model.Model.set_meas.

The initial state x0 is stored as a class attribute. Use this attribute x0 to change the initial state. It is also possible to supply an initial guess for the algebraic states through the attribute z0 and by calling set_initial_guess().

Finally, the method can be called with values for the process noise w0 and the measurement noise v0 that were (optionally) defined in the do_mpc.model.Model. Typically, these values should be sampled from a random distribution, e.g. np.random.randn for a random normal distribution.

The method prepares the simulator by setting the current parameters, calls simulator.simulate() and updates the do_mpc.data object.

Parameters: u0 (numpy.ndarray) – Current input to the system. v0 (numpy.ndarray (optional)) – Additive measurement noise w0 (numpy.ndarray (optional)) – Additive process noise y_next numpy.ndarray