Skip to content

Commit 8035e29

Browse files
committed
test: debug MultipleShooting move input test for LinMPC
1 parent c4a2c6d commit 8035e29

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/3_test_predictive_control.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@ end
8686
preparestate!(mpc4, [0])
8787
moveinput!(mpc4, [0]) [0.0]
8888
@test_nowarn ModelPredictiveControl.info2debugstr(info)
89-
mpc5 = LinMPC(linmodel, Hp=1000, Hc=10, transcription=MultipleShooting())
90-
preparestate!(mpc5, [0])
91-
u = moveinput!(mpc5, [1])
92-
@test u [0.2]
93-
# info = getinfo(mpc5)
94-
# info[:u] ≈ [0.2]
89+
mpc5 = LinMPC(linmodel, Hp=1000, Hc=1, transcription=MultipleShooting())
90+
preparestate!(mpc5, [10])
91+
r = [15]
92+
u = moveinput!(mpc5, r)
93+
@test u [0.2] atol=1e-2
94+
info = getinfo(mpc5)
95+
@test info[:u] [1]
96+
@test info[:Ŷ][end] 15
9597

9698
@test_throws DimensionMismatch moveinput!(mpc1, [0,0,0])
9799
@test_throws DimensionMismatch moveinput!(mpc1, [0], [0,0])

0 commit comments

Comments
 (0)