init_predmat(estim, ::LinModel, Hp, Hc) -> E, G, J, K, V, ex̂, fx̂, gx̂, jx̂, kx̂, vx̂
Construct the prediction matrices for LinModel
model
.
The linear model predictions are evaluated by :
\[\begin{aligned}
+ \mathbf{Ŷ} &= \mathbf{E ΔU} + \mathbf{G d}(k) + \mathbf{J D̂}
+ + \mathbf{K x̂}_{k-1}(k) + \mathbf{V u}(k-1) \\
&= \mathbf{E ΔU} + \mathbf{F}
-\end{aligned}\]
where predicted outputs $\mathbf{Ŷ}$, stochastic outputs $\mathbf{Ŷ_s}$, and measured disturbances $\mathbf{D̂}$ are from $k + 1$ to $k + H_p$. Input increments $\mathbf{ΔU}$ are from $k$ to $k + H_c - 1$. The vector $\mathbf{x̂}_{k-1}(k)$ is the state estimated at the last control period. Operating points on $\mathbf{u}$, $\mathbf{d}$ and $\mathbf{y}$ are omitted in above equations.
Extended Help
Using the augmented matrices $\mathbf{Â, B̂_u, Ĉ, B̂_d, D̂_d}$ in estim
and the equation $\mathbf{W}_j = \mathbf{Ĉ} ( ∑_{i=0}^j \mathbf{Â}^i ) \mathbf{B̂_u}$, the prediction matrices are computed by :
\[\begin{aligned}
+\end{aligned}\]
where predicted outputs $\mathbf{Ŷ}$, stochastic outputs $\mathbf{Ŷ_s}$, and measured disturbances $\mathbf{D̂}$ are from $k + 1$ to $k + H_p$. Input increments $\mathbf{ΔU}$ are from $k$ to $k + H_c - 1$. The vector $\mathbf{x̂}_{k-1}(k)$ is the state estimated at the last control period. The method also computes similar matrices but for the terminal constraints applied on the states at the end of the horizon $H_p$:
\[\begin{aligned}
+ \mathbf{x̂}_{k-1}(k+H_p)
+ &= \mathbf{e_x̂ ΔU} + \mathbf{g_x̂ d}(k) + \mathbf{j_x̂ D̂}
+ + \mathbf{k_x̂ x̂}_{k-1}(k) + \mathbf{v_x̂ u}(k-1) \\
+ &= \mathbf{e_x̂ ΔU} + \mathbf{f_x̂}
+\end{aligned}\]
Operating points on $\mathbf{u}$, $\mathbf{d}$ and $\mathbf{y}$ are omitted in above equations.
Extended Help
Using the augmented matrices $\mathbf{Â, B̂_u, Ĉ, B̂_d, D̂_d}$ in estim
and the function $\mathbf{W}(j) = \mathbf{Ĉ} ( ∑_{i=0}^j \mathbf{Â}^i ) \mathbf{B̂_u}$, the prediction matrices are computed by :
\[\begin{aligned}
\mathbf{E} &= \begin{bmatrix}
-\mathbf{W}_{0} & \mathbf{0} & \cdots & \mathbf{0} \\
-\mathbf{W}_{1} & \mathbf{W}_{0} & \cdots & \mathbf{0} \\
-\vdots & \vdots & \ddots & \vdots \\
-\mathbf{W}_{H_p-1} & \mathbf{W}_{H_p-2} & \cdots & \mathbf{W}_{H_p-H_c+1}
-\end{bmatrix}
-\\
+ \mathbf{W}(0) & \mathbf{0} & \cdots & \mathbf{0} \\
+ \mathbf{W}(1) & \mathbf{W}(0) & \cdots & \mathbf{0} \\
+ \vdots & \vdots & \ddots & \vdots \\
+ \mathbf{W}(H_p-1) & \mathbf{W}(H_p-2) & \cdots & \mathbf{W}(H_p-H_c+1) \end{bmatrix} \\
\mathbf{G} &= \begin{bmatrix}
-\mathbf{Ĉ}\mathbf{Â}^{0} \mathbf{B̂_d} \\
-\mathbf{Ĉ}\mathbf{Â}^{1} \mathbf{B̂_d} \\
-\vdots \\
-\mathbf{Ĉ}\mathbf{Â}^{H_p-1} \mathbf{B̂_d}
-\end{bmatrix}
-\\
+ \mathbf{Ĉ}\mathbf{Â}^{0} \mathbf{B̂_d} \\
+ \mathbf{Ĉ}\mathbf{Â}^{1} \mathbf{B̂_d} \\
+ \vdots \\
+ \mathbf{Ĉ}\mathbf{Â}^{H_p-1} \mathbf{B̂_d} \end{bmatrix} \\
\mathbf{J} &= \begin{bmatrix}
-\mathbf{D̂_d} & \mathbf{0} & \cdots & \mathbf{0} \\
-\mathbf{Ĉ}\mathbf{Â}^{0} \mathbf{B̂_d} & \mathbf{D̂_d} & \cdots & \mathbf{0} \\
-\vdots & \vdots & \ddots & \vdots \\
-\mathbf{Ĉ}\mathbf{Â}^{H_p-2} \mathbf{B̂_d} & \mathbf{Ĉ}\mathbf{Â}^{H_p-3} \mathbf{B̂_d} & \cdots & \mathbf{D̂_d}
-\end{bmatrix}
-\\
+ \mathbf{D̂_d} & \mathbf{0} & \cdots & \mathbf{0} \\
+ \mathbf{Ĉ}\mathbf{Â}^{0} \mathbf{B̂_d} & \mathbf{D̂_d} & \cdots & \mathbf{0} \\
+ \vdots & \vdots & \ddots & \vdots \\
+ \mathbf{Ĉ}\mathbf{Â}^{H_p-2} \mathbf{B̂_d} & \mathbf{Ĉ}\mathbf{Â}^{H_p-3} \mathbf{B̂_d} & \cdots & \mathbf{D̂_d} \end{bmatrix} \\
\mathbf{K} &= \begin{bmatrix}
-\mathbf{Ĉ}\mathbf{Â}^{1} \\
-\mathbf{Ĉ}\mathbf{Â}^{2} \\
-\vdots \\
-\mathbf{Ĉ}\mathbf{Â}^{H_p}
-\end{bmatrix}
-\\
-\mathbf{Q} &= \begin{bmatrix}
-\mathbf{W}_0 \\
-\mathbf{W}_1 \\
-\vdots \\
-\mathbf{W}_{H_p-1}
-\end{bmatrix}
-\end{aligned}\]