Method of discreteTimeMss.
Do a discrete-time mss
model forward sample by sample.
Source: src/simulator/@discreteTimeMss/simulate.m
An mss state equation is explicit, so a sample is a
single evaluation:
with
and
the norm-1 monomial vector over
.
The horizon is
numel(inputTime); input row
drives the step to sample
,
so the last input row is never used. On return sim.time is
inputTime unchanged and sim.variableTrajectory
is the nState×N state trajectory (states in
rows).
For a CPNTensor
model the state-equation block is compiled once with
CPNTensor.prepareForMTISIM and the entire
horizon runs inside one MTISIM call in its
multi-step mode, which feeds
back as the state block of
without returning to MATLAB between samples.
That kernel mode requires the positional
[states; inputs] variable layout — states first, inputs
after — so the structure matrices are indexed with
and this method is where that reorder belongs. For a model already in
[x; u] layout rowOrder is the identity, but
indexing a sparse matrix with it would still rebuild all three structure
matrices nonzero by nonzero: MATLAB’s compressed-sparse-column storage
keeps each column’s row indices ascending, so rows cannot be permuted in
place, whereas a plain column slice is a contiguous copy. A triviality
check (strictly ascending, first == 1, last
== numel) proves the permutation is the identity, so the
row indexing is skipped and the plain column slice is taken instead.
Any other mtiTensor is marched in
a MATLAB loop, one call to computeFunctionValueMss
per sample, using the same forward convention.
discreteTimeMss
· functionValue ·
msim · discreteSimulation
MyToolbox Documentation | Generated automatically by CI/CD pipeline