Method of continuousTimeMdss.
Resolve the mode switch and consistent slopes of a hybrid implicit multilinear IVP at an event.
Source:
src/simulator/@continuousTimeMdss/eventTotalDerivative.m
At a single time
,
produce a consistent post-event point of a hybrid mdss model: the state
derivative
,
algebraic signals
,
binaries
,
algebraic slopes
,
and the equality / inequality function values
,
.
(finite difference against the nearest input sample ).
The solving
order is walked building the norm-1 monomial vector
.
Subproblems before the event are solved with the binaries fixed (solveSubProblemFixZ);
explicit continuous variables use the affine closed form
(see solveStepBruteForce).
When an event index ie is given, the binaries of the
event’s subproblem are enumerated over all
combinations, ordered by descending Hamming distance to
the previous
(largest mode change first), and each is propagated through the
following subproblems.
From the equality Jacobian , the state second derivative and algebraic slope follow from differentiating along the trajectory:
A candidate mode is accepted only if it is feasible and every active inequality is being crossed inward — its total time derivative is non-increasing:
A binary belonging to the enumerated set keeps its enumerated value
rather than being re-derived from
— that re-derivation is degenerate at a coincident crossing (its
switching surface sits at
)
and would otherwise pin the bit to its previous value. If no candidate
passes both tests, the outputs are returned as NaN.
| Argument | Description |
|---|---|
sys |
The continuousTimeMdss simulation object (carries the
mdss model). |
ie |
Triggering inequality (event) index; empty for a pure consistent-slope solve. |
t0 |
Event time. |
x0 |
Current state values. |
y0 |
Current algebraic-signal values. |
z0 |
Current binary-signal values. |
u |
Input trajectory, one row per input-time sample, one column per input. |
ut |
Time samples of the input trajectory. |
solvingOrder |
The block solving order
[varIdx, eqIdx, type, subset, subproblem]. |
opt |
Solver options. |
| Output | Description |
|---|---|
xp1 |
Post-event state derivative . |
y1 |
Post-event algebraic signals. |
z1 |
Post-event binary signals. |
dy1 |
Post-event algebraic slopes . |
F |
Equality function values. |
G |
Inequality function values. |
continuousTimeMdss
· continuousSimTotalDerivative
· solveSubProblemFixZ
· jacobian · msim
MyToolbox Documentation | Generated automatically by CI/CD pipeline