ModelPredictiveControl v1.5.0
An update to announce the migration to DifferentiationInterface.jl. Many thanks to @gdalle for all the help!
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
andjacobian
keyword arguments forNonLinMPC
- added: new
gradient
andjacobian
keyword arguments forMovingHorizonEstimator
- added: new
jacobian
keyword argument forNonLinModel
(for linearization) - added: new
jacobian
keyword argument forExtendedKalmanFilter
- added:
ExtendedKalmanFilter
is now allocation-free at runtime - changed: deprecate
preparestate!(::SimModel,_,_)
, replaced bypreparestate!(::SimModel)
- debug: nonlinear inequality constraint with
MultipleShooting
now work as expected (custom + output + terminal constraints) - debug:
x_noise
argument insim!
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.