Skip to content

Commit 030fa21

Browse files
committed
doc: update jldocstrings
1 parent ce74a34 commit 030fa21

7 files changed

Lines changed: 19 additions & 4 deletions

File tree

src/estimator/internal_model.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ estimator is allocation-free if `model` simulations do not allocate.
8282
julia> estim = InternalModel(LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 0.5), i_ym=[2])
8383
InternalModel estimator with a sample time Ts = 0.5 s:
8484
├ model: LinModel
85+
├ direct: true
8586
└ dimensions:
8687
├ 1 manipulated inputs u
8788
├ 2 estimated states x̂

src/estimator/kalman.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ julia> model = LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 0.5);
119119
julia> estim = SteadyKalmanFilter(model, i_ym=[2], σR=[1], σQint_ym=[0.01])
120120
SteadyKalmanFilter estimator with a sample time Ts = 0.5 s:
121121
├ model: LinModel
122+
├ direct: true
122123
└ dimensions:
123124
├ 1 manipulated inputs u (0 integrating states)
124125
├ 3 estimated states x̂
@@ -410,6 +411,7 @@ julia> model = LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 0.5);
410411
julia> estim = KalmanFilter(model, i_ym=[2], σR=[1], σP_0=[100, 100], σQint_ym=[0.01])
411412
KalmanFilter estimator with a sample time Ts = 0.5 s:
412413
├ model: LinModel
414+
├ direct: true
413415
└ dimensions:
414416
├ 1 manipulated inputs u (0 integrating states)
415417
├ 3 estimated states x̂
@@ -656,6 +658,7 @@ julia> model = NonLinModel((x,u,_,_)->0.1x+u, (x,_,_)->2x, 10.0, 1, 1, 1, solver
656658
julia> estim = UnscentedKalmanFilter(model, σR=[1], nint_ym=[2], σPint_ym_0=[1, 1])
657659
UnscentedKalmanFilter estimator with a sample time Ts = 10.0 s:
658660
├ model: NonLinModel
661+
├ direct: true
659662
└ dimensions:
660663
├ 1 manipulated inputs u (0 integrating states)
661664
├ 3 estimated states x̂
@@ -1023,6 +1026,7 @@ julia> estim = ExtendedKalmanFilter(model, σQ=[2], σQint_ym=[2], σP_0=[0.1],
10231026
ExtendedKalmanFilter estimator with a sample time Ts = 5.0 s:
10241027
├ model: NonLinModel
10251028
├ jacobian: AutoForwardDiff
1029+
├ direct: true
10261030
└ dimensions:
10271031
├ 1 manipulated inputs u (0 integrating states)
10281032
├ 2 estimated states x̂
@@ -1190,8 +1194,10 @@ function update_estimate!(estim::ExtendedKalmanFilter{NT}, y0m, d0, u0) where NT
11901194
return predict_estimate_kf!(estim, u0, d0, F̂)
11911195
end
11921196

1197+
"Print the `jacobian` backend and `direct` flag for [`ExtendedKalmanFilter`](@ref)."
11931198
function print_details(io::IO, estim::ExtendedKalmanFilter)
11941199
println(io, "├ jacobian: $(backend_str(estim.jacobian))")
1200+
println(io, "├ direct: $(estim.direct)")
11951201
end
11961202

11971203
"Set `estim.cov.P̂` to `estim.cov.P̂_0` for the time-varying Kalman Filters."

src/estimator/luenberger.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ julia> model = LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 0.5);
8585
julia> estim = Luenberger(model, nint_ym=[1, 1], poles=[0.61, 0.62, 0.63, 0.64])
8686
Luenberger estimator with a sample time Ts = 0.5 s:
8787
├ model: LinModel
88+
├ direct: true
8889
└ dimensions:
8990
├ 1 manipulated inputs u (0 integrating states)
9091
├ 4 estimated states x̂

src/estimator/manual.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,7 @@ update_estimate!(::ManualEstimator, y0m, d0, u0) = nothing
155155
function setstate_cov!(::ManualEstimator, P̂)
156156
isnothing(P̂) || error("ManualEstimator does not compute an estimation covariance matrix P̂.")
157157
return nothing
158-
end
158+
end
159+
160+
"No details for `ManualEstimator`."
161+
print_details(::IO, ::ManualEstimator) = nothing

src/estimator/mhe.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function print_details(io::IO, estim::MovingHorizonEstimator)
99
println(io, "├ optimizer: $(JuMP.solver_name(estim.optim)) ")
1010
print_backends(io, estim, estim.model)
1111
println(io, "├ arrival covariance: $(nameof(typeof(estim.covestim))) ")
12+
println(io, "├ direct: $(estim.direct)")
1213
end
1314

1415
"Print the differentiation backends of `MovingHorizonEstimator` for `SimModel`."

src/estimator/mhe/construct.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ MovingHorizonEstimator estimator with a sample time Ts = 10.0 s:
328328
├ jacobian: AutoForwardDiff
329329
├ hessian: nothing
330330
├ arrival covariance: UnscentedKalmanFilter
331+
├ direct: true
331332
└ dimensions:
332333
├ 5 estimation steps He
333334
├ 0 slack variable ε (estimation constraints)
@@ -752,6 +753,7 @@ MovingHorizonEstimator estimator with a sample time Ts = 1.0 s:
752753
├ model: LinModel
753754
├ optimizer: OSQP
754755
├ arrival covariance: KalmanFilter
756+
├ direct: true
755757
└ dimensions:
756758
├ 3 estimation steps He
757759
├ 0 slack variable ε (estimation constraints)

src/state_estim.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ function Base.show(io::IO, estim::StateEstimator)
3737
println(io, "$(nameof(typeof(estim))) estimator with a sample time Ts = $(model.Ts) s:")
3838
println(io, "├ model: $(nameof(typeof(estim.model)))")
3939
print_details(io, estim)
40-
println(io, "├ direct: $(estim.direct)")
4140
println(io, "└ dimensions:")
4241
print_estim_dim(io, estim, n)
4342
end
4443

4544
"Return additional dimensions on `estim` if any, for adequate padding with spaces."
4645
get_other_dims(::StateEstimator) = tuple()
4746

48-
"Print additional details of `estim` if any (no details by default)."
49-
print_details(::IO, ::StateEstimator) = nothing
47+
"Print only the `estim.direct` field by default."
48+
function print_details(io::IO, estim::StateEstimator)
49+
println(io, "├ direct: $(estim.direct)")
50+
end
5051

5152
"Print the overall dimensions of the state estimator `estim` with left padding `n`."
5253
function print_estim_dim(io::IO, estim::StateEstimator, n)

0 commit comments

Comments
 (0)