|
728 | 728 | @test_throws ErrorException NonLinMPC(nonlinmodel, Hp=15, gc = (_,_,_,_)->[0.0], nc=1) |
729 | 729 | @test_throws ErrorException NonLinMPC(nonlinmodel, Hp=15, gc! = (_,_,_,_)->[0.0], nc=1) |
730 | 730 | @test_throws ArgumentError NonLinMPC(nonlinmodel, transcription=TrapezoidalCollocation()) |
| 731 | + @test_throws ArgumentError NonLinMPC(nonlinmodel, transcription=TrapezoidalCollocation(2)) |
731 | 732 |
|
732 | 733 | @test_logs (:warn, Regex(".*")) NonLinMPC(nonlinmodel, Hp=15, JE=(Ue,_,_,_)->Ue) |
733 | 734 | @test_logs (:warn, Regex(".*")) NonLinMPC(nonlinmodel, Hp=15, gc=(Ue,_,_,_,_)->Ue, nc=0) |
|
806 | 807 | preparestate!(nmpc5, [0.0]) |
807 | 808 | u = moveinput!(nmpc5, [1/0.001]) |
808 | 809 | @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 |
809 | 814 | nmpc6 = NonLinMPC(linmodel3, Hp=10) |
810 | 815 | preparestate!(nmpc6, [0]) |
811 | 816 | @test moveinput!(nmpc6, [0]) ≈ [0.0] atol=5e-2 |
|
0 commit comments