Running Simulations
out = simulate(my_model, T = T_end)Mandatory Keyword Arguments:
Ttotal time of the simulation
Optional Keyword Arguments:
t0initial time, defaults to0//1ucinput function(t) -> ufor continuous-time models, defaults to(t) -> nothingudinput function(t) -> ufor discrete-time models, defaults to(t) -> nothingxc0initial state for continuous-time models, defaults tonothing. Overwrites the initial state given in the model definition.xd0initial state for discrete-time models, defaults tonothing. Overwrites the initial state given in the model definition.Δt_maxmaximum step size used for continuous-time integration, defaults to1//100integratorintegration method for continuous-time models, defaults toRK4. See the integrators overview for available methods.optionsaNamedTupleof additional simulation options, see below.
Options
Additional options can be passed as a NamedTuple to the options keyword argument.
out = simulate(my_model,
T = 20 // 1,
options = (
silent = true,
base_rng = Xoshiro,
)
)Available options:
Δt_defaultreplaces the default maximum step size for continuous-time integration. Should be rational. Defaults to1//100.Δt_minminimum step size for continuous-time integration. Especially relevant for adaptive step size integrators. Defaults to1//1_000_000.zero_crossing_tolabsolute tolerance for zero-crossing time detection. Defaults to1e-5.RKF45_rel_tolrelative tolerance between truncation error and 5th order estimate for theRKF45integrator. Defaults to1e-6.RKF45_abs_tolabsolute tolerance for the truncation error in theRKF45integrator. Defaults to1e-7.display_progressset tofalseto suppress progress output in the terminal. Defaults totrue.progress_spacingtime between progress updates in the terminal. Defaults to1//1.debugset totrueto print additional debug information. Defaults tofalse.silentset totrueto suppress all output including warnings and errors. Defaults tofalse.base_rngrandom number generator used for random draw functions. Defaults toMersenneTwister.out_streamIO stream used for console output. Defaults tostdout.