Simulator¶
-
class
do_mpc.simulator.Simulator(model)[source]¶ A class for simulating systems. Discrete-time and continuous systems can be considered.
do-mpc uses the CasADi interface to popular state-of-the-art tools such as Sundials CVODES for the integration of ODE/DAE equations.
Configuration and setup:
Configuring and setting up the simulator involves the following steps:
- Set parameters with
set_param(), e.g. the sampling time. - Set parameter function with
get_p_template()andset_p_fun(). - Set time-varying parameter function with
get_tvp_template()andset_tvp_fun(). - Setup simulator with
setup().
During runtime, call the simulator
make_step()method with current input (u). This computes the next state of the system and the respective measurement. Optionally, pass (sampled) random variables for the processwand measurement noisev(if they were defined in :py:class`do_mpc.model.Model`)Attributes
Simulator.t0Current time marker of the class. Simulator.u0Initial input and current iterate. Simulator.x0Initial state and current iterate. Simulator.z0Initial algebraic state and current iterate. Methods
Simulator.get_p_templateObtain output template for set_p_fun().Simulator.get_tvp_templateObtain the output template for set_tvp_fun().Simulator.make_stepMain method of the simulator class during control runtime. Simulator.reset_historyReset the history of the simulator. Simulator.set_initial_guessInitial guess for DAE variables. Simulator.set_p_funMethod to set the function which gives the values of the parameters. Simulator.set_paramSet the parameters for the simulator. Simulator.set_tvp_funMethod to set the function which returns the values of the time-varying parameters. Simulator.setupSets up the simulator and finalizes the simulator configuration. Simulator.simulateCall the CasADi simulator. - Set parameters with
This page is auto-generated. Page source is not available on Github.