Skip to content

Commit f349e19

Browse files
committed
debug tests
1 parent 964a095 commit f349e19

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/controller/execute.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,14 @@ setstate!(mpc::PredictiveController, x̂) = (setstate!(mpc.estim, x̂); return m
529529
Set `model` and objective function weights of `mpc` [`PredictiveController`](@ref).
530530
531531
Allows model adaptation of controllers based on [`LinModel`](@ref) at runtime. Modification
532-
of [`NonLinModel`](@ref) is not supported. New weight matrices in the objective function can
533-
be specified with the keyword arguments (see [`LinMPC`](@ref) for the nomenclature). If
534-
`Cwt ≠ Inf`, the augmented move suppression weight is ``\mathbf{Ñ}_{H_c} = \mathrm{diag}(
535-
\mathbf{N}_{H_c}, C)``, else ``\mathbf{Ñ}_{H_c} = \mathbf{N}_{H_c}``. The [`StateEstimator`](@ref)
536-
`mpc.estim` cannot be a [`Luenberger`](@ref) observer or a [`SteadyKalmanFilter`](@ref) (the
537-
default estimator). Construct the `mpc` object with a time-varying [`KalmanFilter`](@ref)
538-
instead. Note that the model is constant over the prediction horizon ``H_p``.
532+
of [`NonLinModel`](@ref) state-space functions is not supported. New weight matrices in the
533+
objective function can be specified with the keyword arguments (see [`LinMPC`](@ref) for the
534+
nomenclature). If `Cwt ≠ Inf`, the augmented move suppression weight is ``\mathbf{Ñ}_{H_c} =
535+
\mathrm{diag}(\mathbf{N}_{H_c}, C)``, else ``\mathbf{Ñ}_{H_c} = \mathbf{N}_{H_c}``. The
536+
[`StateEstimator`](@ref) `mpc.estim` cannot be a [`Luenberger`](@ref) observer or a
537+
[`SteadyKalmanFilter`](@ref) (the default estimator). Construct the `mpc` object with a
538+
time-varying [`KalmanFilter`](@ref) instead. Note that the model is constant over the
539+
prediction horizon ``H_p``.
539540
540541
# Arguments
541542

src/estimator/execute.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ end
245245
Set `model` and covariance matrices of `estim` [`StateEstimator`](@ref).
246246
247247
Allows model adaptation of estimators based on [`LinModel`](@ref) at runtime. Modification
248-
of [`NonLinModel`](@ref) is not supported. New covariance matrices can be specified with the
249-
keyword arguments (see [`SteadyKalmanFilter`](@ref) documentation for the nomenclature). Not
250-
supported by [`Luenberger`](@ref) and [`SteadyKalmanFilter`](@ref), use the time-varying
251-
[`KalmanFilter`](@ref) instead. The [`MovingHorizonEstimator`](@ref) model is kept constant
252-
over the estimation horizon ``H_e``. The matrix dimensions and sample time must stay the
253-
same. Note that the observability and controllability of the new augmented model is not
254-
verified (see Extended Help for more info).
248+
of [`NonLinModel`](@ref) state-space functions is not supported. New covariance matrices can
249+
be specified with the keyword arguments (see [`SteadyKalmanFilter`](@ref) documentation for
250+
the nomenclature). Not supported by [`Luenberger`](@ref) and [`SteadyKalmanFilter`](@ref),
251+
use the time-varying [`KalmanFilter`](@ref) instead. The [`MovingHorizonEstimator`](@ref)
252+
model is kept constant over the estimation horizon ``H_e``. The matrix dimensions and sample
253+
time must stay the same. Note that the observability and controllability of the new
254+
augmented model is not verified (see Extended Help for more info).
255255
256256
# Arguments
257257

test/test_predictive_control.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sys = [ tf(1.90,[1800.0,1]) tf(1.90,[1800.0,1]) tf(1.90,[1800.0,1]);
1111
@test size(mpc2.Ẽ,2) == 4*mpc2.estim.model.nu
1212
mpc3 = LinMPC(model, Hc=4, Cwt=1e6)
1313
@test size(mpc3.Ẽ,2) == 4*mpc3.estim.model.nu + 1
14-
@test mpc3.C 1e6
14+
@test mpc3.Ñ_Hc[end] 1e6
1515
mpc4 = LinMPC(model, Mwt=[1,2], Hp=15)
1616
@test mpc4.M_Hp Diagonal(diagm(repeat(Float64[1, 2], 15)))
1717
mpc5 = LinMPC(model, Nwt=[3,4], Cwt=1e3, Hc=5)
@@ -437,7 +437,7 @@ end
437437
@test size(nmpc2.Ẽ, 2) == 4*nonlinmodel.nu
438438
nmpc3 = NonLinMPC(nonlinmodel, Hp=15, Hc=4, Cwt=1e6)
439439
@test size(nmpc3.Ẽ, 2) == 4*nonlinmodel.nu + 1
440-
@test nmpc3.C == 1e6
440+
@test nmpc3.Ñ_Hc[end] == 1e6
441441
nmpc4 = NonLinMPC(nonlinmodel, Hp=15, Mwt=[1,2])
442442
@test nmpc4.M_Hp Diagonal(diagm(repeat(Float64[1, 2], 15)))
443443
nmpc5 = NonLinMPC(nonlinmodel, Hp=15 ,Nwt=[3,4], Cwt=1e3, Hc=5)

0 commit comments

Comments
 (0)