Skip to content

Commit ebe0429

Browse files
committed
debug : InternalModel, new method for f̂ and ĥ
1 parent 095c119 commit ebe0429

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/src/internals/predictive_control.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ ModelPredictiveControl.relaxΔU
2323
ModelPredictiveControl.relaxŶ
2424
```
2525

26-
## Get Estimates
27-
28-
```@docs
29-
ModelPredictiveControl.getestimates!
30-
```
31-
3226
## Predictions
3327

3428
```@docs

src/estimator/internal_model.jl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct InternalModel{M<:SimModel} <: StateEstimator
3535
As, Bs, Cs, Ds = stoch_ym2y(model, i_ym, Asm, Bsm, Csm, Dsm)
3636
nxs = size(As,1)
3737
nx̂ = model.nx
38-
Â, B̂u, Ĉ, B̂d, D̂d = matrices_intenalmodel(model)
38+
Â, B̂u, Ĉ, B̂d, D̂d = matrices_internalmodel(model)
3939
Âs, B̂s = init_internalmodel(As, Bs, Cs, Ds)
4040
lastu0 = zeros(nu)
4141
x̂d == zeros(model.nx) # x̂ and x̂d are same object (updating x̂d will update x̂)
@@ -130,7 +130,23 @@ function matrices_internalmodel(model::LinModel)
130130
return Â, B̂u, Ĉ, B̂d, D̂d
131131
end
132132
"Return empty matrices if `model` is not a [`LinModel`](@ref)."
133-
matrices_intenalmodel(::SimModel) = tuple(fill(Float64[;;],5)...)
133+
matrices_internalmodel(::SimModel) = tuple(fill(Float64[;;],5)...)
134+
135+
@doc raw"""
136+
f̂(estim::InternalModel, x̂, u, d)
137+
138+
State function ``\mathbf{f̂}`` of the [`InternalModel`].
139+
140+
It calls `f(estim.model, x̂, u ,d)` since this estimator does not augment the state vector.
141+
"""
142+
(estim::InternalModel, x̂, u, d) = f(estim.model, x̂, u, d)
143+
144+
@doc raw"""
145+
ĥ(estim::InternalModel, x̂, d)
146+
147+
Output function ``\mathbf{ĥ}`` of the [`InternalModel`], it calls `h(estim.model, x̂, d)`.
148+
"""
149+
(estim::InternalModel, x̂, d) = h(estim.model, x̂, d)
134150

135151

136152
@doc raw"""

0 commit comments

Comments
 (0)