virtualmodelcontrol.sim.run¶
-
run(plant, controller, clock, T, guard=
None, z0=None, record=(), window=None)¶ Run
controlleronplantforT[s]; returns the recorded run.Each step reads the plant, asks the controller for a command (zero torque if the guard trips), writes it, then advances a simulated plant by
clock.dtor, with aWallClock, waits for the next step. On real time,T=Noneruns until Ctrl-C, and Ctrl-C ends the run with the log so far, after the step that is running.z0sets the controller’s initial virtual state, or is a function of the first reading that returns it. The log holds, at every step, the measurements, the command (and the law’s torque before any output stage), the virtual statezwhen the controller has one, and whatrecordasks for (seeRECORDS); a value the step did not compute is NaN. Itsmetaholds the Params at the start and the plant’s hardware profile. On real time,window[s] keeps only the last seconds of a run that goes on for hours (up to a quarter more, until the next trim);info["steps"]still counts them all.