Skip to content

Commit 29e6740

Browse files
committed
doc: idem
1 parent ce64a96 commit 29e6740

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

src/estimator/construct.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ end
236236
237237
Augment [`LinModel`](@ref) state-space matrices with stochastic ones `As`, `Cs_u`, `Cs_y`.
238238
239-
If ``\mathbf{x_0}`` are `model.x0` states, and ``\mathbf{x_s}``, the states defined at
240-
[`init_estimstoch`](@ref), we define an augmented state vector ``\mathbf{} =
239+
If ``\mathbf{x_0}`` is `model.x0` state, and ``\mathbf{x_s}``, the states defined at
240+
[`init_estimstoch`](@ref), we define an augmented state vector ``\mathbf{x̂_0} =
241241
[ \begin{smallmatrix} \mathbf{x_0} \\ \mathbf{x_s} \end{smallmatrix} ]``. The method
242242
returns the augmented matrices `Â`, `B̂u`, `Ĉ`, `B̂d` and `D̂d`:
243243
```math
@@ -253,9 +253,9 @@ See Extended Help for a detailed definition of the augmented matrices and vector
253253
254254
# Extended Help
255255
!!! details "Extended Help"
256-
Using the `As`, `Cs_u` and `Cs_y` matrices of the stochastic model provided in argument
257-
and the `model.A`, `model.Bu`, `model.Bd`, `model.C`, `model.Dd` matrices, the
258-
state-space matrices of the augmented model are defined as follows:
256+
Using the `As`, `Cs_u` and `Cs_y` matrices of the stochastic model constructed in
257+
[`init_estimstoch`](@ref)), and `model.A`, `model.Bu`, `model.Bd`, `model.C`, `model.Dd`
258+
matrices, the state-space matrices of the augmented model are defined as follows:
259259
```math
260260
\begin{aligned}
261261
\mathbf{Â} &= \begin{bmatrix}

src/estimator/execute.jl

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,45 @@ end
1818
1919
Mutating state function ``\mathbf{f̂}`` of the augmented model.
2020
21-
By introducing an augmented state vector ``\mathbf{x̂_0}`` like in [`augment_model`](@ref), the
22-
function returns the next state of the augmented model, defined as:
21+
By introducing an augmented state vector ``\mathbf{x̂_0}`` like in [`augment_model`](@ref),
22+
the function returns the next state of the augmented model, defined as:
2323
```math
2424
\begin{aligned}
2525
\mathbf{x̂_0}(k+1) &= \mathbf{f̂}\Big(\mathbf{x̂_0}(k), \mathbf{u_0}(k), \mathbf{d_0}(k)\Big) \\
2626
\mathbf{ŷ_0}(k) &= \mathbf{ĥ}\Big(\mathbf{x̂_0}(k), \mathbf{d_0}(k)\Big)
2727
\end{aligned}
2828
```
2929
where ``\mathbf{x̂_0}(k+1)`` is stored in `x̂0next` argument. The method mutates `x̂0next`,
30-
`û0` and `k0` in place. The argument `û0` is the input vector of the augmented model,
31-
computed by ``\mathbf{û_0 = u_0 + ŷ_{s_u}}``. The argument `k0` is used to store the
32-
intermediate stage values of `model.solver` (when applicable). The model parameter vector
33-
`model.p` is not included in the function signature for conciseness.
30+
`û0` and `k0` in place. The argument `û0` stores the disturbed input of the augmented model
31+
``\mathbf{û_0}``, and `k0`, the intermediate stage values of `model.solver`, when applicable.
32+
The model parameter `model.p` is not included in the function signature for conciseness. See
33+
Extended Help for details on ``\mathbf{û_0, f̂}`` and ``\mathbf{ĥ}`` implementations.
34+
35+
# Extended Help
36+
!!! details "Extended Help"
37+
Knowing that the augmented state vector is defined as
38+
``\mathbf{x̂_0} = [ \begin{smallmatrix} \mathbf{x_0} \\ \mathbf{x_s} \end{smallmatrix} ]``,
39+
the augmented model functions are:
40+
```math
41+
\begin{aligned}
42+
\mathbf{f̂}\Big(\mathbf{x̂_0}(k), \mathbf{u_0}(k), \mathbf{d_0}(k)\Big) &= \begin{bmatrix}
43+
\mathbf{f}\Big(\mathbf{x_0}(k), \mathbf{û_0}(k), \mathbf{d_0}(k), \mathbf{p}\Big) \\
44+
\mathbf{A_s} \mathbf{x_s}(k)
45+
\end{bmatrix}
46+
\mathbf{ĥ}\Big(\mathbf{x̂_0}(k), \mathbf{d_0}(k)\Big) &=
47+
\begin{aligned}
48+
\mathbf{h}\Big(\mathbf{x_0}(k), \mathbf{d_0}(k), \mathbf{p}\Big) + \mathbf{y_{s_y}}(k) \\
49+
\mathbf{h}\Big(\mathbf{x_0}(k), \mathbf{d_0}(k), \mathbf{p}\Big) + \mathbf{C_{s_y} x_s}(k)
50+
\end{aligned}
51+
and the disturbed input is:
52+
```math
53+
\begin{aligned}
54+
\mathbf{û_0}(k) &= \mathbf{u_0}(k) + \mathbf{y_{s_u}(k)}
55+
&= \mathbf{u_0}(k) + \mathbf{C_{s_u} x_s}(k)
56+
\end{aligned}
57+
```
58+
The ``\mathbf{f}`` and ``\mathbf{h}`` functions above are in fact [`f!`](@ref) and
59+
[`h!`](@ref) methods, respectively.
3460
"""
3561
function f̂!(x̂0next, û0, k0, estim::StateEstimator, model::SimModel, x̂0, u0, d0)
3662
return f̂!(x̂0next, û0, k0, model, estim.As, estim.Cs_u, x̂0, u0, d0)

0 commit comments

Comments
 (0)