|
854 | 854 | end |
855 | 855 |
|
856 | 856 | @testset "NonLinMPC set model" begin |
857 | | - estim = KalmanFilter(setop!(LinModel(tf(5, [2, 1]), 3), yop=[10], uop=[1])) |
| 857 | + estim = KalmanFilter(setop!(LinModel(tf(5, [200, 1]), 300), yop=[10], uop=[1])) |
858 | 858 | mpc = NonLinMPC(estim, Nwt=[0], Cwt=1e4, Hp=1000, Hc=1) |
859 | 859 | mpc = setconstraint!(mpc, umin=[-24], umax=[26]) |
860 | 860 | mpc = setconstraint!(mpc, ymin=[-54], ymax=[56]) |
|
868 | 868 | preparestate!(mpc, [10]) |
869 | 869 | u = moveinput!(mpc, r) |
870 | 870 | @test u ≈ [2] atol=1e-2 |
871 | | - setmodel!(mpc, setop!(LinModel(tf(5, [2, 1]), 3), yop=[20], uop=[11])) |
| 871 | + setmodel!(mpc, setop!(LinModel(tf(5, [200, 1]), 300), yop=[20], uop=[11])) |
872 | 872 | @test mpc.Yop ≈ fill(20.0, 1000) |
873 | 873 | @test mpc.Uop ≈ fill(11.0, 1000) |
874 | 874 | @test mpc.con.U0min ≈ fill(-24.0 - 1 + 1 - 11, 1000) |
|
878 | 878 | r = [40] |
879 | 879 | u = moveinput!(mpc, r) |
880 | 880 | @test u ≈ [15] atol=1e-2 |
881 | | - setmodel!(mpc, setop!(LinModel(tf(10, [2, 1]), 3), yop=[20], uop=[11])) |
| 881 | + setmodel!(mpc, setop!(LinModel(tf(10, [200, 1]), 300), yop=[20], uop=[11])) |
882 | 882 | r = [40] |
883 | 883 | u = moveinput!(mpc, r) |
884 | 884 | @test u ≈ [13] atol=1e-2 |
|
0 commit comments