Functions: SimModel Internals
State-Space Functions
ModelPredictiveControl.f!
— Functionf!(x0next, _ , model::LinModel, x0, u0, d0, _ ) -> nothing
Evaluate x0next = A*x0 + Bu*u0 + Bd*d0
in-place when model
is a LinModel
.
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
.
ModelPredictiveControl.h!
— Functionh!(y0, model::LinModel, x0, d0, _ ) -> nothing
Evaluate y0 = C*x0 + Dd*d0
in-place when model
is a LinModel
.
h!(y0, model::NonLinModel, x0, d0, p)
Call model.solver_h!(y0, x0, d0, p)
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
.