@@ -86,21 +86,24 @@ the rows of ``\mathbf{Ĉ, D̂_d}`` that correspond to measured outputs ``\mathb
86
86
unmeasured ones, for ``\m athbf{Ĉ^u, D̂_d^u}``).
87
87
88
88
# Arguments
89
+ !!! info
90
+ Keyword arguments in *`italic`* are non-Unicode alternatives.
91
+
89
92
- `model::LinModel` : (deterministic) model for the estimations.
90
93
- `i_ym=1:model.ny` : `model` output indices that are measured ``\m athbf{y^m}``, the rest
91
94
are unmeasured ``\m athbf{y^u}``.
92
- - `σQ=fill(1/model.nx,model.nx)` : main diagonal of the process noise covariance
93
- ``\m athbf{Q}`` of `model`, specified as a standard deviation vector.
94
- - `σR=fill(1,length(i_ym))` : main diagonal of the sensor noise covariance `` \m athbf{R}``
95
- of `model` measured outputs, specified as a standard deviation vector.
95
+ - `σQ=fill(1/model.nx,model.nx)` or *`sigmaQ`* : main diagonal of the process noise
96
+ covariance ``\m athbf{Q}`` of `model`, specified as a standard deviation vector.
97
+ - `σR=fill(1,length(i_ym))` or *`sigmaR`* : main diagonal of the sensor noise covariance
98
+ `` \m athbf{R}`` of `model` measured outputs, specified as a standard deviation vector.
96
99
- `nint_u=0`: integrator quantity for the stochastic model of the unmeasured disturbances at
97
100
the manipulated inputs (vector), use `nint_u=0` for no integrator (see Extended Help).
98
- - `σQint_u=fill(1,sum(nint_u))`: same than `σQ` but for the unmeasured disturbances at
99
- manipulated inputs ``\m athbf{Q_{int_u}}`` (composed of integrators).
100
101
- `nint_ym=default_nint(model,i_ym,nint_u)` : same than `nint_u` but for the unmeasured
101
102
disturbances at the measured outputs, use `nint_ym=0` for no integrator (see Extended Help).
102
- - `σQint_ym=fill(1,sum(nint_ym))` : same than `σQ` for the unmeasured disturbances at
103
- measured outputs ``\m athbf{Q_{int_{ym}}}`` (composed of integrators).
103
+ - `σQint_u=fill(1,sum(nint_u))` or *`sigmaQint_u`* : same than `σQ` but for the unmeasured
104
+ disturbances at manipulated inputs ``\m athbf{Q_{int_u}}`` (composed of integrators).
105
+ - `σQint_ym=fill(1,sum(nint_ym))` or *`sigmaQint_u`* : same than `σQ` for the unmeasured
106
+ disturbances at measured outputs ``\m athbf{Q_{int_{ym}}}`` (composed of integrators).
104
107
105
108
# Examples
106
109
```jldoctest
@@ -139,12 +142,16 @@ SteadyKalmanFilter estimator with a sample time Ts = 0.5 s, LinModel and:
139
142
function SteadyKalmanFilter (
140
143
model:: SM ;
141
144
i_ym:: IntRangeOrVector = 1 : model. ny,
142
- σQ :: Vector = fill (1 / model. nx, model. nx),
143
- σR :: Vector = fill (1 , length (i_ym)),
145
+ sigmaQ = fill (1 / model. nx, model. nx),
146
+ sigmaR = fill (1 , length (i_ym)),
144
147
nint_u :: IntVectorOrInt = 0 ,
145
- σQint_u:: Vector = fill (1 , max (sum (nint_u), 0 )),
146
148
nint_ym:: IntVectorOrInt = default_nint (model, i_ym, nint_u),
147
- σQint_ym:: Vector = fill (1 , max (sum (nint_ym), 0 ))
149
+ sigmaQint_u = fill (1 , max (sum (nint_u), 0 )),
150
+ sigmaQint_ym = fill (1 , max (sum (nint_ym), 0 )),
151
+ σQ = sigmaQ,
152
+ σR = sigmaR,
153
+ σQint_u = sigmaQint_u,
154
+ σQint_ym = sigmaQint_ym,
148
155
) where {NT<: Real , SM<: LinModel{NT} }
149
156
# estimated covariances matrices (variance = σ²) :
150
157
Q̂ = Hermitian (diagm (NT[σQ; σQint_u; σQint_ym ]. ^ 2 ), :L )
@@ -266,13 +273,16 @@ its initial value with ``\mathbf{P̂}_{-1}(0) =
266
273
\m athrm{diag}\{ \m athbf{P}(0), \m athbf{P_{int_{u}}}(0), \m athbf{P_{int_{ym}}}(0) \} ``.
267
274
268
275
# Arguments
276
+ !!! info
277
+ Keyword arguments in *`italic`* are non-Unicode alternatives.
278
+
269
279
- `model::LinModel` : (deterministic) model for the estimations.
270
- - `σP_0=fill(1/model.nx,model.nx)` : main diagonal of the initial estimate covariance
271
- ``\m athbf{P}(0)``, specified as a standard deviation vector.
272
- - `σPint_u_0=fill(1,sum(nint_u))` : same than `σP_0` but for the unmeasured disturbances at
273
- manipulated inputs ``\m athbf{P_{int_u}}(0)`` (composed of integrators).
274
- - `σPint_ym_0=fill(1,sum(nint_ym))` : same than `σP_0` but for the unmeasured disturbances
275
- at measured outputs ``\m athbf{P_{int_{ym}}}(0)`` (composed of integrators).
280
+ - `σP_0=fill(1/model.nx,model.nx)` or *`sigmaP_0`* : main diagonal of the initial estimate
281
+ covariance ``\m athbf{P}(0)``, specified as a standard deviation vector.
282
+ - `σPint_u_0=fill(1,sum(nint_u))` or *`sigmaPint_u_0`* : same than `σP_0` but for the unmeasured
283
+ disturbances at manipulated inputs ``\m athbf{P_{int_u}}(0)`` (composed of integrators).
284
+ - `σPint_ym_0=fill(1,sum(nint_ym))` or *`sigmaPint_ym_0`* : same than `σP_0` but for the unmeasured
285
+ disturbances at measured outputs ``\m athbf{P_{int_{ym}}}(0)`` (composed of integrators).
276
286
- `<keyword arguments>` of [`SteadyKalmanFilter`](@ref) constructor.
277
287
278
288
# Examples
@@ -291,15 +301,22 @@ KalmanFilter estimator with a sample time Ts = 0.5 s, LinModel and:
291
301
function KalmanFilter (
292
302
model:: SM ;
293
303
i_ym:: IntRangeOrVector = 1 : model. ny,
294
- σP_0:: Vector = fill (1 / model. nx, model. nx),
295
- σQ :: Vector = fill (1 / model. nx, model. nx),
296
- σR :: Vector = fill (1 , length (i_ym)),
297
- nint_u :: IntVectorOrInt = 0 ,
298
- σQint_u :: Vector = fill (1 , max (sum (nint_u), 0 )),
299
- σPint_u_0 :: Vector = fill (1 , max (sum (nint_u), 0 )),
300
- nint_ym :: IntVectorOrInt = default_nint (model, i_ym, nint_u),
301
- σQint_ym :: Vector = fill (1 , max (sum (nint_ym), 0 )),
302
- σPint_ym_0:: Vector = fill (1 , max (sum (nint_ym), 0 )),
304
+ sigmaP_0 = fill (1 / model. nx, model. nx),
305
+ sigmaQ = fill (1 / model. nx, model. nx),
306
+ sigmaR = fill (1 , length (i_ym)),
307
+ nint_u :: IntVectorOrInt = 0 ,
308
+ nint_ym:: IntVectorOrInt = default_nint (model, i_ym, nint_u),
309
+ sigmaPint_u_0 = fill (1 , max (sum (nint_u), 0 )),
310
+ sigmaQint_u = fill (1 , max (sum (nint_u), 0 )),
311
+ sigmaPint_ym_0 = fill (1 , max (sum (nint_ym), 0 )),
312
+ sigmaQint_ym = fill (1 , max (sum (nint_ym), 0 )),
313
+ σP_0 = sigmaP_0,
314
+ σQ = sigmaQ,
315
+ σR = sigmaR,
316
+ σPint_u_0 = sigmaPint_u_0,
317
+ σQint_u = sigmaQint_u,
318
+ σPint_ym_0 = sigmaPint_ym_0,
319
+ σQint_ym = sigmaQint_ym,
303
320
) where {NT<: Real , SM<: LinModel{NT} }
304
321
# estimated covariances matrices (variance = σ²) :
305
322
P̂_0 = Hermitian (diagm (NT[σP_0; σPint_u_0; σPint_ym_0]. ^ 2 ), :L )
@@ -440,10 +457,13 @@ represents the measured outputs of ``\mathbf{ĥ}`` function (and unmeasured one
440
457
``\m athbf{ĥ^u}``).
441
458
442
459
# Arguments
460
+ !!! info
461
+ Keyword arguments in *`italic`* are non-Unicode alternatives.
462
+
443
463
- `model::SimModel` : (deterministic) model for the estimations.
444
- - `α=1e-3` : alpha parameter, spread of the state distribution ``(0 < α ≤ 1)``.
445
- - `β=2` : beta parameter, skewness and kurtosis of the states distribution ``(β ≥ 0)``.
446
- - `κ=0` : kappa parameter, another spread parameter ``(0 ≤ κ ≤ 3)``.
464
+ - `α=1e-3` or *`alpha`* : alpha parameter, spread of the state distribution ``(0 < α ≤ 1)``.
465
+ - `β=2` or *`beta`* : beta parameter, skewness and kurtosis of the states distribution ``(β ≥ 0)``.
466
+ - `κ=0` or *`kappa`* : kappa parameter, another spread parameter ``(0 ≤ κ ≤ 3)``.
447
467
- `<keyword arguments>` of [`SteadyKalmanFilter`](@ref) constructor.
448
468
- `<keyword arguments>` of [`KalmanFilter`](@ref) constructor.
449
469
@@ -470,18 +490,28 @@ UnscentedKalmanFilter estimator with a sample time Ts = 10.0 s, NonLinModel and:
470
490
function UnscentedKalmanFilter (
471
491
model:: SM ;
472
492
i_ym:: IntRangeOrVector = 1 : model. ny,
473
- σP_0:: Vector = fill (1 / model. nx, model. nx),
474
- σQ :: Vector = fill (1 / model. nx, model. nx),
475
- σR :: Vector = fill (1 , length (i_ym)),
476
- nint_u :: IntVectorOrInt = 0 ,
477
- σQint_u :: Vector = fill (1 , max (sum (nint_u), 0 )),
478
- σPint_u_0 :: Vector = fill (1 , max (sum (nint_u), 0 )),
479
- nint_ym :: IntVectorOrInt = default_nint (model, i_ym, nint_u),
480
- σQint_ym :: Vector = fill (1 , max (sum (nint_ym), 0 )),
481
- σPint_ym_0:: Vector = fill (1 , max (sum (nint_ym), 0 )),
482
- α:: Real = 1e-3 ,
483
- β:: Real = 2 ,
484
- κ:: Real = 0
493
+ sigmaP_0 = fill (1 / model. nx, model. nx),
494
+ sigmaQ = fill (1 / model. nx, model. nx),
495
+ sigmaR = fill (1 , length (i_ym)),
496
+ nint_u :: IntVectorOrInt = 0 ,
497
+ nint_ym:: IntVectorOrInt = default_nint (model, i_ym, nint_u),
498
+ sigmaPint_u_0 = fill (1 , max (sum (nint_u), 0 )),
499
+ sigmaQint_u = fill (1 , max (sum (nint_u), 0 )),
500
+ sigmaPint_ym_0 = fill (1 , max (sum (nint_ym), 0 )),
501
+ sigmaQint_ym = fill (1 , max (sum (nint_ym), 0 )),
502
+ alpha:: Real = 1e-3 ,
503
+ beta :: Real = 2 ,
504
+ kappa:: Real = 0 ,
505
+ σP_0 = sigmaP_0,
506
+ σQ = sigmaQ,
507
+ σR = sigmaR,
508
+ σPint_u_0 = sigmaPint_u_0,
509
+ σQint_u = sigmaQint_u,
510
+ σPint_ym_0 = sigmaPint_ym_0,
511
+ σQint_ym = sigmaQint_ym,
512
+ α = alpha,
513
+ β = beta,
514
+ κ = kappa,
485
515
) where {NT<: Real , SM<: SimModel{NT} }
486
516
# estimated covariances matrices (variance = σ²) :
487
517
P̂_0 = Hermitian (diagm (NT[σP_0; σPint_u_0; σPint_ym_0]. ^ 2 ), :L )
@@ -732,15 +762,22 @@ ExtendedKalmanFilter estimator with a sample time Ts = 5.0 s, NonLinModel and:
732
762
function ExtendedKalmanFilter (
733
763
model:: SM ;
734
764
i_ym:: IntRangeOrVector = 1 : model. ny,
735
- σP_0:: Vector = fill (1 / model. nx, model. nx),
736
- σQ :: Vector = fill (1 / model. nx, model. nx),
737
- σR :: Vector = fill (1 , length (i_ym)),
738
- nint_u :: IntVectorOrInt = 0 ,
739
- σQint_u :: Vector = fill (1 , max (sum (nint_u), 0 )),
740
- σPint_u_0 :: Vector = fill (1 , max (sum (nint_u), 0 )),
741
- nint_ym :: IntVectorOrInt = default_nint (model, i_ym, nint_u),
742
- σQint_ym :: Vector = fill (1 , max (sum (nint_ym), 0 )),
743
- σPint_ym_0:: Vector = fill (1 , max (sum (nint_ym), 0 )),
765
+ sigmaP_0 = fill (1 / model. nx, model. nx),
766
+ sigmaQ = fill (1 / model. nx, model. nx),
767
+ sigmaR = fill (1 , length (i_ym)),
768
+ nint_u :: IntVectorOrInt = 0 ,
769
+ nint_ym:: IntVectorOrInt = default_nint (model, i_ym, nint_u),
770
+ sigmaPint_u_0 = fill (1 , max (sum (nint_u), 0 )),
771
+ sigmaQint_u = fill (1 , max (sum (nint_u), 0 )),
772
+ sigmaPint_ym_0 = fill (1 , max (sum (nint_ym), 0 )),
773
+ sigmaQint_ym = fill (1 , max (sum (nint_ym), 0 )),
774
+ σP_0 = sigmaP_0,
775
+ σQ = sigmaQ,
776
+ σR = sigmaR,
777
+ σPint_u_0 = sigmaPint_u_0,
778
+ σQint_u = sigmaQint_u,
779
+ σPint_ym_0 = sigmaPint_ym_0,
780
+ σQint_ym = sigmaQint_ym,
744
781
) where {NT<: Real , SM<: SimModel{NT} }
745
782
# estimated covariances matrices (variance = σ²) :
746
783
P̂_0 = Hermitian (diagm (NT[σP_0; σPint_u_0; σPint_ym_0]. ^ 2 ), :L )
0 commit comments