Method of continuousTimeMdss.
Solve the algebraic mode problem of a hybrid mdss model at a fixed state
and input.
Source:
src/simulator/@continuousTimeMdss/solveStepBruteForce.m
At fixed state and input , find the state derivatives , algebraic signals and binaries that satisfy
where is the parameter-matrix split.
has one entry per monomial (one per column of the structure matrix). Each entry is a product of one factor per signal:
so the residual is just a weighted sum of those monomials. The solver never forms from scratch — it starts at and, each time one signal’s value becomes known, multiplies that signal’s factor into every column at once (the is elementwise over the columns):
For a single column, the entries say how signal enters that monomial, and the factor collapses to:
| structure entry in that column | meaning | factor value |
|---|---|---|
| (true) | signal appears as | |
| (false) | signal appears as its complement | |
| signal absent from this monomial | (column unchanged) | |
| (continuous) | scaled/normalized entry |
So substituting a value only touches the columns where that signal is present; absent columns are multiplied by and stay as they are.
Example. Take two states and a monomial (both appear as true). Its column starts at . Folding in multiplies it by ; folding in multiplies it by ; the column now equals . A different column that does not contain is multiplied by when is substituted and is left untouched. Once every signal has been folded in, each holds the numeric value of its monomial.
The known and are folded into first. The routine then walks the solving order. Each row is one of three cases.
Explicit continuous unknown ( or ): its equation is affine in that single unknown, , so
and is folded into .
Explicit binary : evaluate its equation value at the previous value and flip on a positive value,
Coupled subproblem: delegated to solveSubProblemVariableZ,
which enumerates the block’s binaries while solving its continuous
unknowns.
After the whole order is processed, and are returned.
[xp, y, z, F, G] = solveStepBruteForce(sys, x0, u, solvingOrder, yguess, xpguess, zguess)
— returns the state-derivative row xp
(),
algebraic row y, binary row z, and the
equality/inequality function-value rows F,
G.
continuousTimeMdss
· solveSubProblemVariableZ
· eventTotalDerivative
· msim
MyToolbox Documentation | Generated automatically by CI/CD pipeline