Skip to content

added: 📐 OrthogonalCollocation 📐 for MovingHorizonEstimator - #427

Merged
franckgaga merged 41 commits into
mainfrom
orthocolloc_mhe
Aug 13, 2026
Merged

added: 📐 OrthogonalCollocation 📐 for MovingHorizonEstimator#427
franckgaga merged 41 commits into
mainfrom
orthocolloc_mhe

Conversation

@franckgaga

@franckgaga franckgaga commented Aug 12, 2026

Copy link
Copy Markdown
Member

This PR add the support for OrthogonalCollocation transcriptions in the MovingHorizonEstimator. The number of collocation points no is also now pretty-printed, to elaborate a little bit on the number of nonlinear equality constraints geq (equal to He*no*nx, that is, excluding the integrating states):

MovingHorizonEstimator estimator with a sample time Ts = 0.1 s:
├ model: NonLinModel
├ optimizer: Ipopt 
├ transcription: OrthogonalCollocation (3 collocation points)        # <-- new info here in the brackets !!!
├ gradient: AutoForwardDiff
├ jacobian: AutoSparse (AutoForwardDiff, TracerSparsityDetector, GreedyColoringAlgorithm)
├ hessian: AutoSparse (AutoForwardDiff, TracerSparsityDetector, GreedyColoringAlgorithm)
├ arrival covariance: UnscentedKalmanFilter 
├ direct: true
└ dimensions:
  │ ├ 3 estimation steps He
  │ ├ 1 manipulated inputs u (1 integrating states)
  │ ├ 3 estimated states x̂
  │ ├ 1 measured outputs ym (0 integrating states)
  │ ├ 0 unmeasured outputs yu
  │ └ 0 measured disturbances d
  └ optimization:
    ├ 39 decision variables Z̃ (0 slack variable, 0 bounds)
    ├  0 linear inequality constraints A
    ├  9 linear equality constraints Aeq
    ├  6 nonlinear inequality constraints g (0 custom)
    └ 18 nonlinear equality constraints geq

There is a new "Internal -> Miscellaneous" section in the documentation. The internal details about the orthogonal collocation is now centralized there (it is now both relevant the the state estimators and the predictive controllers). The estimated process noise $\mathbf{\hat{w}}$ of the MHE is incorporated in the linear continuity constraint, effectively treating it as a discrete stochastic process (like all the other Kalman filters in the package). Here's a preview of the new section:

image image image

Finite elements would be additional subdivisions, AFAIK.
Both are kinda valid, but I think I prefer with a hat, to convey that it all comes from a state estimator at the fundamental level, and also that they are predictions in the future for the MPC.
@franckgaga franckgaga linked an issue Aug 12, 2026 that may be closed by this pull request
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.37%. Comparing base (2d34426) to head (5c13983).
⚠️ Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
src/estimator/mhe/transcription.jl 97.27% 4 Missing ⚠️
src/estimator/mhe/execute.jl 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #427      +/-   ##
==========================================
+ Coverage   98.36%   98.37%   +0.01%     
==========================================
  Files          29       29              
  Lines        6229     6353     +124     
==========================================
+ Hits         6127     6250     +123     
- Misses        102      103       +1     

