debug: force derivatives for first NLP iteration - #444
Conversation
It applies to `NonLinMPC`, `MovingHorizonEstimator` (excl. the QP case) and `NonLinModelDAE`. I try to automate to avoided a manual toggle like this in the past e.g. by initializing the buffers with `NaN` values (everything is different than a `NaN`). Also in #207. These solutions are just hacks in the end. It's much cleaner to create explicit toggles to force the update of all the derivatives at the first NLP iteration.
This is no longer need with the manual toggle
This is no longer needed with manual toggles
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #444 +/- ##
==========================================
- Coverage 96.93% 96.90% -0.04%
==========================================
Files 28 28
Lines 6600 6628 +28
==========================================
+ Hits 6398 6423 +25
- Misses 202 205 +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:
|
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
This reverts commit 984ef7a.
|
I will keep the hack of #207. It seems that it is still needed, at least according to my "unfilled window" test. It may be related to something else than the cache of the derivatives. I will investigate on this later, the important part is the derivative are always update at the first iteration of the NLP at each time step, and now it is the case. |
|
It seems that the servers for CI are down, let's wait tommorow. |
It applies to
NonLinMPC,MovingHorizonEstimator(excl. the QP case) andNonLinModelDAE.The derivatives was skipped at first NLP iteration too often, when they clearly should not be. The simple test based on differences on the decision vector does not work for the first NLP iteration. It does not consider the exogenous variables e.g. the current state estimate for
NonLinMPC.This bug was hitting A LOT with open-loop simulation of the new
NonLinModelDAE.I try to automate and avoid a manual toggle like this in the past e.g. by initializing the buffers with
NaNvalues (anything is different than aNaN, even aNaN). Also with the hack at #207.These solutions are just hacks in the end. It's much cleaner to create explicit toggles to force the update of all the derivatives at the first NLP iteration.