Functions: SimModel Internals
State-Space Functions
ModelPredictiveControl.f! — Functionf!(xnext0, model::LinModel, x0, u0, d0) -> nothingEvaluate xnext0 = A*x0 + Bu*u0 + Bd*d0 in-place when model is a LinModel.
Call f!(xnext0, x0, u0, d0) with model.f! method for NonLinModel.
ModelPredictiveControl.h! — Functionh!(y0, model::LinModel, x0, d0) -> nothingEvaluate y0 = C*x0 + Dd*d0 in-place when model is a LinModel.
Call h!(y0, x0, d0) with model.h method for NonLinModel.
Steady-State Calculation
ModelPredictiveControl.steadystate! — Functionsteadystate!(model::LinModel, u0, d0)Set model.x0 to u0 and d0 steady-state if model is a LinModel.
Following setop! notation, the method evaluates the equilibrium from:
\[ \mathbf{x_0} = \mathbf{(I - A)^{-1}(B_u u_0 + B_d d_0 + f_{op} - x_{op})}\]
with constant manipulated inputs $\mathbf{u_0 = u - u_{op}}$ and measured disturbances $\mathbf{d_0 = d - d_{op}}$. The Moore-Penrose pseudo-inverse computes $\mathbf{(I - A)^{-1}}$ to support integrating model (integrator states will be 0).
Do nothing if model is a NonLinModel.