Skip to content

Commit 632b909

Browse files
committed
test: new tests with TrapezoidalCollocation(1)
1 parent d7638b4 commit 632b909

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/3_test_predictive_control.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ end
728728
@test_throws ErrorException NonLinMPC(nonlinmodel, Hp=15, gc = (_,_,_,_)->[0.0], nc=1)
729729
@test_throws ErrorException NonLinMPC(nonlinmodel, Hp=15, gc! = (_,_,_,_)->[0.0], nc=1)
730730
@test_throws ArgumentError NonLinMPC(nonlinmodel, transcription=TrapezoidalCollocation())
731+
@test_throws ArgumentError NonLinMPC(nonlinmodel, transcription=TrapezoidalCollocation(2))
731732

732733
@test_logs (:warn, Regex(".*")) NonLinMPC(nonlinmodel, Hp=15, JE=(Ue,_,_,_)->Ue)
733734
@test_logs (:warn, Regex(".*")) NonLinMPC(nonlinmodel, Hp=15, gc=(Ue,_,_,_,_)->Ue, nc=0)
@@ -806,6 +807,10 @@ end
806807
preparestate!(nmpc5, [0.0])
807808
u = moveinput!(nmpc5, [1/0.001])
808809
@test u [1.0] atol=5e-2
810+
nmpc5_1 = NonLinMPC(nonlinmodel_c, Nwt=[0], Hp=100, Hc=1, transcription=TrapezoidalCollocation(1))
811+
preparestate!(nmpc5_1, [0.0])
812+
u = moveinput!(nmpc5_1, [1/0.001])
813+
@test u [1.0] atol=5e-2
809814
nmpc6 = NonLinMPC(linmodel3, Hp=10)
810815
preparestate!(nmpc6, [0])
811816
@test moveinput!(nmpc6, [0]) [0.0] atol=5e-2

0 commit comments

Comments
 (0)