8585
8686@testset " PredictiveController Plots" begin
8787 mpc = LinMPC (LinModel (sys, Ts, i_d= [3 ]), Lwt= [0.01 , 0.01 ])
88+ mpc = setconstraint! (mpc, umin= [- 50 , - 51 ], umax= [52 , 53 ], ŷmin= [- 54 ,- 55 ], ŷmax= [56 ,57 ])
89+ # TODO : ajouter des tests pour umin umax ŷmin ŷmax
8890 res = sim! (mpc, 15 )
8991 p1 = plot (res, plotŷ= true )
9092 @test p1[1 ][1 ][:x ] ≈ res. T_data
118120 @test p4[end - 2 ][2 ][:y ] ≈ res. X̂_data[4 ,:]
119121 @test p4[end - 1 ][1 ][:y ] ≈ res. X̂_data[5 ,:]
120122 @test p4[end - 0 ][1 ][:y ] ≈ res. X̂_data[6 ,:]
123+ p5 = plot (res, plotumin= true , plotumax= false , plotŷmin= false , plotŷmax= false )
124+ @test p5[1 ][1 ][:x ] ≈ res. T_data
125+ @test all (p5[end - 2 ][3 ][:y ] .≈ - 50.0 )
126+ @test all (p5[end - 1 ][3 ][:y ] .≈ - 51.0 )
127+ p6 = plot (res, plotumin= false , plotumax= true , plotŷmin= false , plotŷmax= false )
128+ @test p6[1 ][1 ][:x ] ≈ res. T_data
129+ @test all (p6[end - 2 ][3 ][:y ] .≈ 52.0 )
130+ @test all (p6[end - 1 ][3 ][:y ] .≈ 53.0 )
131+ p7 = plot (res, plotumin= false , plotumax= false , plotŷmin= true , plotŷmax= false )
132+ @test p7[1 ][1 ][:x ] ≈ res. T_data
133+ @test all (p7[end - 4 ][3 ][:y ] .≈ - 54.0 )
134+ @test all (p7[end - 3 ][3 ][:y ] .≈ - 55.0 )
135+ p8 = plot (res, plotumin= false , plotumax= false , plotŷmin= false , plotŷmax= true )
136+ @test p8[1 ][1 ][:x ] ≈ res. T_data
137+ @test all (p8[end - 4 ][3 ][:y ] .≈ 56.0 )
138+ @test all (p8[end - 3 ][3 ][:y ] .≈ 57.0 )
121139end
0 commit comments