Skip to content

Commit 58a5557

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 434ed1d + f27a284 commit 58a5557

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_predictive_control.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ end
392392
end
393393

394394
@testset "NonLinMPC moves and getinfo" begin
395-
linmodel = setop!(LinModel(tf(5, [200, 1]), 300.0), yop=[10])
395+
linmodel = setop!(LinModel(tf(5, [2000, 1]), 3000.0), yop=[10])
396396
nmpc_lin = NonLinMPC(linmodel, Nwt=[0], Hp=1000, Hc=1)
397397
r = [15]
398398
u = moveinput!(nmpc_lin, r)
@@ -410,10 +410,10 @@ end
410410
@test u [1] atol=5e-2
411411
# ensure that the current estimated output is updated for correct JE values:
412412
@test nmpc. ModelPredictiveControl.evalŷ(nmpc.estim, nothing, Float64[])
413-
linmodel2 = LinModel([tf(5, [200, 1]) tf(7, [800,1])], 300.0, i_d=[2])
413+
linmodel2 = LinModel([tf(5, [2000, 1]) tf(7, [8000,1])], 3000.0, i_d=[2])
414414
f(x,u,d) = linmodel2.A*x + linmodel2.Bu*u + linmodel2.Bd*d
415415
h(x,d) = linmodel2.C*x + linmodel2.Dd*d
416-
nonlinmodel = NonLinModel(f, h, 300.0, 1, 2, 1, 1)
416+
nonlinmodel = NonLinModel(f, h, 3000.0, 1, 2, 1, 1)
417417
nmpc2 = NonLinMPC(nonlinmodel, Nwt=[0], Hp=1000, Hc=1)
418418
d = [0.1]
419419
u = moveinput!(nmpc2, 7d, d)
@@ -437,14 +437,14 @@ end
437437
linmodel3 = LinModel{Float32}(0.5*ones(1,1), ones(1,1), ones(1,1), zeros(1,0), zeros(1,0), 1.0)
438438
nmpc6 = NonLinMPC(linmodel3, Hp=10)
439439
moveinput!(nmpc6, [0]) [0.0]
440-
nonlinmodel2 = NonLinModel{Float32}(f, h, 300.0, 1, 2, 1, 1)
440+
nonlinmodel2 = NonLinModel{Float32}(f, h, 3000.0, 1, 2, 1, 1)
441441
nmpc7 = NonLinMPC(nonlinmodel2, Hp=10)
442442
nonlinmodel2.h(Float32[0,0], Float32[0])
443443
moveinput!(nmpc7, [0], [0]) [0.0]
444444
end
445445

446446
@testset "NonLinMPC step disturbance rejection" begin
447-
linmodel = setop!(LinModel(tf(5, [200, 1]), 300.0), yop=[10])
447+
linmodel = setop!(LinModel(tf(5, [2000, 1]), 3000.0), yop=[10])
448448
r = [15]
449449
outdist = [5]
450450
nmpc_im = NonLinMPC(InternalModel(linmodel))
@@ -532,7 +532,7 @@ end
532532
end
533533

534534
@testset "NonLinMPC constraint violation" begin
535-
linmodel = LinModel(tf([2], [1000, 1]), 300.0)
535+
linmodel = LinModel(tf([2], [10000, 1]), 3000.0)
536536
nmpc_lin = NonLinMPC(linmodel, Hp=50, Hc=5)
537537

538538
setconstraint!(nmpc_lin, x̂min=[-1e3,-Inf], x̂max=[1e3,+Inf])

0 commit comments

Comments
 (0)