Skip to content

Commit edd7e0f

Browse files
committed
changed: direct default to false for MHE
1 parent 9b2bece commit edd7e0f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/estimator/mhe/construct.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,11 @@ struct MovingHorizonEstimator{
107107
buffer::StateEstimatorBuffer{NT}
108108
function MovingHorizonEstimator{NT, SM, JM, CE}(
109109
model::SM, He, i_ym, nint_u, nint_ym, P̂_0, Q̂, R̂, Cwt, optim::JM, covestim::CE;
110-
direct=true
110+
direct=false
111111
) where {NT<:Real, SM<:SimModel{NT}, JM<:JuMP.GenericModel, CE<:StateEstimator{NT}}
112+
if direct
113+
throw(ArgumentError("MovingHorizonEstimator: direct=true is not implemented yet"))
114+
end
112115
nu, ny, nd = model.nu, model.ny, model.nd
113116
He < 1 && throw(ArgumentError("Estimation horizon He should be ≥ 1"))
114117
Cwt < 0 && throw(ArgumentError("Cwt weight should be ≥ 0"))
@@ -213,6 +216,10 @@ for details on the augmented process model and ``\mathbf{R̂}, \mathbf{Q̂}`` co
213216
`MethodError: no method matching (::var"##")(::Vector{ForwardDiff.Dual})`.
214217
215218
# Arguments
219+
!!! warning
220+
The keyword argument `direct` defaults to `false` for the `MovingHorizonEstimator`,
221+
since `direct=true` is not implemented yet.
222+
216223
- `model::SimModel` : (deterministic) model for the estimations.
217224
- `He=nothing` : estimation horizon ``H_e``, must be specified.
218225
- `Cwt=Inf` : slack variable weight ``C``, default to `Inf` meaning hard constraints only.
@@ -299,7 +306,7 @@ function MovingHorizonEstimator(
299306
sigmaQint_ym = fill(1, max(sum(nint_ym), 0)),
300307
Cwt::Real = Inf,
301308
optim::JM = default_optim_mhe(model),
302-
direct = true,
309+
direct = false,
303310
σP_0 = sigmaP_0,
304311
σQ = sigmaQ,
305312
σR = sigmaR,
@@ -340,7 +347,7 @@ supported types are [`KalmanFilter`](@ref), [`UnscentedKalmanFilter`](@ref) and
340347
function MovingHorizonEstimator(
341348
model::SM, He, i_ym, nint_u, nint_ym, P̂_0, Q̂, R̂, Cwt=Inf;
342349
optim::JM = default_optim_mhe(model),
343-
direct = true,
350+
direct = false,
344351
covestim::CE = default_covestim_mhe(model, i_ym, nint_u, nint_ym, P̂_0, Q̂, R̂; direct)
345352
) where {NT<:Real, SM<:SimModel{NT}, JM<:JuMP.GenericModel, CE<:StateEstimator{NT}}
346353
P̂_0, Q̂, R̂ = to_mat(P̂_0), to_mat(Q̂), to_mat(R̂)

0 commit comments

Comments
 (0)