solveStepBruteForce

Method of discreteTimeMdss.

Solve one time step of a discrete-time mdss model.

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

What is solved

At fixed current state x0=xkx_0=x_k and input uu, find the successor state ẋxk+1\dot x \equiv x_{k+1}, the algebraic signals yy and the binaries zz that satisfy

F=Φeqm(xk+1,x0,u,y,z)=0,G=Φineqm(xk+1,x0,u,y,z)0, F = \Phi_{\mathrm{eq}}\, m(x_{k+1}, x_0, u, y, z) = 0, \qquad G = \Phi_{\mathrm{ineq}}\, m(x_{k+1}, x_0, u, y, z) \le 0 ,

with Φ=Φc+Φ+1Φ1\Phi=\Phi_c+\Phi_{+1}-\Phi_{-1} and mRm\in\mathbb R^{R} the norm-1 monomial vector. Substituting a value vv for the signal in structure-matrix row nn (row vectors tn,fn,cnt_n,f_n,c_n) updates mm multiplicatively:

mm(1+tnfn+tn(v1)fnv)(1|cn|+cnv). m \;\leftarrow\; m \odot \big(1 + t_n f_n + t_n(v-1) - f_n v\big)\odot\big(1 - |c_n| + c_n v\big).

Algorithm

The known x0x_0 and uu are folded into mm, then the solving order is walked. Each row is one of three cases.

Explicit continuous unknown (xk+1,nx_{k+1,n} or yny_n): its equation ee is affine in that unknown, Fe=Av+BF_e = A\,v + B, so

v=BA,A=Φe[(tnfn+cn)m],B=Φe[(1|cn+tnfntn|)m]. v = -\frac{B}{A},\quad A=\Phi_e\!\left[(t_n-f_n+c_n)\odot m\right],\quad B=\Phi_e\!\left[\big(1-|c_n+t_nf_n-t_n|\big)\odot m\right].

Explicit binary znz_n: evaluate its equation value at the previous value zn0z_n^0 and flip on a positive value,

F0=Φem|zn=zn0,zn={zn0,sign(F0)0,¬zn0,otherwise. F_0 = \Phi_e\, m\big|_{z_n=z_n^0},\qquad z_n = \begin{cases} z_n^0, & \operatorname{sign}(F_0)\le 0,\\[2pt] \lnot\, z_n^0, & \text{otherwise.}\end{cases}

Coupled subproblem: delegated to solveSubProblemVariableZ.

Finally F=ΦeqmF=\Phi_{\mathrm{eq}}m and G=ΦineqmG=\Phi_{\mathrm{ineq}}m are returned. Called once per sample by discreteSimulation.

Inputs / outputs

[xp, y, z, F, G] = solveStepBruteForce(sys, x0, u, solvingOrder, yguess, xpguess, zguess) — returns the successor state xp (xk+1x_{k+1}), algebraic row y, binary row z, and the equality/inequality function-value rows F, G.

See also

discreteTimeMdss · solveSubProblemVariableZ · discreteSimulation · msim


MyToolbox Documentation | Generated automatically by CI/CD pipeline