discreteSimulation

Method of discreteTimeMdss.

March a discrete-time mdss model forward one sample at a time.

Source: src/simulator/@discreteTimeMdss/discreteSimulation.m

What is solved

At sample kk, given the current state xkx_k, solve the implicit multilinear map for the successor state and the algebraic/binary signals:

Φeqm(xk+1,xk,uk,yk,zk)=0,Φineqm(xk+1,xk,uk,yk,zk)0, \Phi_{\mathrm{eq}}\, m(x_{k+1}, x_k, u_k, y_k, z_k) = 0, \qquad \Phi_{\mathrm{ineq}}\, m(x_{k+1}, x_k, u_k, y_k, z_k) \le 0,

where Φ=Φc+Φ+1Φ1\Phi=\Phi_c+\Phi_{+1}-\Phi_{-1} and mm is the norm-1 monomial vector. For a discrete mdss the “state-delta” row holds the successor state xk+1x_{k+1}, so the per-sample unknowns are (xk+1,yk,zk)(x_{k+1}, y_k, z_k). Each sample is solved with solveStepBruteForce.

The discretizationType selects which input drives the step:

Retry and stopping

If a step returns NaN or violates the residual tolerances (|F||F|, GG), it is retried once with an alternative algebraic guess and the smaller-residual result is kept:

keep the retry if FnewF and Gnew+G+. \text{keep the retry if } \|F_{\text{new}}\| \le \|F\| \text{ and } \|G_{\text{new}}^{+}\| \le \|G^{+}\| .

If no feasible solution is found the march stops, the remaining trajectory is filled with NaN, and a warning is issued. Results are assembled into sim.variableTrajectory =[x,y,z]=[x,\,y,\,z] with sim.time and sim.eventTime set to the sample times.

Input arguments

Argument Description
sim The discreteTimeMdss object, with the model, initial state, input trajectory and solver options set.

Output arguments

Output Description
sim The same object with time, variableTrajectory and eventTime filled in.

See also

discreteTimeMdss · solveStepBruteForce · determineParallizedSolvingOrder · msim


MyToolbox Documentation | Generated automatically by CI/CD pipeline