Skip to content

Commit e3a871f

Browse files
committed
start of luenberger observer
1 parent 9fd5e25 commit e3a871f

File tree

2 files changed

+45
-50
lines changed

2 files changed

+45
-50
lines changed

src/estimator/luenberger.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
struct Luenberger <: StateEstimator
2+
model::LinModel
3+
::Vector{Float64}
4+
i_ym::IntRangeOrVector
5+
nx̂::Int
6+
nym::Int
7+
nyu::Int
8+
nxs::Int
9+
As::Matrix{Float64}
10+
Cs::Matrix{Float64}
11+
nint_ym::Vector{Int}
12+
::Matrix{Float64}
13+
B̂u ::Matrix{Float64}
14+
B̂d ::Matrix{Float64}
15+
::Matrix{Float64}
16+
D̂d ::Matrix{Float64}
17+
Ĉm ::Matrix{Float64}
18+
D̂dm ::Matrix{Float64}
19+
::Function
20+
::Function
21+
K::Matrix{Float64}
22+
function Luenberger(model, i_ym, nint_ym, Asm, Csm, L)
23+
nx, ny = model.nx, model.ny
24+
nym, nyu = length(i_ym), ny - length(i_ym)
25+
nxs = size(Asm,1)
26+
nx̂ = nx + nxs
27+
validate_kfcov(nym, nx̂, Q̂, R̂)
28+
As, _ , Cs, _ = stoch_ym2y(model, i_ym, Asm, [], Csm, [])
29+
f̂, ĥ, Â, B̂u, Ĉ, B̂d, D̂d = augment_model(model, As, Cs)
30+
Ĉm, D̂dm = Ĉ[i_ym, :], D̂d[i_ym, :] # measured outputs ym only
31+
K = L
32+
= [copy(model.x); zeros(nxs)]
33+
return new(
34+
model,
35+
x̂,
36+
i_ym, nx̂, nym, nyu, nxs,
37+
As, Cs, nint_ym,
38+
Â, B̂u, B̂d, Ĉ, D̂d,
39+
Ĉm, D̂dm,
40+
f̂, ĥ,
41+
Q̂, R̂,
42+
K
43+
)
44+
end
45+
end

src/estimator/unscented.jl

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)