simulate

Method of continuousTimeMss.

Integrate a continuous-time mss model as an explicit ODE.

Source: src/simulator/@continuousTimeMss/simulate.m

What is solved

An mss state equation is explicit, so the initial value problem is the plain ODE

ẋ=f(x,u(t))=ΦFm(x,u(t)),x(t0)=x0, \dot x = f\big(x, u(t)\big) = \Phi_F\, m\big(x, u(t)\big), \qquad x(t_0) = x_0,

integrated over [inputTime(1), inputTime(end)] with the MATLAB ode object. The solver is taken from sim.solverType, the option struct is merged in by applySolverOptions, and solve produces the trajectory that is written to sim.time and sim.variableTrajectory (states in rows, time points in columns).

The inputs are not part of the state: u(t)u(t) is reconstructed from inputTime/inputTrajectory by linear interpolation with linear extrapolation outside the sampled range, so the solver may step anywhere inside the span.

Jacobian gating

Explicit Runge–Kutta solvers never evaluate a Jacobian, so the Jacobian handle is attached based on the solver, not the model class.

For

ode45, ode23, ode78, ode89, ode113

no Jacobian is passed to ode; every other solver (ode15s, ode23t, …) receives the analytic

fx=[Jf,xJf,u]|state columns, \frac{\partial f}{\partial x} = \big[\, J_{f,x}\ \ J_{f,u} \,\big] \Big|_{\text{state columns}},

i.e. the full signal Jacobian restricted to the state columns, since the solver differentiates with respect to xx only.

CPN evaluation path

For a CPNTensor everything that does not depend on (t,x)(t,x) is hoisted out of the callbacks:

Generic tensor path

Any other mtiTensor is evaluated through the model itself: functionValue supplies ẋ\dot x and stateJacobian supplies the Jacobian, whose first nState columns are handed to the solver. The inputs are interpolated with interp1(..., 'linear', 'extrap').

See also

continuousTimeMss · applySolverOptions · functionValue · stateJacobian · msim


MyToolbox Documentation | Generated automatically by CI/CD pipeline