Skip to content

Commit 65a9887

Browse files
committed
idem
1 parent 88537b0 commit 65a9887

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ModelPredictiveControl
44
using ControlSystemsBase
55
using Documenter
66
using LinearAlgebra
7-
using JuMP
7+
using JuMP, OSQP, Ipopt
88
using Test
99

1010

test/test_predictive_control.jl

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ sys = [ tf(1.90,[18.0,1]) tf(1.90,[18.0,1]) tf(1.90,[18.0,1]);
99
@test size(mpc1.Ẽ,1) == 15*mpc1.estim.model.ny
1010
mpc2 = LinMPC(model, Hc=4, Cwt=Inf)
1111
@test size(mpc2.Ẽ,2) == 4*mpc2.estim.model.nu
12-
mpc3 = LinMPC(model, Hc=4, Cwt=1e5)
12+
mpc3 = LinMPC(model, Hc=4, Cwt=1e6)
1313
@test size(mpc3.Ẽ,2) == 4*mpc3.estim.model.nu + 1
14-
@test mpc3.C 1e5
14+
@test mpc3.C 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)
@@ -84,5 +84,20 @@ end
8484
nmpc1 = NonLinMPC(nonlinmodel, Hp=15)
8585
@test isa(nmpc1.estim, UnscentedKalmanFilter)
8686
@test size(nmpc1.R̂y, 1) == 15*nmpc1.estim.model.ny
87+
nmpc2 = NonLinMPC(nonlinmodel, Hc=4, Cwt=Inf)
88+
@test size(nmpc2.Ẽ, 2) == 4*nonlinmodel.nu
89+
nmpc3 = NonLinMPC(nonlinmodel, Hc=4, Cwt=1e6)
90+
@test size(nmpc3.Ẽ, 2) == 4*nonlinmodel.nu + 1
91+
@test nmpc3.C == 1e6
92+
93+
nmpc4 = NonLinMPC(nonlinmodel, Mwt=[1,2], Hp=15)
94+
@test nmpc4.M_Hp Diagonal(diagm(repeat(Float64[1, 2], 15)))
95+
nmpc5 = NonLinMPC(nonlinmodel, Nwt=[3,4], Cwt=1e3, Hc=5)
96+
@test nmpc5.Ñ_Hc Diagonal(diagm([repeat(Float64[3, 4], 5); [1e3]]))
97+
nmpc6 = NonLinMPC(nonlinmodel, Lwt=[0,1], ru=[0,50], Hp=15)
98+
@test nmpc6.L_Hp Diagonal(diagm(repeat(Float64[0, 1], 15)))
99+
@test nmpc6.R̂u repeat([0,50], 15)
100+
nmpc7 = NonLinMPC
101+
87102

88103
end

0 commit comments

Comments
 (0)