@@ -15,64 +15,65 @@ function remove_op!(estim::StateEstimator, u, ym, d)
1515end
1616
1717@doc raw """
18- f̂!(x̂next, û , estim::StateEstimator, model::SimModel, x̂, u, d ) -> nothing
18+ f̂!(x̂next0, û0 , estim::StateEstimator, model::SimModel, x̂0, u0, d0 ) -> nothing
1919
2020Mutating state function ``\m athbf{f̂}`` of the augmented model.
2121
22- By introducing an augmented state vector ``\m athbf{x̂ }`` like in [`augment_model`](@ref), the
22+ By introducing an augmented state vector ``\m athbf{x̂_0 }`` like in [`augment_model`](@ref), the
2323function returns the next state of the augmented model, defined as:
2424```math
2525\b egin{aligned}
26- \m athbf{x̂ }(k+1) &= \m athbf{f̂}\B ig(\m athbf{x̂ }(k), \m athbf{u }(k), \m athbf{d }(k)\B ig) \\
27- \m athbf{ŷ }(k) &= \m athbf{ĥ}\B ig(\m athbf{x̂ }(k), \m athbf{d }(k)\B ig)
26+ \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) \\
27+ \m athbf{ŷ_0 }(k) &= \m athbf{ĥ}\B ig(\m athbf{x̂_0 }(k), \m athbf{d_0 }(k)\B ig)
2828\e nd{aligned}
2929```
30- where ``\m athbf{x̂}(k+1)`` is stored in `x̂next` argument. The method mutates `x̂next` and `û`
31- in place, the latter stores the input vector of the augmented model ``\m athbf{u + ŷ_{s_u}}``.
30+ where ``\m athbf{x̂_0}(k+1)`` is stored in `x̂next0` argument. The method mutates `x̂next0` and
31+ `û0` in place, the latter stores the input vector of the augmented model
32+ ``\m athbf{u0 + ŷ_{s_u}}``.
3233"""
33- function f̂! (x̂next, û , estim:: StateEstimator , model:: SimModel , x̂, u, d )
34+ function f̂! (x̂next0, û0 , estim:: StateEstimator , model:: SimModel , x̂0, u0, d0 )
3435 # `@views` macro avoid copies with matrix slice operator e.g. [a:b]
35- @views x̂d, x̂s = x̂ [1 : model. nx], x̂ [model. nx+ 1 : end ]
36- @views x̂d_next, x̂s_next = x̂next [1 : model. nx], x̂next [model. nx+ 1 : end ]
37- mul! (û , estim. Cs_u, x̂s)
38- û .+ = u
39- f! (x̂d_next, model, x̂d, û, d )
36+ @views x̂d, x̂s = x̂0 [1 : model. nx], x̂0 [model. nx+ 1 : end ]
37+ @views x̂d_next, x̂s_next = x̂next0 [1 : model. nx], x̂next0 [model. nx+ 1 : end ]
38+ mul! (û0 , estim. Cs_u, x̂s)
39+ û0 .+ = u0
40+ f! (x̂d_next, model, x̂d, û0, d0 )
4041 mul! (x̂s_next, estim. As, x̂s)
4142 return nothing
4243end
4344
4445"""
45- f̂!(x̂next , _ , estim::StateEstimator, model::LinModel, x̂, u, d ) -> nothing
46+ f̂!(x̂next0 , _ , estim::StateEstimator, model::LinModel, x̂0, u0, d0 ) -> nothing
4647
4748Use the augmented model matrices if `model` is a [`LinModel`](@ref).
4849"""
49- function f̂! (x̂next , _ , estim:: StateEstimator , :: LinModel , x̂, u, d )
50- mul! (x̂next , estim. Â, x̂ )
51- mul! (x̂next , estim. B̂u, u , 1 , 1 )
52- mul! (x̂next , estim. B̂d, d , 1 , 1 )
50+ function f̂! (x̂next0 , _ , estim:: StateEstimator , :: LinModel , x̂0, u0, d0 )
51+ mul! (x̂next0 , estim. Â, x̂0 )
52+ mul! (x̂next0 , estim. B̂u, u0 , 1 , 1 )
53+ mul! (x̂next0 , estim. B̂d, d0 , 1 , 1 )
5354 return nothing
5455end
5556
5657@doc raw """
57- ĥ!(ŷ , estim::StateEstimator, model::SimModel, x̂, d ) -> nothing
58+ ĥ!(ŷ0 , estim::StateEstimator, model::SimModel, x̂0, d0 ) -> nothing
5859
5960Mutating output function ``\m athbf{ĥ}`` of the augmented model, see [`f̂!`](@ref).
6061"""
61- function ĥ! (ŷ , estim:: StateEstimator , model:: SimModel , x̂, d )
62+ function ĥ! (ŷ0 , estim:: StateEstimator , model:: SimModel , x̂0, d0 )
6263 # `@views` macro avoid copies with matrix slice operator e.g. [a:b]
63- @views x̂d, x̂s = x̂ [1 : model. nx], x̂ [model. nx+ 1 : end ]
64- h! (ŷ , model, x̂d, d )
65- mul! (ŷ , estim. Cs_y, x̂s, 1 , 1 )
64+ @views x̂d, x̂s = x̂0 [1 : model. nx], x̂0 [model. nx+ 1 : end ]
65+ h! (ŷ0 , model, x̂d, d0 )
66+ mul! (ŷ0 , estim. Cs_y, x̂s, 1 , 1 )
6667 return nothing
6768end
6869"""
69- ĥ!(ŷ , estim::StateEstimator, model::LinModel, x̂, d ) -> nothing
70+ ĥ!(ŷ0 , estim::StateEstimator, model::LinModel, x̂0, d0 ) -> nothing
7071
7172Use the augmented model matrices if `model` is a [`LinModel`](@ref).
7273"""
73- function ĥ! (ŷ , estim:: StateEstimator , :: LinModel , x̂, d )
74- mul! (ŷ , estim. Ĉ, x̂ )
75- mul! (ŷ , estim. D̂d, d , 1 , 1 )
74+ function ĥ! (ŷ0 , estim:: StateEstimator , :: LinModel , x̂0, d0 )
75+ mul! (ŷ0 , estim. Ĉ, x̂0 )
76+ mul! (ŷ0 , estim. D̂d, d0 , 1 , 1 )
7677 return nothing
7778end
7879
@@ -130,8 +131,9 @@ init_estimate_cov!(::StateEstimator, _ , _ , _ ) = nothing
130131
131132Init `estim.x̂0` estimate with the steady-state solution if `model` is a [`LinModel`](@ref).
132133
133- Using `u0`, `ym0` and `d0` arguments, the steady-state problem combined to the equality
134- constraint ``\m athbf{ŷ_0^m} = \m athbf{y_0^m}`` engenders the following system to solve:
134+ Using `u0`, `ym0` and `d0` arguments (deviation values, see [`setop!`](@ref)), the
135+ steadystate problem combined to the equality constraint ``\m athbf{ŷ_0^m} = \m athbf{y_0^m}``
136+ engenders the following system to solve:
135137```math
136138\b egin{bmatrix}
137139 \m athbf{I} - \m athbf{Â} \\
0 commit comments