ModelPredictiveControl.jl v2.13.0
Ok, enough about AI debates! Let’s talk about human creations, documentation and API consumed by proper human developers.
Knowing that the v2.12.0 update added the support of OrthogonalCollocation for MovingHorizonEstimator, all the main blocks are now in place for supporting differential and algebraic equations (DAEs). Following up, the v2.12.0 update introduces a new NonLinModelDAE model type 


That being said, the package only supports open-loop simulations of NonLinModelDAE objects for now through evaloutput, updatestate! and sim! methods, hence:
DISCLAIMER
NonLinMPC and MovingHorizonEstimator currently do not support NonLinModelDAE objects.
I still wanted to make an announcement here since this is a huge step toward supporting acausal modeling tool like ModelingToolkit.jl more broadly, since they typically produces DAEs instead of ODEs. I would mention here that ODEs are insanely simpler in terms of algorithmic complexity, so a NonLinModel object for ODEs should be used when possible to reduce the dimensions and complexity (thanks to multiple dispatch!).
I also want some feedback on the API for this new type, see the link above. I want to know if you think it is clear and flexible enough. In short, the constructor expect this semi-explicit DAE:
\begin{aligned}
\mathbf{\dot{x}}(t) &= \mathbf{f}\Big( \mathbf{x}(t), \mathbf{a}(t), \mathbf{u}(t), \mathbf{d}(t), \mathbf{p} \Big) \\
\mathbf{0} &= \mathbf{q}\Big( \mathbf{x}(t), \mathbf{a}(t), \mathbf{u}(t), \mathbf{d}(t), \mathbf{p} \Big) \\
\mathbf{y}(t) &= \mathbf{h}\Big( \mathbf{x}(t), \mathbf{a}(t), \mathbf{d}(t), \mathbf{p} \Big)
\end{aligned}
in which \mathbf{x} is the differential state, \mathbf{a} is the algebraic variable (avoided “z” since already reserved for the decision variable \mathbf{Z}), \mathbf{u} is the manipulated input, \mathbf{d} is the measured disturbance, \mathbf{y} the output and \mathbf{p} the parameter. The function \mathbf{f} and \mathbf{q} are combined into one single Julia function fq!(ẋ, res, x, a, u, d, p) -> nothing to avoid redundant computations. Like all the other model types, the new type only support strictly proper systems w.r.t. \mathbf{u}, since otherwise there is a causality paradox in the flow of information for discrete control. That is why \mathbf{u} is not an argument of \mathbf{h}. I currently use JuMP.jl and Ipopt.jl as a root solver for the open-loop simulations since I did not want to add new unnecessary dependencies. That’s not the scope of the package, it’s closed-loop computations.
The changelog since my last post:
- added:
NonLinModelDAE for differential and algebraic equations + sim! support
- added:
OrthogonalCollocation
for MovingHorizonEstimator
- added: slightly reduce precompilation time
- debug: correctly fill nonlinear equality constraints for non-SingleShooting MovingHorizonEstimator
- doc: using the new DocumenterCodeBlocks.jl plugin
- test: migration to the new test item framework CI workflow
- test: added CI testing on MacOS AArch64
- test: added CI testing on Linux x86_64 (32-bit)