Method of continuousTimeMdss.
Solve the hybrid continuous-time IVP with event detection and mode switching.
Source:
src/simulator/@continuousTimeMdss/continuousSimTotalDerivative.m
Integrate the equality differential-algebraic block with the binaries held fixed, and re-solve the binary mode whenever an inequality switching surface is crossed.
On each segment the equality block
is integrated with ode15i (fully implicit, solver state
,
analytic Jacobian evaluated on a pre-sliced equality sub-tensor). The
event function is the inequality function
with an ascending, stop-on-event zero crossing.
The step is re-evaluated with solveStepBruteForce
to pick the new binary vector, and eventTotalDerivative
produces the consistent restart
;
the updated
seeds the next segment. The loop guards against the time budget
MaxTime, an event with no feasible discrete solution, and
Zeno behaviour (an event at the segment start).
The initial consistent slope
and a feasible initial
come from eventTotalDerivative,
retried with a different algebraic guess if the first violates equality
feasibility
(
InequalityZeroTolerance) or inequality positivity
(
InequalityPositivityTolerance). Segments are concatenated,
the binary signal is resampled onto the full time grid, and the results
are stored in sim.time, sim.variableTrajectory
and sim.eventTime.
A one-off pre-compute collapses the three-way structure/parameter
split and slices each equation block to the monomial columns it uses, so
the ODE right-hand side, event function and Jacobian evaluate only those
columns (via MTISIM in pass-through mode).
| Argument | Description |
|---|---|
sim |
The continuousTimeMdss object, with the model, initial
state, input trajectory and solver options set. |
| Output | Description |
|---|---|
sim |
The same object with time,
variableTrajectory ([x, y, z]) and
eventTime filled in. |
continuousTimeMdss
· eventTotalDerivative
· solveStepBruteForce
· determineParallizedSolvingOrder
· msim
MyToolbox Documentation | Generated automatically by CI/CD pipeline