Repository navigation
added: FOH discretization for RungeKutta in MPC/MHE and in updatestate!(::SimModel) - #495
Conversation
This is truly the left limit at the next time step. If current and next values are identical, it's ZOH discretization, if they are different, it's FOH discretization.
It has the advantage that it creates an abstraction for `InternalModel`, in which the state vector is never augmented.
This is expected since now `d` are FOH discretized in MHE but not in EKF, so a small differences in the results. I may add the support for FOH in EKF later, but not super useful in practice since non-causal.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #495 +/- ##
==========================================
+ Coverage 97.25% 97.33% +0.08%
==========================================
Files 28 28
Lines 6995 7093 +98
==========================================
+ Hits 6803 6904 +101
+ Misses 192 189 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Okay, all the MPC/MHE benchmark with |
RungeKutta in MPC/MHE and updatestate!(::SimModel)RungeKutta in MPC/MHE and in updatestate!(::SimModel)
The buffer is used in the returned value of `updatestate!`. Using it in `getinfo` would mutate the output argument of `updatestate!` unexpectedly!
It allows tracking the allocations of `RungeKutta` on the benchmark suite. It should be 0 allocation.
|
I added a special path for |
|
I'm not able to reproduce locally on fedora... Seems like noise. edit: Let's try to remove the |
ALso improve coverage of `InternalModel`
To avoid a clash creating method ambiguities
FOH for disturbances d in MPC/MHE with
ShootingMethodsThe$\mathbf{d}$ with first-order hold (FOH, or piecewise linear), instead of the simpler zero-order hold (ZOH). It is more adapted for sampled continuous signal, which is usually the case for measured disturbances. The feedforward compensation can be therefore slightly improved by this.
NonLinMPCand theMovingHorizonEstimatortranscribed withSingleShootingandMultipleShootinget solved withRungeKuttanow discretize the measured disturbancesFOH for inputs u in MPC/MHE with
ShootingMethodsIt is also possible to discretized the manipulated inputs$\mathbf{u}$ with FOH in MPC and MHE by using the
SingleShooting(1)orMultipleShooting(1). The default is still ZOH for manipulated inputs.FOH for
updatestate!(::SimModel)It's now possible to simulate a$\mathbf{u}$ and $\mathbf{d}$ , using the new
NonLinModelandNonLinModelDAEwith FOH discretization on inputsunextanddnextkeyword argument. Note that it's information about the future, so this is non-causal. It is still useful in practice since FOH measured disturbances is slightly more realistic that the default ZOH, even if it is non-causal (no discontinuities in the signal). Doing so also remove the annoying plant-model mistmatch between theMovingHorizonEstimatorandNonLinMPCwith a FOH discretization and the simulated plant.Warning
FOH discretization for
updatestate!(::StateEstimator)is not supported (there are no keyword arguments in this method). First, it leads to a non-causal filter, so not so useful in practice. Second, it significantly complexify the codebase, especially forMovingHorizonEstimatorso I left this out of the scope for now. Still not sure if it is worth the effort.Closes #469