Skip to content

Commit 661d5f1

Browse files
committed
doc precisions for fhat and hhat functions
1 parent e4fdb4b commit 661d5f1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

example/juMPC.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ setconstraint!(mpc, ŷmin=[-Inf,-Inf], ŷmax=[55, 35])
9595
setconstraint!(mpc, Δumin=[-Inf,-Inf],Δumax=[+Inf,+Inf])
9696

9797
function test_mpc(model, mpc)
98-
N = 2000
98+
N = 200
9999
u_data = zeros(2,N)
100100
y_data = zeros(2,N)
101101
r_data = zeros(2,N)
@@ -130,7 +130,7 @@ function test_mpc(model, mpc)
130130
end
131131

132132
@time u_data, y_data, r_data, d_data = test_mpc(linModel4, mpc)
133-
@profview u_data, y_data, r_data, d_data = test_mpc(linModel4, mpc)
133+
#@profview u_data, y_data, r_data, d_data = test_mpc(linModel4, mpc)
134134
#=
135135
using PlotThemes, Plots
136136
#theme(:default)

src/state_estim.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,25 @@ end
153153
Update the augmented model state for estimation.
154154
155155
By introducing an augmented state vector ``\mathbf{x}`` like in [`augment_model`](@ref) doc,
156-
this ``\mathbf{f̂}`` method updates it with the augmented model :
156+
the ``\mathbf{f̂}`` method updates it from the augmented model, defined as :
157157
```math
158158
\begin{aligned}
159159
\mathbf{x}(k+1) &= \mathbf{f̂}\Big(\mathbf{x}(k), \mathbf{u}(k), \mathbf{d}(k)\Big) \\
160160
\mathbf{y}(k) &= \mathbf{ĥ}\Big(\mathbf{x}(k), \mathbf{d}(k)\Big)
161161
\end{aligned}
162162
```
163163
"""
164-
function (estim::StateEstimator, x̂, u, d)
164+
function (estim::E, x̂, u, d) where {E<:StateEstimator}
165165
# TODO: consider using views : https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-views
166166
return [estim.model.f(x̂[1:estim.model.nx], u, d); estim.As*x̂[estim.model.nx+1:end]]
167167
end
168168

169-
"""
169+
@doc raw"""
170170
ĥ(estim::StateEstimator, x̂, d)
171171
172-
Calc the augmented model output for estimation, see [`f̂`](@ref) for details.
172+
Output function ``\mathbf{ĥ}`` of the augmented model, see [`f̂`](@ref) for details.
173173
"""
174-
function (estim::StateEstimator, x̂, d)
174+
function (estim::E, x̂, d) where {E<:StateEstimator}
175175
return estim.model.h(x̂[1:estim.model.nx], d) + estim.Cs*x̂[estim.model.nx+1:end]
176176
end
177177

0 commit comments

Comments
 (0)