@@ -1001,13 +1001,24 @@ end
1001
1001
info = getinfo (nmpc)
1002
1002
@test all (isapprox .(info[:Ŷ ], 3.14 ; atol= 1e-1 ))
1003
1003
@test all (isapprox .(info[:gc ][Hp+ 1 : end ], 0.0 ; atol= 1e-1 ))
1004
-
1004
+
1005
1005
nmpc_ms = NonLinMPC (
1006
1006
nonlinmodel; Hp, Hc= 5 , transcription= MultipleShooting (), gc, nc= 2 Hp, p= [0 ; 0 ]
1007
1007
)
1008
1008
1009
+ setconstraint! (nmpc_ms, x̂min= [- 1e6 ,- Inf ], x̂max= [+ 1e6 ,+ Inf ])
1010
+ setconstraint! (nmpc_ms, ymin= [- 100 ], ymax= [100 ])
1009
1011
preparestate! (nmpc_ms, [0 ])
1010
1012
1013
+ setconstraint! (nmpc_ms, ymin= [- 0.5 ], ymax= [0.9 ])
1014
+ moveinput! (nmpc_ms, [- 100 ])
1015
+ info = getinfo (nmpc_ms)
1016
+ @test all (isapprox .(info[:Ŷ ], - 0.5 ; atol= 1e-1 ))
1017
+ moveinput! (nmpc_ms, [100 ])
1018
+ info = getinfo (nmpc_ms)
1019
+ @test all (isapprox .(info[:Ŷ ], 0.9 ; atol= 1e-1 ))
1020
+ setconstraint! (nmpc_ms, ymin= [- 100 ], ymax= [100 ])
1021
+
1011
1022
setconstraint! (nmpc_ms, x̂min= [- 1e-6 ,- Inf ], x̂max= [+ 1e-6 ,+ Inf ])
1012
1023
moveinput! (nmpc_ms, [- 10 ])
1013
1024
info = getinfo (nmpc_ms)
0 commit comments