@@ -724,10 +724,12 @@ end
724724 @test size (nmpc17. con. Aeq, 1 ) == nmpc17. estim. nx̂* nmpc17. Hp
725725 nmpc18 = NonLinMPC (nonlinmodel, Hp= 10 ,
726726 gradient= AutoFiniteDiff (),
727- jacobian= AutoFiniteDiff ()
727+ jacobian= AutoFiniteDiff (),
728+ hessian= AutoFiniteDiff ()
728729 )
729730 @test nmpc18. gradient == AutoFiniteDiff ()
730731 @test nmpc18. jacobian == AutoFiniteDiff ()
732+ @test nmpc18. hessian == AutoFiniteDiff ()
731733
732734 nonlinmodel2 = NonLinModel {Float32} (f, h, Ts, 2 , 4 , 2 , 1 , solver= nothing )
733735 nmpc15 = NonLinMPC (nonlinmodel2, Hp= 15 )
742744 @test_throws ErrorException NonLinMPC (nonlinmodel, Hp= 15 , gc! = (_,_,_,_)-> [0.0 ], nc= 1 )
743745 @test_throws ArgumentError NonLinMPC (nonlinmodel, transcription= TrapezoidalCollocation ())
744746 @test_throws ArgumentError NonLinMPC (nonlinmodel, transcription= TrapezoidalCollocation (2 ))
747+ @test_throws ErrorException NonLinMPC (linmodel1, oracle= false , hessian= AutoFiniteDiff ())
745748
746749 @test_logs (:warn , Regex (" .*" )) NonLinMPC (nonlinmodel, Hp= 15 , JE= (Ue,_,_,_)-> Ue)
747750 @test_logs (:warn , Regex (" .*" )) NonLinMPC (nonlinmodel, Hp= 15 , gc= (Ue,_,_,_,_)-> Ue, nc= 0 )
856859 nmpc10 = setconstraint! (NonLinMPC (
857860 nonlinmodel, Nwt= [0 ], Hp= 100 , Hc= 1 ,
858861 gradient= AutoFiniteDiff (),
859- jacobian= AutoFiniteDiff ()),
862+ jacobian= AutoFiniteDiff (),
863+ hessian= true ),
860864 ymax= [100 ], ymin= [- 100 ]
861865 )
862866 preparestate! (nmpc10, [0 ], [0 ])
0 commit comments