From 30fad492fc08ec340cfcffdf89b6343bdebb402e Mon Sep 17 00:00:00 2001 From: franckgaga Date: Mon, 3 Aug 2026 11:21:20 -0400 Subject: [PATCH 1/3] doc: MHE data windows in "Internals -> State Estimators" --- docs/src/internals/state_estim.md | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/src/internals/state_estim.md b/docs/src/internals/state_estim.md index 49785fe43..a420b96df 100644 --- a/docs/src/internals/state_estim.md +++ b/docs/src/internals/state_estim.md @@ -4,6 +4,44 @@ Pages = ["state_estim.md"] ``` +Similarly to [Function: Predictive Controllers](@ref func_predictive_control) page, the +various data windows of the [`MovingHorizonEstimator`](@ref) are explicitly defined here +as a preamble, to help the development of its internals. Note that they are not needed for +the other [`StateEstimator`](@ref) types. + +At the ``k``th control period, the vectors that encompass the historical deviation values of +the manipulated input ``\mathbf{u_0}``, estimated state ``\mathbf{x̂_0}`` and measured +output ``\mathbf{y_0^m}`` over the window length ``N_k`` are: + +```math + \mathbf{U_0} = \begin{bmatrix} + \mathbf{u_0}(k-N_k+p+0) \\ \mathbf{u_0}(k-N_k+p+1) \\ \vdots \\ \mathbf{u_0}(k+p-1) + \end{bmatrix} \: , \quad + \mathbf{X̂_0} = \begin{bmatrix} + \mathbf{x̂_0}(k-N_k+p+1) \\ \mathbf{x̂_0}(k-N_k+p+2) \\ \vdots \\ \mathbf{x̂_0}(k+p) + \end{bmatrix} \: , \quad + \mathbf{Y_0^m} = \begin{bmatrix} + \mathbf{y_0^m}(k-N_k+1) \\ \mathbf{y_0^m}(k-N_k+1) \\ \vdots \\ \mathbf{y_0^m}(k-N_k+1) + \end{bmatrix} \quad \text{and} \quad +``` + +in which ``\mathbf{U_0}``, ``\mathbf{X̂_0}`` and ``\mathbf{Y_0^m}`` are vectors of `nu*Nk`, +`nx̂*Nk` and `nym*Nk` elements, respectively. Notice that ``\mathbf{U_0}`` and +``\mathbf{X̂_0}`` vectors are always shifted by one time step. Additionally, ``\mathbf{U_0}`` +and ``\mathbf{Y_0^m}`` are aligned only if ``p=1`` (`direct=false`). Lastly it is worth +noting that the arrival state estimate ``\mathbf{x̂_0}(k-N_k+p)`` is left out of the +``\mathbf{X̂_0}`` vector. The historical deviation values of the measured disturbances +``\mathbf{d_0}`` always includes one additional data point compared to the other windows: + +```math + \mathbf{D_0} = \begin{bmatrix} + \mathbf{d_0}(k-N_k+0) \\ \mathbf{d_0}(k-N_k+1) \\ \vdots \\ \mathbf{d_0}(k) + \end{bmatrix} +``` + +See the Extended Help of the [`MovingHorizonEstimator`](@ref) for the definition of the +with the estimated process noises ``Ŵ`` and sensor noises ``V̂`` windows. + ## Estimator Construction ```@docs From 170bbd70fb8dddeaa355e669e87e70fabf8a4b70 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Mon, 3 Aug 2026 11:36:32 -0400 Subject: [PATCH 2/3] doc: correct mistakes --- docs/src/internals/state_estim.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/internals/state_estim.md b/docs/src/internals/state_estim.md index a420b96df..dbc6b2176 100644 --- a/docs/src/internals/state_estim.md +++ b/docs/src/internals/state_estim.md @@ -6,7 +6,7 @@ Pages = ["state_estim.md"] Similarly to [Function: Predictive Controllers](@ref func_predictive_control) page, the various data windows of the [`MovingHorizonEstimator`](@ref) are explicitly defined here -as a preamble, to help the development of its internals. Note that they are not needed for +as a preamble, to help the development of its internals. Note that they are not needed for the other [`StateEstimator`](@ref) types. At the ``k``th control period, the vectors that encompass the historical deviation values of @@ -19,10 +19,10 @@ output ``\mathbf{y_0^m}`` over the window length ``N_k`` are: \end{bmatrix} \: , \quad \mathbf{X̂_0} = \begin{bmatrix} \mathbf{x̂_0}(k-N_k+p+1) \\ \mathbf{x̂_0}(k-N_k+p+2) \\ \vdots \\ \mathbf{x̂_0}(k+p) - \end{bmatrix} \: , \quad + \end{bmatrix} \quad \text{and} \quad \mathbf{Y_0^m} = \begin{bmatrix} \mathbf{y_0^m}(k-N_k+1) \\ \mathbf{y_0^m}(k-N_k+1) \\ \vdots \\ \mathbf{y_0^m}(k-N_k+1) - \end{bmatrix} \quad \text{and} \quad + \end{bmatrix} ``` in which ``\mathbf{U_0}``, ``\mathbf{X̂_0}`` and ``\mathbf{Y_0^m}`` are vectors of `nu*Nk`, @@ -30,8 +30,8 @@ in which ``\mathbf{U_0}``, ``\mathbf{X̂_0}`` and ``\mathbf{Y_0^m}`` are vector ``\mathbf{X̂_0}`` vectors are always shifted by one time step. Additionally, ``\mathbf{U_0}`` and ``\mathbf{Y_0^m}`` are aligned only if ``p=1`` (`direct=false`). Lastly it is worth noting that the arrival state estimate ``\mathbf{x̂_0}(k-N_k+p)`` is left out of the -``\mathbf{X̂_0}`` vector. The historical deviation values of the measured disturbances -``\mathbf{d_0}`` always includes one additional data point compared to the other windows: +``\mathbf{X̂_0}`` vector. The historical deviation values of the measured disturbance +``\mathbf{d_0}`` always include one additional data point compared to the other windows: ```math \mathbf{D_0} = \begin{bmatrix} @@ -40,7 +40,7 @@ noting that the arrival state estimate ``\mathbf{x̂_0}(k-N_k+p)`` is left out o ``` See the Extended Help of the [`MovingHorizonEstimator`](@ref) for the definition of the -with the estimated process noises ``Ŵ`` and sensor noises ``V̂`` windows. +with the estimated process noises ``\mathbf{Ŵ}`` and sensor noises ``\mathbf{V̂}`` windows. ## Estimator Construction From a221d3e6d7652e608f0bd39ba139225086456d1b Mon Sep 17 00:00:00 2001 From: franckgaga Date: Mon, 3 Aug 2026 12:14:40 -0400 Subject: [PATCH 3/3] doc: correct mistakes --- docs/src/internals/state_estim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/internals/state_estim.md b/docs/src/internals/state_estim.md index dbc6b2176..43a7f2c73 100644 --- a/docs/src/internals/state_estim.md +++ b/docs/src/internals/state_estim.md @@ -21,7 +21,7 @@ output ``\mathbf{y_0^m}`` over the window length ``N_k`` are: \mathbf{x̂_0}(k-N_k+p+1) \\ \mathbf{x̂_0}(k-N_k+p+2) \\ \vdots \\ \mathbf{x̂_0}(k+p) \end{bmatrix} \quad \text{and} \quad \mathbf{Y_0^m} = \begin{bmatrix} - \mathbf{y_0^m}(k-N_k+1) \\ \mathbf{y_0^m}(k-N_k+1) \\ \vdots \\ \mathbf{y_0^m}(k-N_k+1) + \mathbf{y_0^m}(k-N_k+1) \\ \mathbf{y_0^m}(k-N_k+2) \\ \vdots \\ \mathbf{y_0^m}(k) \end{bmatrix} ```