@@ -85,13 +85,13 @@ ones, for ``\mathbf{Ĉ^u, D̂_d^u}``).
8585- `model::LinModel` : (deterministic) model for the estimations.
8686- `i_ym=1:model.ny` : `model` output indices that are measured ``\m athbf{y^m}``, the rest
8787 are unmeasured ``\m athbf{y^u}``.
88- - `σQ=fill(0.1 ,model.nx)` : main diagonal of the process noise covariance `` \m athbf{Q}`` of
89- `model`, specified as a standard deviation vector.
90- - `σR=fill(0. 1,length(i_ym))` : main diagonal of the sensor noise covariance ``\m athbf{R}``
88+ - `σQ=fill(1/model.nx ,model.nx)` : main diagonal of the process noise covariance
89+ `` \m athbf{Q}`` of ` model`, specified as a standard deviation vector.
90+ - `σR=fill(1,length(i_ym))` : main diagonal of the sensor noise covariance ``\m athbf{R}``
9191 of `model` measured outputs, specified as a standard deviation vector.
9292- `nint_ym=fill(1,length(i_ym))` : integrator quantity per measured outputs (vector) for the
9393 stochastic model, use `nint_ym=0` for no integrator at all.
94- - `σQ_int=fill(0. 1,sum(nint_ym))` : same than `σQ` but for the stochastic model covariance
94+ - `σQ_int=fill(1,sum(nint_ym))` : same than `σQ` but for the stochastic model covariance
9595 ``\m athbf{Q_{int}}`` (composed of output integrators).
9696
9797# Examples
@@ -124,10 +124,10 @@ you can use 0 integrator on `model` integrating outputs, or the alternative time
124124function SteadyKalmanFilter (
125125 model:: LinModel ;
126126 i_ym:: IntRangeOrVector = 1 : model. ny,
127- σQ:: Vector = fill (0.1 , model. nx),
128- σR:: Vector = fill (0. 1 , length (i_ym)),
127+ σQ:: Vector = fill (1 / model . nx , model. nx),
128+ σR:: Vector = fill (1 , length (i_ym)),
129129 nint_ym:: IntVectorOrInt = fill (1 , length (i_ym)),
130- σQ_int:: Vector = fill (0. 1 , max (sum (nint_ym), 0 ))
130+ σQ_int:: Vector = fill (1 , max (sum (nint_ym), 0 ))
131131)
132132 # estimated covariances matrices (variance = σ²) :
133133 Q̂ = Diagonal {Float64} ([σQ ; σQ_int ]. ^ 2 );
@@ -158,11 +158,11 @@ The [`SteadyKalmanFilter`](@ref) updates it with the precomputed Kalman gain ``\
158158
159159# Examples
160160```jldoctest
161- julia> kf = SteadyKalmanFilter(LinModel(ss(1, 1 , 1, 0, 1 .0)));
161+ julia> kf = SteadyKalmanFilter(LinModel(ss(0. 1, 0.5 , 1, 0, 4 .0)));
162162
163163julia> x̂ = updatestate!(kf, [1], [0]) # x̂[2] is the integrator state (nint_ym argument)
1641642-element Vector{Float64}:
165- 1.0
165+ 0.5
166166 0.0
167167```
168168"""
@@ -239,9 +239,9 @@ with ``\mathbf{P̂}_{-1}(0) = \mathrm{diag}\{ \mathbf{P}(0), \mathbf{P_{int}}(0)
239239
240240# Arguments
241241- `model::LinModel` : (deterministic) model for the estimations.
242- - `σP0=fill(10 ,model.nx)` : main diagonal of the initial estimate covariance
242+ - `σP0=fill(1/model.nx ,model.nx)` : main diagonal of the initial estimate covariance
243243 ``\m athbf{P}(0)``, specified as a standard deviation vector.
244- - `σP0_int=fill(10 ,sum(nint_ym))` : same than `σP0` but for the stochastic model
244+ - `σP0_int=fill(1 ,sum(nint_ym))` : same than `σP0` but for the stochastic model
245245 covariance ``\m athbf{P_{int}}(0)`` (composed of output integrators).
246246- `<keyword arguments>` of [`SteadyKalmanFilter`](@ref) constructor.
247247
@@ -261,12 +261,12 @@ KalmanFilter estimator with a sample time Ts = 0.5 s, LinModel and:
261261function KalmanFilter (
262262 model:: LinModel ;
263263 i_ym:: IntRangeOrVector = 1 : model. ny,
264- σP0:: Vector = fill (10 , model. nx),
265- σQ:: Vector = fill (0.1 , model. nx),
266- σR:: Vector = fill (0. 1 , length (i_ym)),
264+ σP0:: Vector = fill (1 / model . nx , model. nx),
265+ σQ:: Vector = fill (1 / model . nx , model. nx),
266+ σR:: Vector = fill (1 , length (i_ym)),
267267 nint_ym:: IntVectorOrInt = fill (1 , length (i_ym)),
268- σP0_int:: Vector = fill (10 , max (sum (nint_ym), 0 )),
269- σQ_int:: Vector = fill (0. 1 , max (sum (nint_ym), 0 ))
268+ σP0_int:: Vector = fill (1 , max (sum (nint_ym), 0 )),
269+ σQ_int:: Vector = fill (1 , max (sum (nint_ym), 0 ))
270270)
271271 # estimated covariances matrices (variance = σ²) :
272272 P̂0 = Diagonal {Float64} ([σP0 ; σP0_int ]. ^ 2 );
@@ -429,12 +429,12 @@ UnscentedKalmanFilter estimator with a sample time Ts = 10.0 s, NonLinModel and:
429429function UnscentedKalmanFilter (
430430 model:: M ;
431431 i_ym:: IntRangeOrVector = 1 : model. ny,
432- σP0:: Vector = fill (10 , model. nx),
433- σQ:: Vector = fill (0.1 , model. nx),
434- σR:: Vector = fill (0. 1 , length (i_ym)),
432+ σP0:: Vector = fill (1 / model . nx , model. nx),
433+ σQ:: Vector = fill (1 / model . nx , model. nx),
434+ σR:: Vector = fill (1 , length (i_ym)),
435435 nint_ym:: IntVectorOrInt = fill (1 , length (i_ym)),
436- σP0_int:: Vector = fill (10 , max (sum (nint_ym), 0 )),
437- σQ_int:: Vector = fill (0. 1 , max (sum (nint_ym), 0 )),
436+ σP0_int:: Vector = fill (1 , max (sum (nint_ym), 0 )),
437+ σQ_int:: Vector = fill (1 , max (sum (nint_ym), 0 )),
438438 α:: Real = 1e-3 ,
439439 β:: Real = 2 ,
440440 κ:: Real = 0
0 commit comments