☔ 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 5c13983... main / 5c13983...
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/DAQP/SingleShooting 2.62 ± 0.19 ms 2.77 ± 0.26 ms 0.945 ± 0.11
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/MultipleShooting 6.1 ± 0.42 ms 6.49 ± 0.48 ms 0.94 ± 0.095
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/SingleShooting 1.06 ± 0.044 ms 1.12 ± 0.052 ms 0.946 ± 0.059
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/DAQP/SingleShooting 2.57 ± 0.17 ms 2.77 ± 0.24 ms 0.926 ± 0.1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/MultipleShooting 4.26 ± 0.16 ms 4.55 ± 0.32 ms 0.936 ± 0.075
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/SingleShooting 1.13 ± 0.035 ms 1.21 ± 0.047 ms 0.928 ± 0.046
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/DAQP/SingleShooting 4.77 ± 0.73 ms 5.06 ± 0.8 ms 0.944 ± 0.21
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/MultipleShooting 0.0802 ± 0.012 s 0.0848 ± 0.0061 s 0.945 ± 0.16
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/SingleShooting 7.33 ± 1 ms 7.76 ± 1.1 ms 0.945 ± 0.19
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting 0.283 ± 0.00056 s 0.3 ± 0.0015 s 0.942 ± 0.0052
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting (Hessian) 0.581 ± 0.0018 s 0.602 ± 0.0022 s 0.965 ± 0.0046
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/SingleShooting 0.86 ± 0.0019 s 0.926 ± 0.0035 s 0.929 ± 0.004
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation 0.464 ± 0.0028 s 0.483 ± 0.0017 s 0.96 ± 0.0067
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation (Hessian) 0.464 ± 0.00099 s 0.483 ± 0.0021 s 0.961 ± 0.0046
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting 0.197 ± 0.00034 s 0.204 ± 0.00059 s 0.966 ± 0.0033
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting (Hessian) 0.192 ± 0.0012 s 0.2 ± 0.00067 s 0.959 ± 0.0069
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation 0.293 ± 0.0019 s 0.303 ± 0.0012 s 0.967 ± 0.0074
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation (Hessian) 0.294 ± 0.0019 s 0.304 ± 0.0019 s 0.966 ± 0.0088
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting 0.258 ± 0.00065 s 0.284 ± 0.00088 s 0.91 ± 0.0036
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting (Hessian) 0.0944 ± 0.00029 s 0.098 ± 0.00055 s 0.963 ± 0.0062
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation 0.185 ± 0.0015 s 0.195 ± 0.0012 s 0.949 ± 0.0096
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation (Hessian) 0.167 ± 0.00095 s 0.174 ± 0.0014 s 0.959 ± 0.0096
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/MadNLP/SingleShooting (Hessian) 0.0425 ± 0.00025 s 0.0468 ± 0.00022 s 0.907 ± 0.0069
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Uno/MultipleShooting (Hessian) 0.0675 ± 0.00035 s 0.0704 ± 0.00042 s 0.958 ± 0.0075
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting 0.184 ± 0.0015 s 0.194 ± 0.00039 s 0.948 ± 0.0081
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (Hessian) 0.203 ± 0.00055 s 0.213 ± 0.00089 s 0.95 ± 0.0047
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (threaded) 0.199 ± 0.0022 s 0.209 ± 0.0015 s 0.955 ± 0.012
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation 0.323 ± 0.0017 s 0.344 ± 0.0019 s 0.939 ± 0.0071
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation (Hessian) 0.855 ± 0.003 s 0.914 ± 0.0027 s 0.936 ± 0.0043
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting 0.255 ± 0.00054 s 0.271 ± 0.0018 s 0.941 ± 0.0066
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting (Hessian) 0.093 ± 0.00028 s 0.0956 ± 0.00085 s 0.973 ± 0.0092
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation 0.183 ± 0.00028 s 0.191 ± 0.00062 s 0.957 ± 0.0034
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (Hessian) 0.17 ± 0.0005 s 0.173 ± 0.00089 s 0.98 ± 0.0058
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (threaded) 0.198 ± 0.0016 s 0.206 ± 0.0017 s 0.963 ± 0.011
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/MultipleShooting (Hessian) 0.11 ± 0.00038 s 0.116 ± 0.0004 s 0.945 ± 0.0046
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/SingleShooting (Hessian) 0.0412 ± 0.00034 s 0.042 ± 0.00022 s 0.982 ± 0.0096
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Uno/MultipleShooting (Hessian) 0.0592 ± 0.00029 s 0.0624 ± 0.00031 s 0.949 ± 0.0066
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Current form 0.0433 ± 0.0017 s 0.0476 ± 0.0034 s 0.91 ± 0.074
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Prediction form 0.0351 ± 0.0056 s 0.0381 ± 0.0061 s 0.922 ± 0.21
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Current form 0.043 ± 0.0032 s 0.0473 ± 0.0045 s 0.909 ± 0.11
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/MultipleShooting 0.0487 ± 0.0043 s 0.0501 ± 0.007 s 0.972 ± 0.16
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Prediction form 30.9 ± 0.9 ms 0.0321 ± 0.0012 s 0.961 ± 0.045
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian) 0.0505 ± 0.00019 s 0.0531 ± 0.00042 s 0.951 ± 0.0084
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian, MultipleShooting) 0.0646 ± 0.00039 s 0.0673 ± 0.00054 s 0.96 ± 0.0096
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian) 0.0508 ± 0.00023 s 0.0522 ± 0.00018 s 0.973 ± 0.0056
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian, MultipleShooting) 0.0624 ± 0.00039 s 0.0646 ± 0.00033 s 0.966 ± 0.0078
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Current form (Hessian) 26.4 ± 0.16 ms 27.1 ± 0.2 ms 0.974 ± 0.0092
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Prediction form (Hessian) 24.9 ± 0.098 ms 26.7 ± 0.16 ms 0.935 ± 0.0068
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian) 9.28 ± 0.062 ms 9.48 ± 0.13 ms 0.979 ± 0.015
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian, MultipleShooting) 13.3 ± 0.16 ms 13.9 ± 0.17 ms 0.953 ± 0.016
UNIT TESTS/PredictiveController/ExplicitMPC/moveinput! 2.27 ± 0.02 μs 2.39 ± 0.02 μs 0.95 ± 0.012
UNIT TESTS/PredictiveController/LinMPC/getinfo! 0.0495 ± 0.00092 ms 0.0522 ± 0.00096 ms 0.947 ± 0.025
UNIT TESTS/PredictiveController/LinMPC/moveinput!/MultipleShooting 0.075 ± 0.0019 ms 0.0763 ± 0.0051 ms 0.983 ± 0.07
UNIT TESTS/PredictiveController/LinMPC/moveinput!/SingleShooting 8.73 ± 0.16 μs 9.57 ± 0.21 μs 0.912 ± 0.026
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/LinModel 0.102 ± 0.0061 ms 0.108 ± 0.0066 ms 0.946 ± 0.081
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/NonLinModel 0.154 ± 0.011 ms 0.162 ± 0.012 ms 0.954 ± 0.098
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/MultipleShooting 0.686 ± 0.14 ms 0.709 ± 0.15 ms 0.967 ± 0.28
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/SingleShooting 0.248 ± 0.019 ms 0.256 ± 0.02 ms 0.967 ± 0.11
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShooting 5.75 ± 0.41 ms 6.04 ± 0.46 ms 0.952 ± 0.098
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShootingHessian 5.76 ± 0.39 ms 6.02 ± 0.42 ms 0.958 ± 0.092
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocation 5.53 ± 0.32 ms 5.83 ± 0.37 ms 0.948 ± 0.081
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocationHessian 5.31 ± 0.46 ms 5.54 ± 0.51 ms 0.958 ± 0.12
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShooting 3.38 ± 0.19 ms 3.54 ± 0.14 ms 0.954 ± 0.066
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShootingHessian 3.42 ± 0.2 ms 3.56 ± 0.2 ms 0.963 ± 0.077
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/TrapezoidalCollocation 3.81 ± 0.12 ms 4 ± 0.16 ms 0.951 ± 0.048
UNIT TESTS/SimModel/LinModel/evaloutput 0.07 ± 0.01 μs 0.08 ± 0.01 μs 0.875 ± 0.17
UNIT TESTS/SimModel/LinModel/updatestate! 0.1 ± 0 μs 0.1 ± 0.001 μs 1 ± 0.01
UNIT TESTS/SimModel/NonLinModel/evaloutput 0.19 ± 0.01 μs 0.18 ± 0.001 μs 1.06 ± 0.056
UNIT TESTS/SimModel/NonLinModel/linearize! 1.03 ± 0.019 μs 1.06 ± 0.011 μs 0.972 ± 0.021
UNIT TESTS/SimModel/NonLinModel/updatestate! 0.22 ± 0.001 μs 0.22 ± 0.01 μs 1 ± 0.046
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/LinModel 0.22 ± 0.01 μs 0.22 ± 0.001 μs 1 ± 0.046
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/evaloutput/NonLinModel 0.851 ± 0.01 μs 0.861 ± 0.01 μs 0.988 ± 0.016
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/LinModel 0.11 ± 0.001 μs 0.12 ± 0 μs 0.917 ± 0.0083
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/preparestate!/NonLinModel 0.651 ± 0 μs 0.651 ± 0 μs 1 ± 0
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/LinModel 1.91 ± 0.02 μs 2.05 ± 0.02 μs 0.932 ± 0.013
UNIT TESTS/StateEstimator/ExtendedKalmanFilter/updatestate!/NonLinModel 4.21 ± 0.03 μs 4.46 ± 0.021 μs 0.944 ± 0.0081
UNIT TESTS/StateEstimator/InternalModel/evaloutput/LinModel 0.101 ± 0.01 μs 0.15 ± 0.001 μs 0.673 ± 0.067
UNIT TESTS/StateEstimator/InternalModel/evaloutput/NonLinModel 0.24 ± 0.009 μs 0.251 ± 0.01 μs 0.956 ± 0.052
UNIT TESTS/StateEstimator/InternalModel/preparestate!/LinModel 0.19 ± 0.01 μs 0.271 ± 0.01 μs 0.701 ± 0.045
UNIT TESTS/StateEstimator/InternalModel/preparestate!/NonLinModel 0.341 ± 0.01 μs 0.351 ± 0.001 μs 0.972 ± 0.029
UNIT TESTS/StateEstimator/InternalModel/updatestate!/LinModel 0.301 ± 0.001 μs 0.28 ± 0.001 μs 1.07 ± 0.0052
UNIT TESTS/StateEstimator/InternalModel/updatestate!/NonLinModel 0.661 ± 0.01 μs 0.621 ± 0.01 μs 1.06 ± 0.024
UNIT TESTS/StateEstimator/KalmanFilter/evaloutput 0.12 ± 0.01 μs 0.12 ± 0.01 μs 1 ± 0.12
UNIT TESTS/StateEstimator/KalmanFilter/preparestate! 0.06 ± 0 μs 0.07 ± 0.001 μs 0.857 ± 0.012
UNIT TESTS/StateEstimator/KalmanFilter/updatestate! 1.28 ± 0.02 μs 1.36 ± 0.02 μs 0.941 ± 0.02
UNIT TESTS/StateEstimator/Luenberger/evaloutput 0.11 ± 0.01 μs 0.24 ± 0.001 μs 0.458 ± 0.042
UNIT TESTS/StateEstimator/Luenberger/preparestate! 0.211 ± 0.01 μs 0.28 ± 0.01 μs 0.754 ± 0.045
UNIT TESTS/StateEstimator/Luenberger/updatestate! 0.26 ± 0.011 μs 0.361 ± 0.01 μs 0.72 ± 0.036
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/LinModel 0.192 ± 0.044 ms 0.192 ± 0.014 ms 1 ± 0.24
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/NonLinModel 0.258 ± 0.051 ms 0.271 ± 0.053 ms 0.953 ± 0.27
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Constant arr. cov. 18.5 ± 1.2 ms 18.7 ± 0.44 ms 0.989 ± 0.068
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Current form 18.7 ± 9.8 ms 18.5 ± 9.9 ms 1.01 ± 0.76
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/MultipleShooting 6.27 ± 2 ms 6.24 ± 1.4 ms 1 ± 0.39
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/Current form 0.144 ± 0.0033 ms 0.145 ± 0.003 ms 0.992 ± 0.03
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/MultipleShooting 0.428 ± 0.015 ms 0.449 ± 0.015 ms 0.953 ± 0.047
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/LinModel/Prediction form 18.4 ± 0.99 ms 16.2 ± 2.1 ms 1.14 ± 0.16
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/NonLinModel/Prediction form 0.153 ± 0.0036 ms 0.159 ± 0.0036 ms 0.958 ± 0.031
UNIT TESTS/StateEstimator/SteadyKalmanFilter/evaloutput 0.13 ± 0.01 μs 0.14 ± 0.01 μs 0.929 ± 0.097
UNIT TESTS/StateEstimator/SteadyKalmanFilter/preparestate! 0.14 ± 0.009 μs 0.151 ± 0.01 μs 0.927 ± 0.086
UNIT TESTS/StateEstimator/SteadyKalmanFilter/updatestate! 0.21 ± 0.01 μs 0.22 ± 0.001 μs 0.955 ± 0.046
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/LinModel 0.15 ± 0.001 μs 0.18 ± 0.001 μs 0.833 ± 0.0072
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/evaloutput/NonLinModel 0.4 ± 0.001 μs 0.421 ± 0.001 μs 0.95 ± 0.0033
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/LinModel 1.88 ± 0.021 μs 1.96 ± 0.03 μs 0.959 ± 0.018
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/preparestate!/NonLinModel 2.49 ± 0.02 μs 2.6 ± 0.021 μs 0.958 ± 0.011
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/LinModel 1.97 ± 0.02 μs 1.98 ± 0.02 μs 0.995 ± 0.014
UNIT TESTS/StateEstimator/UnscentedKalmanFilter/updatestate!/NonLinModel 3.46 ± 0.03 μs 3.75 ± 0.03 μs 0.925 ± 0.011
time_to_load 3.9 ± 0.0052 s 4.11 ± 0.0081 s 0.949 ± 0.0023
Memory benchmarks
main 5c13983... main / 5c13983...
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/DAQP/SingleShooting 0.0489 M allocs: 1.86 MB 0.0489 M allocs: 1.86 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/MultipleShooting 0.126 M allocs: 3.16 MB 0.126 M allocs: 3.16 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/With feedforward/OSQP/SingleShooting 12.6 k allocs: 0.356 MB 12.6 k allocs: 0.356 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/DAQP/SingleShooting 0.0487 M allocs: 1.85 MB 0.0487 M allocs: 1.85 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/MultipleShooting 0.0879 M allocs: 2.23 MB 0.0879 M allocs: 2.23 MB 1
CASE STUDIES/PredictiveController/CSTR/LinMPC/Without feedforward/OSQP/SingleShooting 12.5 k allocs: 0.35 MB 12.5 k allocs: 0.35 MB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/DAQP/SingleShooting 0.119 M allocs: 6.37 MB 0.119 M allocs: 6.37 MB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/MultipleShooting 4.76 M allocs: 0.257 GB 4.76 M allocs: 0.257 GB 1
CASE STUDIES/PredictiveController/Pendulum/LinMPC/Successive linearization/OSQP/SingleShooting 0.148 M allocs: 8.23 MB 0.148 M allocs: 8.23 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting 0.369 M allocs: 25.6 MB 0.369 M allocs: 25.6 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/MultipleShooting (Hessian) 2.22 M allocs: 0.245 GB 2.22 M allocs: 0.246 GB 0.998
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/SingleShooting 0.371 M allocs: 0.0533 GB 0.371 M allocs: 0.0533 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation 2.16 M allocs: 0.212 GB 2.16 M allocs: 0.212 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Custom constraints/Ipopt/TrapezoidalCollocation (Hessian) 2.16 M allocs: 0.212 GB 2.16 M allocs: 0.212 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting 0.32 M allocs: 22.3 MB 0.32 M allocs: 22.3 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/MultipleShooting (Hessian) 0.686 M allocs: 0.0776 GB 0.686 M allocs: 0.0778 GB 0.998
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation 1.32 M allocs: 0.118 GB 1.32 M allocs: 0.118 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/OrthogonalCollocation (Hessian) 1.32 M allocs: 0.118 GB 1.32 M allocs: 0.118 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting 0.0736 M allocs: 13.2 MB 0.0736 M allocs: 13.2 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/SingleShooting (Hessian) 0.0811 M allocs: 17 MB 0.0811 M allocs: 17.1 MB 0.992
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation 0.334 M allocs: 23.4 MB 0.334 M allocs: 23.4 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Ipopt/TrapezoidalCollocation (Hessian) 0.755 M allocs: 0.0766 GB 0.755 M allocs: 0.0766 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/MadNLP/SingleShooting (Hessian) 0.0941 M allocs: 20.4 MB 0.0941 M allocs: 20.5 MB 0.994
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Economic/Uno/MultipleShooting (Hessian) 0.339 M allocs: 0.036 GB 0.339 M allocs: 0.0361 GB 0.998
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting 0.269 M allocs: 18.5 MB 0.269 M allocs: 18.5 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (Hessian) 0.871 M allocs: 0.0908 GB 0.871 M allocs: 0.091 GB 0.998
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/MultipleShooting (threaded) 0.287 M allocs: 27.1 MB 0.287 M allocs: 27.1 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation 1.41 M allocs: 0.127 GB 1.41 M allocs: 0.127 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/OrthogonalCollocation (Hessian) 5.42 M allocs: 0.646 GB 5.42 M allocs: 0.647 GB 0.999
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting 0.0757 M allocs: 13.6 MB 0.0757 M allocs: 13.6 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/SingleShooting (Hessian) 0.0811 M allocs: 17 MB 0.0811 M allocs: 17.2 MB 0.992
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation 0.276 M allocs: 19 MB 0.276 M allocs: 19 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (Hessian) 0.881 M allocs: 0.0817 GB 0.881 M allocs: 0.0817 GB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Ipopt/TrapezoidalCollocation (threaded) 0.295 M allocs: 28.1 MB 0.295 M allocs: 28.1 MB 1
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/MultipleShooting (Hessian) 0.583 M allocs: 0.0723 GB 0.583 M allocs: 0.0725 GB 0.998
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/MadNLP/SingleShooting (Hessian) 0.0937 M allocs: 20.3 MB 0.0937 M allocs: 20.4 MB 0.994
CASE STUDIES/PredictiveController/Pendulum/NonLinMPC/Noneconomic/Uno/MultipleShooting (Hessian) 0.334 M allocs: 0.0325 GB 0.334 M allocs: 0.0325 GB 0.998
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Current form 1.25 M allocs: 0.213 GB 1.25 M allocs: 0.213 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/DAQP/Prediction form 1.16 M allocs: 0.137 GB 1.16 M allocs: 0.137 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Current form 1.13 M allocs: 0.21 GB 1.13 M allocs: 0.21 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/MultipleShooting 3.05 M allocs: 0.175 GB 3.05 M allocs: 0.175 GB 1
CASE STUDIES/StateEstimator/CSTR/MovingHorizonEstimator/OSQP/Prediction form 1.07 M allocs: 0.134 GB 1.07 M allocs: 0.134 GB 1
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian) 0.0746 M allocs: 13 MB 0.0746 M allocs: 13.3 MB 0.98
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Current form (Hessian, MultipleShooting) 0.154 M allocs: 20.5 MB 0.154 M allocs: 21 MB 0.976
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian) 0.0749 M allocs: 13 MB 0.0749 M allocs: 13.3 MB 0.98
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Ipopt/Prediction form (Hessian, MultipleShooting) 0.149 M allocs: 19.7 MB 0.149 M allocs: 20.2 MB 0.976
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Current form (Hessian) 0.0946 M allocs: 16.6 MB 0.0946 M allocs: 16.9 MB 0.984
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/MadNLP/Prediction form (Hessian) 0.0932 M allocs: 16.1 MB 0.0932 M allocs: 16.4 MB 0.984
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian) 0.0326 M allocs: 5.07 MB 0.0326 M allocs: 5.17 MB 0.98
CASE STUDIES/StateEstimator/Pendulum/MovingHorizonEstimator/Uno/Current form (Hessian, MultipleShooting) 0.065 M allocs: 7.05 MB 0.065 M allocs: 7.21 MB 0.979
UNIT TESTS/PredictiveController/ExplicitMPC/moveinput! 0 allocs: 0 B 0 allocs: 0 B
UNIT TESTS/PredictiveController/LinMPC/getinfo! 0.326 k allocs: 15.6 kB 0.326 k allocs: 15.6 kB 1
UNIT TESTS/PredictiveController/LinMPC/moveinput!/MultipleShooting 1.62 k allocs: 0.0403 MB 1.62 k allocs: 0.0403 MB 1
UNIT TESTS/PredictiveController/LinMPC/moveinput!/SingleShooting 0.114 k allocs: 2.98 kB 0.114 k allocs: 2.98 kB 1
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/LinModel 0.408 k allocs: 0.0579 MB 0.408 k allocs: 0.0579 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/getinfo!/NonLinModel 0.571 k allocs: 0.077 MB 0.571 k allocs: 0.077 MB 0.999
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/MultipleShooting 1.79 k allocs: 0.105 MB 1.79 k allocs: 0.105 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/LinModel/SingleShooting 0.254 k allocs: 10.1 kB 0.254 k allocs: 10.1 kB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShooting 4.76 k allocs: 0.368 MB 4.76 k allocs: 0.369 MB 0.996
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/MultipleShootingHessian 5.34 k allocs: 0.423 MB 5.34 k allocs: 0.425 MB 0.996
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocation 9.59 k allocs: 0.611 MB 9.59 k allocs: 0.611 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/OrthogonalCollocationHessian 0.0459 M allocs: 4.44 MB 0.0459 M allocs: 4.44 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShooting 0.957 k allocs: 0.233 MB 0.957 k allocs: 0.233 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/SingleShootingHessian 0.957 k allocs: 0.233 MB 0.957 k allocs: 0.233 MB 1
UNIT TESTS/PredictiveController/NonLinMPC/moveinput!/NonLinModel/TrapezoidalCollocation 3.42 k allocs: 0.241 MB 3.42 k allocs: 0.241 MB 1
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.42 k allocs: 0.053 MB 1.42 k allocs: 0.053 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/getinfo!/NonLinModel 1.42 k allocs: 0.252 MB 1.42 k allocs: 0.252 MB 0.999
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Constant arr. cov. 8.03 k allocs: 0.635 MB 8.03 k allocs: 0.635 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/Current form 0.159 M allocs: 0.117 GB 0.159 M allocs: 0.117 GB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/LinModel/MultipleShooting 17.3 k allocs: 0.903 MB 17.3 k allocs: 0.903 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/Current form 1.04 k allocs: 27.8 kB 1.04 k allocs: 27.8 kB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/preparestate!/NonLinModel/MultipleShooting 1.91 k allocs: 0.0478 MB 1.91 k allocs: 0.0478 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/LinModel/Prediction form 7.55 k allocs: 0.475 MB 7.55 k allocs: 0.475 MB 1
UNIT TESTS/StateEstimator/MovingHorizonEstimator/updatestate!/NonLinModel/Prediction form 1.04 k allocs: 27.8 kB 1.04 k allocs: 27.8 kB 1
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.149 k allocs: 11.2 kB 0.149 k allocs: 11.2 kB 1

@franckgaga
franckgaga merged commit 72373e7 into main Aug 13, 2026
7 of 8 checks passed
@franckgaga
franckgaga deleted the orthocolloc_mhe branch August 13, 2026 12:40
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.

Support OrthogonalCollocation for the MovingHorizonEstimator

2 participants