Skip to content

Commit 49bbbd3

Browse files
committed
test: NonLinMPC construction with MultipleShooting
1 parent d5801a8 commit 49bbbd3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/3_test_predictive_control.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,14 @@ end
575575
LHS = zeros(1)
576576
nmpc15.con.gc!(LHS,[1,2],[3,4],[4,6],10,0.1)
577577
@test LHS [10*dot([1,2],[3,4])+sum([4,6])+0.1]
578+
nmpc16 = NonLinMPC(nonlinmodel, Hp=10, transcription=MultipleShooting())
579+
@test nmpc16.transcription == MultipleShooting()
580+
@test length(nmpc16.Z̃) == nonlinmodel.nu*nmpc16.Hc + nmpc16.estim.nx̂*nmpc16.Hp + nmpc16.
581+
@test nmpc16.con.neq == nmpc16.estim.nx̂*nmpc16.Hp
582+
nmpc17 = NonLinMPC(linmodel1, Hp=10, transcription=MultipleShooting())
583+
@test nmpc17.transcription == MultipleShooting()
584+
@test length(nmpc17.Z̃) == linmodel1.nu*nmpc17.Hc + nmpc17.estim.nx̂*nmpc17.Hp + nmpc17.
585+
@test size(nmpc17.con.Aeq, 1) == nmpc17.estim.nx̂*nmpc17.Hp
578586

579587
nonlinmodel2 = NonLinModel{Float32}(f, h, Ts, 2, 4, 2, 1, solver=nothing)
580588
nmpc15 = NonLinMPC(nonlinmodel2, Hp=15)

0 commit comments

Comments
 (0)