Functions: SimModel Internals

State-Space Functions

ModelPredictiveControl.f!Function
f!(x0next, _ , model::LinModel, x0, u0, d0, _ ) -> nothing

Evaluate x0next = A*x0 + Bu*u0 + Bd*d0 in-place when model is a LinModel.

source
f!(x0next, k0, model::NonLinModel, x0, u0, d0, p)

Call model.solver_f!(x0next, k0, x0, u0, d0, p) for NonLinModel.

The method mutate x0next and k0 arguments in-place. The latter is used to store the intermediate stage values of model.solver DiffSolver.

source

Steady-State Calculation

ModelPredictiveControl.steadystate!Function
steadystate!(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).

source

Do nothing if model is a NonLinModel.

source