Skip to content

Commit a5cde6c

Browse files
committed
test: new test covering setmodel! with MultipleShooting
1 parent c1fa2de commit a5cde6c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/3_test_predictive_control.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,17 @@ end
436436
@test mpc.weights.M_Hp diagm(1:1000)
437437
@test mpc.weights.Ñ_Hc diagm([0.1;1e6])
438438
@test mpc.weights.L_Hp diagm(1.1:1000.1)
439+
440+
estim2 = KalmanFilter(LinModel(tf(5, [2, 1]), 3))
441+
mpc_ms = LinMPC(estim2, Nwt=[0], Hp=1000, Hc=1, transcription=MultipleShooting())
442+
r = [15]
443+
preparestate!(mpc_ms, [0])
444+
u = moveinput!(mpc_ms, r)
445+
@test u [3] atol=1e-2
446+
setmodel!(mpc_ms, LinModel(tf(10, [2, 1]), 3))
447+
r = [40]
448+
u = moveinput!(mpc_ms, r)
449+
@test u [4] atol=1e-2
439450
end
440451

441452
@testitem "LinMPC real-time simulations" setup=[SetupMPCtests] begin

0 commit comments

Comments
 (0)