[ANN] ModelPredictiveControl.jl

ModelPredictiveControl v1.5.0

An update to announce the migration to DifferentiationInterface.jl. Many thanks to @gdalle for all the help! :grinning_face_with_smiling_eyes:

In addition to a simpler and more maintainable codebase, it allows to switch the differentiation backend for gradients and Jacobians inside NonLinMPC, MovingHorizonEstimator, linearize and ExtendedKalmanFilter. Sparse Jacobians are also supported with AutoSparse. Dense ForwardDiff.jl computation are used everywhere by default, except for the MultipleShooting transcription that uses sparse computations. Note that for small problems like the inverted pendulum with H_p=20 and H_c=2, dense Jacobians may be slightly faster than sparse matrices, even with a MultipleShooting transcription. At least, that’s what I benchmarked for this case study.

Note that the implementation rely on the Cache feature of DI.jl to reduce the allocations, and some backend does not support it for now.

The change log since my last post is:

  • added: migration to DifferentiationInterface.jl
  • added: new gradient and jacobian keyword arguments for NonLinMPC
  • added: new gradient and jacobian keyword arguments for MovingHorizonEstimator
  • added: new jacobian keyword argument for NonLinModel (for linearization)
  • added: new jacobian keyword argument for ExtendedKalmanFilter
  • added: ExtendedKalmanFilter is now allocation-free at runtime
  • changed: deprecate preparestate!(::SimModel,_,_), replaced by preparestate!(::SimModel)
  • debug: nonlinear inequality constraint with MultipleShooting now work as expected (custom + output + terminal constraints)
  • debug: x_noise argument in sim! now works as expected
  • doc: now using DocumenterInterLinks.jl to ease the maintenance
  • test: many new test with AutoFiniteDiff backend
  • test: new test to cover nonlinear inequality constraint with MultipleShooting corner cases

I will release the update soon.

10 Likes