916916 nonlinmodel = setop! (nonlinmodel, uop= [10 ,50 ], yop= [50 ,30 ], dop= [5 ])
917917
918918 mhe1 = MovingHorizonEstimator (nonlinmodel, He= 2 )
919+ JuMP. set_attribute (mhe1. optim, " tol" , 1e-7 )
919920 preparestate! (mhe1, [50 , 30 ], [5 ])
920921 x̂ = updatestate! (mhe1, [10 , 50 ], [50 , 30 ], [5 ])
921922 @test x̂ ≈ zeros (6 ) atol= 1e-9
944945 @test mhe1 ([5 ]) ≈ [51 , 32 ] atol= 1e-3
945946
946947 mhe1 = MovingHorizonEstimator (nonlinmodel, He= 2 , nint_u= [1 , 1 ], nint_ym= [0 , 0 ], direct= false )
948+ JuMP. set_attribute (mhe1. optim, " tol" , 1e-7 )
947949 preparestate! (mhe1, [50 , 30 ], [5 ])
948950 x̂ = updatestate! (mhe1, [10 , 50 ], [50 , 30 ], [5 ])
949951 @test x̂ ≈ zeros (6 ) atol= 1e-9
@@ -1065,7 +1067,8 @@ end
10651067 updatestate! (mhe1, [0.0 ], y)
10661068 updatestate! (model, [0.1 ])
10671069 end
1068- @test mhe1 () ≈ model () atol = 1e-9
1070+ preparestate! (mhe1, model ())
1071+ @test mhe1 () ≈ model () atol = 1e-6
10691072 model = NonLinModel (f, h, 10.0 , 1 , 1 , 1 , solver= nothing )
10701073 mhe2 = MovingHorizonEstimator (model, nint_u= [1 ], He= 3 , direct= false )
10711074 for i = 1 : 40
@@ -1074,7 +1077,8 @@ end
10741077 updatestate! (mhe2, [0.0 ], y)
10751078 updatestate! (model, [0.1 ])
10761079 end
1077- @test mhe2 () ≈ model () atol = 1e-9
1080+ preparestate! (mhe2, model ())
1081+ @test mhe2 () ≈ model () atol = 1e-6
10781082end
10791083
10801084@testitem " MovingHorizonEstimator fallbacks for arrival covariance estimation" setup= [SetupMPCtests] begin
0 commit comments