Skip to content

debug: force derivatives for first NLP iteration - #444

Merged
franckgaga merged 4 commits into
mainfrom
debug_force_diff
Sep 13, 2026
Merged

franckgaga merged 4 commits into
mainfrom
debug_force_diff

Conversation

@franckgaga

@franckgaga franckgaga commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

It applies to NonLinMPC, MovingHorizonEstimator (excl. the QP case) and NonLinModelDAE.

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 NaN values (anything is different than a NaN, even a NaN). 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.

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-commenter

codecov-commenter commented Sep 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.90%. Comparing base (fc06e8b) to head (4b946db).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/controller/nonlinmpc.jl 95.00% 1 Missing ⚠️
src/estimator/mhe/execute.jl 83.33% 1 Missing ⚠️
src/model/nonlinmodeldae.jl 91.66% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 96.90% <94.73%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

Benchmark Results (Julia v1)

Time benchmarks
main 984ef7a... main / 984ef7a...
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/DAQP/SingleShooting 5.76 ± 0.87 ms 5.75 ± 0.79 ms 1 ± 0.2
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/MultipleShooting 11.3 ± 0.7 ms 11.3 ± 0.69 ms 1.01 ± 0.087
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/SingleShooting 1.87 ± 0.034 ms 1.82 ± 0.031 ms 1.03 ± 0.026
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/DAQP/SingleShooting 5.23 ± 0.4 ms 5.29 ± 0.7 ms 0.988 ± 0.15
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/MultipleShooting 7.86 ± 0.94 ms 7.78 ± 0.93 ms 1.01 ± 0.17
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/SingleShooting 1.94 ± 0.028 ms 1.92 ± 0.022 ms 1.01 ± 0.019
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/DAQP/SingleShooting 10.2 ± 2 ms 10.2 ± 2 ms 1 ± 0.27
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/MultipleShooting 0.124 ± 0.029 s 0.123 ± 0.018 s 1.01 ± 0.28
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/SingleShooting 14.7 ± 2.1 ms 14.5 ± 2 ms 1.02 ± 0.2
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting 0.548 ± 0.0043 s 0.565 ± 0.027 s 0.97 ± 0.046
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting (Hessian) 1.04 ± 0.007 s 1.17 ± 0.15 s 0.892 ± 0.12
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/SingleShooting 1.64 ± 0.015 s 1.68 ± 0.055 s 0.977 ± 0.033
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation 0.876 ± 0.018 s 0.88 ± 0.0093 s 0.996 ± 0.023
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation (Hessian) 0.885 ± 0.028 s 0.889 ± 0.012 s 0.995 ± 0.035
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting 0.362 ± 0.002 s 0.357 ± 0.0022 s 1.01 ± 0.0084
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting (Hessian) 0.335 ± 0.0049 s 0.335 ± 0.013 s 0.999 ± 0.041
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation 0.54 ± 0.0087 s 0.521 ± 0.005 s 1.04 ± 0.019
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation (Hessian) 0.53 ± 0.015 s 0.521 ± 0.0047 s 1.02 ± 0.029
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting 0.533 ± 0.0028 s 0.55 ± 0.002 s 0.969 ± 0.0061
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting (Hessian) 0.186 ± 0.0046 s 0.192 ± 0.0047 s 0.964 ± 0.033
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation 0.339 ± 0.0023 s 0.335 ± 0.0049 s 1.01 ± 0.016
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation (Hessian) 0.28 ± 0.0011 s 0.282 ± 0.0013 s 0.994 ± 0.0059
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/MadNLP/SingleShooting (Hessian) 0.0803 ± 0.00075 s 0.0846 ± 0.0063 s 0.949 ± 0.072
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Uno/MultipleShooting (Hessian) 0.116 ± 0.0005 s 0.12 ± 0.0035 s 0.967 ± 0.028
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting 0.347 ± 0.0032 s 0.347 ± 0.0033 s 0.999 ± 0.013
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (Hessian) 0.323 ± 0.0055 s 0.315 ± 0.0033 s 1.03 ± 0.02
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (threaded) 0.368 ± 0.0044 s 0.369 ± 0.0059 s 0.996 ± 0.02
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation 0.592 ± 0.0027 s 0.588 ± 0.0034 s 1.01 ± 0.0074
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation (Hessian) 1.72 ± 0.022 s 1.76 ± 0.041 s 0.979 ± 0.026
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting 0.533 ± 0.0027 s 0.537 ± 0.0031 s 0.993 ± 0.0076
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting (Hessian) 0.181 ± 0.0014 s 0.187 ± 0.0013 s 0.964 ± 0.01
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation 0.34 ± 0.0028 s 0.343 ± 0.0014 s 0.991 ± 0.0093
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (Hessian) 0.257 ± 0.0011 s 0.261 ± 0.0012 s 0.984 ± 0.0062
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (threaded) 0.363 ± 0.0054 s 0.361 ± 0.0039 s 1.01 ± 0.019
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/MultipleShooting (Hessian) 0.196 ± 0.002 s 0.204 ± 0.0097 s 0.959 ± 0.047
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/SingleShooting (Hessian) 0.077 ± 0.0015 s 0.0809 ± 0.0036 s 0.952 ± 0.046
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Uno/MultipleShooting (Hessian) 0.101 ± 0.00083 s 0.104 ± 0.0033 s 0.974 ± 0.032
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Current form 0.0887 ± 0.015 s 0.0814 ± 0.0098 s 1.09 ± 0.22
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Prediction form 0.0631 ± 0.0078 s 0.057 ± 0.0099 s 1.11 ± 0.24
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Current form 0.081 ± 0.013 s 0.078 ± 0.0097 s 1.04 ± 0.21
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/MultipleShooting 0.0733 ± 0.022 s 0.0692 ± 0.021 s 1.06 ± 0.45
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Prediction form 0.0578 ± 0.0047 s 0.0536 ± 0.01 s 1.08 ± 0.22
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian) 0.0886 ± 0.0015 s 0.0958 ± 0.0015 s 0.924 ± 0.021
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian, MultipleShooting) 0.102 ± 0.00047 s 0.107 ± 0.0008 s 0.957 ± 0.0084
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian) 0.0873 ± 0.00046 s 0.0878 ± 0.00029 s 0.995 ± 0.0062
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian, MultipleShooting) 0.0982 ± 0.00042 s 0.102 ± 0.00089 s 0.958 ± 0.0093
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Current form (Hessian) 0.0464 ± 0.0014 s 0.048 ± 0.00031 s 0.966 ± 0.03
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Prediction form (Hessian) 0.0443 ± 0.00046 s 0.0456 ± 0.00048 s 0.972 ± 0.014
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian) 15.9 ± 1.3 ms 16.4 ± 0.16 ms 0.967 ± 0.079
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian, MultipleShooting) 21.7 ± 0.68 ms 21.5 ± 0.22 ms 1.01 ± 0.033
UNIT TESTS/PredictiveController/ExplicitMPC/moveinput! 3.76 ± 0.029 μs 3.36 ± 0.06 μs 1.12 ± 0.022
UNIT TESTS/PredictiveController/LinMPC/getinfo! 0.116 ± 0.0023 ms 0.117 ± 0.0023 ms 0.994 ± 0.028
UNIT TESTS/PredictiveController/LinMPC/moveinput!/MultipleShooting 0.137 ± 0.0099 ms 0.134 ± 0.01 ms 1.02 ± 0.11
UNIT TESTS/PredictiveController/LinMPC/moveinput!/SingleShooting 15.5 ± 0.29 μs 14.8 ± 0.29 μs 1.05 ± 0.029
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/LinModel 0.176 ± 0.025 ms 0.173 ± 0.023 ms 1.02 ± 0.2
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/NonLinModel 0.23 ± 0.022 ms 0.229 ± 0.018 ms 1 ± 0.12
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/MultipleShooting 0.899 ± 0.21 ms 0.899 ± 0.22 ms 1 ± 0.33
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/SingleShooting 0.468 ± 0.025 ms 0.475 ± 0.025 ms 0.985 ± 0.074
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShooting 10.3 ± 0.31 ms 10.5 ± 0.47 ms 0.98 ± 0.053
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShootingHessian 10.4 ± 0.26 ms 10.5 ± 0.34 ms 0.996 ± 0.041
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocation 9.4 ± 0.19 ms 10.2 ± 0.69 ms 0.919 ± 0.064
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocationHessian 8.95 ± 0.19 ms 9.43 ± 0.47 ms 0.948 ± 0.051
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShooting 5.53 ± 0.29 ms 7.16 ± 1.4 ms 0.773 ± 0.16
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShootingHessian 5.59 ± 0.23 ms 6.19 ± 0.11 ms 0.903 ± 0.04
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/TrapezoidalCollocation 7.28 ± 0.21 ms 7.7 ± 0.35 ms 0.945 ± 0.051
UNIT TESTS/SimModel/LinModel/evaloutput 0.13 ± 0.01 μs 0.14 ± 0.01 μs 0.929 ± 0.097
UNIT TESTS/SimModel/LinModel/updatestate! 0.21 ± 0.001 μs 0.21 ± 0.001 μs 1 ± 0.0067
UNIT TESTS/SimModel/NonLinModel/evaloutput 0.2 ± 0.01 μs 0.2 ± 0.01 μs 1 ± 0.071
UNIT TESTS/SimModel/NonLinModel/linearize! 1.21 ± 0.03 μs 1.22 ± 0.021 μs 0.992 ± 0.03
UNIT TESTS/SimModel/NonLinModel/updatestate! 0.26 ± 0.001 μs 0.28 ± 0.01 μs 0.929 ± 0.033
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/LinModel 0.211 ± 0.01 μs 0.231 ± 0.01 μs 0.913 ± 0.059
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/NonLinModel 0.661 ± 0.01 μs 0.661 ± 0.01 μs 1 ± 0.021
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/LinModel 0.14 ± 0.001 μs 0.14 ± 0 μs 1 ± 0.0071
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/NonLinModel 0.421 ± 0 μs 0.43 ± 0.01 μs 0.979 ± 0.023
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/LinModel 3.53 ± 0.04 μs 3.44 ± 0.041 μs 1.03 ± 0.017
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/NonLinModel 5.57 ± 0.061 μs 5.56 ± 0.069 μs 1 ± 0.017
UNIT TESTS/StateEstimator/InternalModel/evaloutput/LinModel 0.16 ± 0.001 μs 0.17 ± 0.001 μs 0.941 ± 0.0081
UNIT TESTS/StateEstimator/InternalModel/evaloutput/NonLinModel 0.261 ± 0.001 μs 0.281 ± 0.01 μs 0.929 ± 0.033
UNIT TESTS/StateEstimator/InternalModel/preparestate!/LinModel 0.241 ± 0.001 μs 0.26 ± 0.01 μs 0.927 ± 0.036
UNIT TESTS/StateEstimator/InternalModel/preparestate!/NonLinModel 0.461 ± 0.001 μs 0.471 ± 0.01 μs 0.979 ± 0.021
UNIT TESTS/StateEstimator/InternalModel/updatestate!/LinModel 0.451 ± 0.019 μs 0.441 ± 0.01 μs 1.02 ± 0.049
UNIT TESTS/StateEstimator/InternalModel/updatestate!/NonLinModel 0.941 ± 0.01 μs 0.942 ± 0.011 μs 0.999 ± 0.016
UNIT TESTS/StateEstimator/KalmanFilter/evaloutput 0.181 ± 0.01 μs 0.18 ± 0.001 μs 1.01 ± 0.056
UNIT TESTS/StateEstimator/KalmanFilter/preparestate! 0.07 ± 0.01 μs 0.07 ± 0.001 μs 1 ± 0.14
UNIT TESTS/StateEstimator/KalmanFilter/updatestate! 2.56 ± 0.04 μs 2.49 ± 0.03 μs 1.03 ± 0.02
UNIT TESTS/StateEstimator/Luenberger/evaloutput 0.181 ± 0.01 μs 0.18 ± 0.01 μs 1.01 ± 0.079
UNIT TESTS/StateEstimator/Luenberger/preparestate! 0.221 ± 0.01 μs 0.211 ± 0.01 μs 1.05 ± 0.069
UNIT TESTS/StateEstimator/Luenberger/updatestate! 0.36 ± 0.011 μs 0.361 ± 0.019 μs 0.997 ± 0.061
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/LinModel 0.446 ± 0.05 ms 0.303 ± 0.02 ms 1.47 ± 0.19
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/NonLinModel 0.474 ± 0.024 ms 0.408 ± 0.024 ms 1.16 ± 0.09
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Constant arr. cov. 26.5 ± 4.3 ms 23 ± 2.6 ms 1.15 ± 0.23
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Current form 28 ± 4 ms 24.6 ± 2.8 ms 1.14 ± 0.21
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/MultipleShooting 9.56 ± 9.8 ms 9.26 ± 9.3 ms 1.03 ± 1.5
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/Current form 0.322 ± 0.023 ms 0.312 ± 0.022 ms 1.03 ± 0.1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/MultipleShooting 0.704 ± 0.023 ms 0.717 ± 0.023 ms 0.982 ± 0.044
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/LinModel/Prediction form 22 ± 1.4 ms 20.8 ± 0.82 ms 1.06 ± 0.079
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/NonLinModel/Prediction form 0.337 ± 0.022 ms 0.34 ± 0.023 ms 0.99 ± 0.093
UNIT TESTS/StateEstimator/SteadyKalmanFilter/evaloutput 0.18 ± 0.001 μs 0.19 ± 0.011 μs 0.947 ± 0.055
UNIT TESTS/StateEstimator/SteadyKalmanFilter/preparestate! 0.231 ± 0.01 μs 0.221 ± 0.01 μs 1.05 ± 0.065
UNIT TESTS/StateEstimator/SteadyKalmanFilter/updatestate! 0.371 ± 0.019 μs 0.371 ± 0.011 μs 1 ± 0.059
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/LinModel 0.21 ± 0.001 μs 0.22 ± 0.011 μs 0.955 ± 0.048
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/NonLinModel 0.421 ± 0.01 μs 0.421 ± 0.01 μs 1 ± 0.034
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/LinModel 3.54 ± 0.03 μs 3.59 ± 0.02 μs 0.986 ± 0.01
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/NonLinModel 4.76 ± 0.039 μs 4.68 ± 0.03 μs 1.02 ± 0.011
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/LinModel 3.87 ± 0.03 μs 3.84 ± 0.02 μs 1.01 ± 0.0094
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/NonLinModel 5.72 ± 0.04 μs 5.88 ± 0.04 μs 0.973 ± 0.0095
time_to_load 3.53 ± 0.028 s 3.59 ± 0.024 s 0.985 ± 0.01
Memory benchmarks
main 984ef7a... main / 984ef7a...
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/DAQP/SingleShooting 0.0486 M allocs: 1.86 MB 0.0486 M allocs: 1.86 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/MultipleShooting 0.116 M allocs: 2.86 MB 0.116 M allocs: 2.86 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/SingleShooting 11.9 k allocs: 0.333 MB 11.9 k allocs: 0.333 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/DAQP/SingleShooting 0.0485 M allocs: 1.85 MB 0.0485 M allocs: 1.85 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/MultipleShooting 0.0812 M allocs: 2.02 MB 0.0812 M allocs: 2.02 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/SingleShooting 11.7 k allocs: 0.327 MB 11.7 k allocs: 0.327 MB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/DAQP/SingleShooting 0.128 M allocs: 6.8 MB 0.128 M allocs: 6.8 MB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/MultipleShooting 5.56 M allocs: 0.292 GB 5.56 M allocs: 0.292 GB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/SingleShooting 0.158 M allocs: 8.65 MB 0.157 M allocs: 8.64 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting 0.367 M allocs: 25.6 MB 0.367 M allocs: 29.6 MB 0.863
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting (Hessian) 2.18 M allocs: 0.242 GB 2.18 M allocs: 0.295 GB 0.818
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/SingleShooting 0.306 M allocs: 0.0435 GB 0.306 M allocs: 0.0697 GB 0.624
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation 2.17 M allocs: 0.213 GB 2.17 M allocs: 0.267 GB 0.799
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation (Hessian) 2.17 M allocs: 0.213 GB 2.17 M allocs: 0.267 GB 0.799
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting 0.314 M allocs: 22 MB 0.314 M allocs: 25.7 MB 0.856
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting (Hessian) 0.655 M allocs: 0.0742 GB 0.655 M allocs: 0.0916 GB 0.81
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation 1.3 M allocs: 0.118 GB 1.3 M allocs: 0.121 GB 0.976
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation (Hessian) 1.3 M allocs: 0.118 GB 1.3 M allocs: 0.121 GB 0.976
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting 0.0964 M allocs: 17.9 MB 0.0964 M allocs: 30.1 MB 0.595
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting (Hessian) 0.0811 M allocs: 17.1 MB 0.0811 M allocs: 28.3 MB 0.606
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation 0.312 M allocs: 21.8 MB 0.312 M allocs: 25.5 MB 0.856
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation (Hessian) 0.714 M allocs: 0.0723 GB 0.714 M allocs: 0.0908 GB 0.796
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/MadNLP/SingleShooting (Hessian) 0.0924 M allocs: 20.1 MB 0.0924 M allocs: 30.8 MB 0.655
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Uno/MultipleShooting (Hessian) 0.337 M allocs: 0.0361 GB 0.337 M allocs: 0.0441 GB 0.817
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting 0.275 M allocs: 19 MB 0.275 M allocs: 22.2 MB 0.857
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (Hessian) 0.715 M allocs: 0.0748 GB 0.715 M allocs: 0.0932 GB 0.802
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (threaded) 0.294 M allocs: 28.1 MB 0.294 M allocs: 31.3 MB 0.899
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation 1.4 M allocs: 0.127 GB 1.4 M allocs: 0.13 GB 0.976
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation (Hessian) 6.56 M allocs: 0.825 GB 6.56 M allocs: 0.875 GB 0.943
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting 0.0753 M allocs: 13.5 MB 0.0753 M allocs: 22.6 MB 0.597
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting (Hessian) 0.0807 M allocs: 17.1 MB 0.0807 M allocs: 28.2 MB 0.606
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation 0.274 M allocs: 19 MB 0.274 M allocs: 22.1 MB 0.857
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (Hessian) 0.718 M allocs: 0.066 GB 0.718 M allocs: 0.0848 GB 0.778
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (threaded) 0.293 M allocs: 28.1 MB 0.293 M allocs: 31.4 MB 0.894
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/MultipleShooting (Hessian) 0.576 M allocs: 0.0719 GB 0.576 M allocs: 0.0864 GB 0.832
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/SingleShooting (Hessian) 0.0925 M allocs: 20.2 MB 0.0925 M allocs: 30.8 MB 0.654
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Uno/MultipleShooting (Hessian) 0.332 M allocs: 0.0325 GB 0.332 M allocs: 0.0404 GB 0.804
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Current form 1.45 M allocs: 0.225 GB 1.45 M allocs: 0.225 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Prediction form 1.33 M allocs: 0.146 GB 1.33 M allocs: 0.146 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Current form 1.32 M allocs: 0.222 GB 1.32 M allocs: 0.222 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/MultipleShooting 3.55 M allocs: 0.198 GB 3.55 M allocs: 0.198 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Prediction form 1.24 M allocs: 0.143 GB 1.24 M allocs: 0.143 GB 1
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian) 0.0841 M allocs: 13.9 MB 0.0841 M allocs: 21.7 MB 0.641
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian, MultipleShooting) 0.172 M allocs: 21.9 MB 0.172 M allocs: 0.0319 GB 0.669
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian) 0.0843 M allocs: 13.9 MB 0.0843 M allocs: 21.7 MB 0.64
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian, MultipleShooting) 0.167 M allocs: 21.2 MB 0.167 M allocs: 31.6 MB 0.67
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Current form (Hessian) 0.104 M allocs: 17.5 MB 0.104 M allocs: 25.2 MB 0.693
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Prediction form (Hessian) 0.102 M allocs: 17 MB 0.102 M allocs: 24.6 MB 0.692
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian) 0.0363 M allocs: 5.43 MB 0.0363 M allocs: 8.44 MB 0.643
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian, MultipleShooting) 0.0709 M allocs: 7.57 MB 0.0709 M allocs: 10.9 MB 0.692
UNIT TESTS/PredictiveController/ExplicitMPC/moveinput! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/PredictiveController/LinMPC/getinfo! 0.312 k allocs: 15.2 kB 0.312 k allocs: 15.2 kB 1
UNIT TESTS/PredictiveController/LinMPC/moveinput!/MultipleShooting 1.49 k allocs: 0.0363 MB 1.49 k allocs: 0.0363 MB 1
UNIT TESTS/PredictiveController/LinMPC/moveinput!/SingleShooting 0.104 k allocs: 2.67 kB 0.104 k allocs: 2.67 kB 1
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/LinModel 0.4 k allocs: 0.0577 MB 0.4 k allocs: 0.0579 MB 0.996
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/NonLinModel 0.566 k allocs: 0.0771 MB 0.566 k allocs: 0.0772 MB 0.998
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/MultipleShooting 1.72 k allocs: 0.103 MB 1.72 k allocs: 0.103 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/SingleShooting 0.251 k allocs: 10 kB 0.251 k allocs: 10 kB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShooting 5.28 k allocs: 0.424 MB 5.28 k allocs: 0.537 MB 0.79
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShootingHessian 5.03 k allocs: 0.394 MB 5.08 k allocs: 0.495 MB 0.795
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocation 8.46 k allocs: 0.576 MB 8.71 k allocs: 0.644 MB 0.895
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocationHessian 0.0433 M allocs: 4.37 MB 0.0433 M allocs: 5.25 MB 0.832
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShooting 0.952 k allocs: 0.235 MB 0.952 k allocs: 0.413 MB 0.57
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShootingHessian 0.952 k allocs: 0.235 MB 0.952 k allocs: 0.413 MB 0.57
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/TrapezoidalCollocation 3.39 k allocs: 0.242 MB 3.54 k allocs: 0.303 MB 0.796
UNIT TESTS/SimModel/LinModel/evaloutput 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/SimModel/LinModel/updatestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/SimModel/NonLinModel/evaloutput 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/SimModel/NonLinModel/linearize! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/SimModel/NonLinModel/updatestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/LinModel 4 allocs: 0.0938 kB 4 allocs: 0.0938 kB 1
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/NonLinModel 4 allocs: 0.0938 kB 4 allocs: 0.0938 kB 1
UNIT TESTS/StateEstimator/InternalModel/evaloutput/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/InternalModel/evaloutput/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/InternalModel/preparestate!/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/InternalModel/preparestate!/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/InternalModel/updatestate!/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/InternalModel/updatestate!/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/KalmanFilter/evaloutput 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/KalmanFilter/preparestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/KalmanFilter/updatestate! 4 allocs: 0.0938 kB 4 allocs: 0.0938 kB 1
UNIT TESTS/StateEstimator/Luenberger/evaloutput 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/Luenberger/preparestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/Luenberger/updatestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/LinModel 1.35 k allocs: 0.0508 MB 1.35 k allocs: 0.0508 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/NonLinModel 2.4 k allocs: 0.293 MB 2.4 k allocs: 0.293 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Constant arr. cov. 9.03 k allocs: 0.674 MB 9.03 k allocs: 0.674 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Current form 9.03 k allocs: 0.674 MB 9.03 k allocs: 0.674 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/MultipleShooting 19.5 k allocs: 1 MB 19.5 k allocs: 1 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/Current form 0.955 k allocs: 24.8 kB 0.921 k allocs: 23.1 kB 1.07
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/MultipleShooting 1.77 k allocs: 0.043 MB 1.85 k allocs: 0.0467 MB 0.922
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/LinModel/Prediction form 8.33 k allocs: 0.513 MB 8.33 k allocs: 0.513 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/NonLinModel/Prediction form 0.955 k allocs: 24.8 kB 0.921 k allocs: 23.1 kB 1.07
UNIT TESTS/StateEstimator/SteadyKalmanFilter/evaloutput 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/SteadyKalmanFilter/preparestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/SteadyKalmanFilter/updatestate! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/LinModel 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/NonLinModel 0 allocs: 0 B 0 allocs: 0 B
time_to_load 0.201 k allocs: 11.8 kB 0.201 k allocs: 11.8 kB 1

@franckgaga

Copy link
Copy Markdown
Member Author

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.

@franckgaga

Copy link
Copy Markdown
Member Author

It seems that the servers for CI are down, let's wait tommorow.

@franckgaga
franckgaga merged commit 440a5d7 into main Sep 13, 2026
19 of 32 checks passed
@franckgaga
franckgaga deleted the debug_force_diff branch September 13, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants