1919Mutating state function ``\m athbf{f̂}`` of the augmented model.
2020
2121By introducing an augmented state vector ``\m athbf{x̂_0}`` like in [`augment_model`](@ref),
22- the function returns the next state of the augmented model, defined as :
22+ the function returns the next state of the augmented model, as deviation vectors :
2323```math
2424\b egin{aligned}
25- \m athbf{x̂_0}(k+1) &= \m athbf{f̂}\B ig(\m athbf{x̂_0}(k), \m athbf{u_0}(k), \m athbf{d_0}(k)\B ig) \\
25+ \m athbf{x̂_0}(k+1) &= \m athbf{f̂}\B ig(\m athbf{x̂_0}(k), \m athbf{u_0}(k), \m athbf{d_0}(k)\B ig)
2626 \m athbf{ŷ_0}(k) &= \m athbf{ĥ}\B ig(\m athbf{x̂_0}(k), \m athbf{d_0}(k)\B ig)
2727\e nd{aligned}
2828```
@@ -41,7 +41,8 @@ Extended Help for details on ``\mathbf{û_0, f̂}`` and ``\mathbf{ĥ}`` implem
4141 \b egin{aligned}
4242 \m athbf{f̂}\B ig(\m athbf{x̂_0}(k), \m athbf{u_0}(k), \m athbf{d_0}(k)\B ig) &= \b egin{bmatrix}
4343 \m athbf{f}\B ig(\m athbf{x_0}(k), \m athbf{û_0}(k), \m athbf{d_0}(k), \m athbf{p}\B ig) \\
44- \m athbf{A_s} \m athbf{x_s}(k) \e nd{bmatrix} \\
44+ \m athbf{A_s} \m athbf{x_s}(k) \e nd{bmatrix}
45+ + \m athbf{f̂_{op}} - \m athbf{x̂_{op}} \\
4546 \m athbf{ĥ}\B ig(\m athbf{x̂_0}(k), \m athbf{d_0}(k)\B ig) &=
4647 \m athbf{h}\B ig(\m athbf{x_0}(k), \m athbf{d_0}(k), \m athbf{p}\B ig) + \m athbf{y_{s_y}}(k)
4748 \e nd{aligned}
@@ -55,7 +56,9 @@ Extended Help for details on ``\mathbf{û_0, f̂}`` and ``\mathbf{ĥ}`` implem
5556 \e nd{aligned}
5657 ```
5758 The ``\m athbf{f}`` and ``\m athbf{h}`` functions above are in fact the [`f!`](@ref) and
58- [`h!`](@ref) methods, respectively.
59+ [`h!`](@ref) methods, respectively. The operating points ``\m athbf{x̂_{op}, f̂_{op}}``
60+ are computed by [`augment_model`](@ref) (almost always zeros in practice for
61+ [`NonLinModel`](@ref)).
5962"""
6063function f̂! (x̂0next, û0, k0, estim:: StateEstimator , model:: SimModel , x̂0, u0, d0)
6164 return f̂! (x̂0next, û0, k0, model, estim. As, estim. Cs_u, x̂0, u0, d0)
6467"""
6568 f̂!(x̂0next, _ , _ , estim::StateEstimator, model::LinModel, x̂0, u0, d0) -> nothing
6669
67- Use the augmented model matrices if `model` is a [`LinModel`](@ref).
70+ Use the augmented model matrices and operating points if `model` is a [`LinModel`](@ref).
6871"""
6972function f̂! (x̂0next, _ , _ , estim:: StateEstimator , :: LinModel , x̂0, u0, d0)
7073 mul! (x̂0next, estim. Â, x̂0)
7174 mul! (x̂0next, estim. B̂u, u0, 1 , 1 )
7275 mul! (x̂0next, estim. B̂d, d0, 1 , 1 )
76+ x̂0next .+ = estim. f̂op .- estim. x̂op
7377 return nothing
7478end
7579
@@ -86,6 +90,7 @@ function f̂!(x̂0next, û0, k0, model::SimModel, As, Cs_u, x̂0, u0, d0)
8690 û0 .+ = u0 # û0 = u0 + ys_u
8791 f! (xdnext, k0, model, xd, û0, d0, model. p)
8892 mul! (xsnext, As, xs)
93+ x̂0next .+ = estim. f̂op .- estim. x̂op
8994 return nothing
9095end
9196
0 commit comments