Method of continuousTimeMdss.
Solve one coupled subproblem for its continuous unknowns with the binaries held fixed.
Source:
src/simulator/@continuousTimeMdss/solveSubProblemFixZ.m
Given a coupled subproblem (a block of the solving order) and the binaries fixed at , solve for the block’s continuous unknowns from its equality rows
where
is the norm-1 monomial vector with the fixed
already folded in (substitution rule as in solveStepBruteForce).
Explicit (type = 1) rows never reach this function —
they are solved directly by solveStepBruteForce
while walking the solving order. This routine only handles
coupled subproblems, which are either linear
(type = -1) or nonlinear (type = 0), selected
by the block’s type flag.
Linear (type = -1):
is affine,
,
with
solved directly by (backslash).
Nonlinear (type = 0): solved with
lsqnonlin (Levenberg–Marquardt) on
with the analytic Jacobian from the product rule,
where is the derivative of the row- factor: from the continuous part plus from the true/false part.
Each solved is folded back into , and the subproblem function values (equality) and (inequality) are returned.
Used by eventTotalDerivative
for the subproblems that precede an event and for each fixed candidate
of the enumerated event subproblem.
| Argument | Description |
|---|---|
sys |
The continuousTimeMdss simulation object (carries the
mdss model and solver constants). |
solvingOrderSubProblem |
The solving-order rows of this block
[varIdx, eqIdx, type, subset, subproblem]. |
EqXUZ |
The running monomial vector , with all upstream blocks already folded in. |
xpInit |
Initial values / guess for the block’s state derivatives. |
yInit |
Initial values / guess for the block’s algebraic variables. |
y0 |
Algebraic seed used to start the nonlinear solve. |
zInit |
The (fixed) binary values for this block. |
| Output | Description |
|---|---|
xp |
Solved state derivatives. |
y |
Solved algebraic variables. |
G |
Inequality function values. |
F |
Equality function values. |
EqXUZ |
The monomial vector updated with the solved block. |
continuousTimeMdss
· solveSubProblemVariableZ
· eventTotalDerivative
· msim
MyToolbox Documentation | Generated automatically by CI/CD pipeline