Method of mss.
Collapse duplicate and unused monomial columns.
Source: src/model/@mss/trivialReduction.m
sys = trivialReduction(sys)trivialReduction simplifies the CPN representation of an
mss model without changing
the function it represents. It removes the redundancy that appears when
models are built up mechanically — c2d, d2c and ss2mss call it on
their result — in two steps, both acting on the monomial
columns:
structureMatrixTrue, structureMatrixFalse,
structureMatrixContinuous) are stacked into one
matrix and compared column-wise. Columns with identical variable support
are kept once, and the parameter-matrix coefficients of the merged
columns are summed, so the represented function is unchanged.Internally the three parameter components are combined into one
signed matrix
for the comparison, and split back afterwards: entries exactly
go to parameterMatrixOne, exactly
to parameterMatrixMinusOne, and everything else non-zero to
parameterMatrixContinuous. The tensor rank is then
refreshed via updateRank and
columnIndexStateEq / columnIndexOutputEq are
recomputed from the new parameter matrix. If anything was removed, a
line reporting the number of duplicate and unused columns is
printed.
Equation rows are never removed. In an explicit
mss the row count is the model dimension — one row
per state equation, one per output — so dropping rows would break the
model rather than simplify it. All of the following are legitimate and
keep their row:
| Model | Why row removal would break it |
|---|---|
| (constant state) | An all-zero row is still that state’s equation. |
| Two states with identical dynamics | Collapsing them leaves fewer state equations than states. |
y1 = y2 = x1 |
Collapsing them leaves nOutput larger than
outputEquationIndex. |
| An output equal to a state equation | y = f(x) is a normal explicit model. |
Rows are only reordered, into
[state equations; output equations], with
stateEquationIndex and outputEquationIndex
rebuilt sequentially to match — so nState and
nOutput stay valid across a call, and the result is checked
with checkIndexDimensions
before it is returned. Do not hold copies of the index vectors across a
call, since the numbering changes.
The method assumes a CPNTensor; it reads
the structure and parameter matrices directly and has no tensor-train
path.
The mdss version of
this method does collapse duplicate equation rows. That is
correct there, where the two blocks are equalities and inequalities and
a redundant constraint carries no dimension, but it is not transferable
to an explicit model.
| Argument | Description |
|---|---|
sys |
The mss model to reduce. |
| Output | Description |
|---|---|
sys |
The reduced model, functionally equivalent to the input. |
sysc = rmss(3,1,1,4);
sysd = c2d(sysc, 0.01); % appends one monomial column per state
sysd = trivialReduction(sysd);
% e.g. "Reduced by 2 duplicate column(s) and 0 unused column(s)."mss · c2d · d2c · trivialReduction
MyToolbox Documentation | Generated automatically by CI/CD pipeline