IRK vs ERK Performance Difference - Seeking Explanation

Hi ACADOS community,
I’m implementing a path-following MPC for a 9-DOF under-actuated manipulator and observed unexpected performance differences between integration methods that I’d like to understand better.

Setup:
I am using the Python interface.
9-DOF robotic system with passive joint dynamics
50-stage horizon with external cost function type
CasADi symbolic framework with Pinocchio RNEA dynamics
PARTIAL_CONDENSING_HPIMP solver, exact Hessian

Findings:
IRK integration shows significantly faster compilation and runtime compared to ERK, which was counterintuitive to me since IRK typically requires solving implicit equations at each stage.

Questions:
Is this speedup typical for systems with complex nonlinear dynamics?
Are there structural reasons (sparsity patterns, AD efficiency, etc.) why IRK outperforms ERK in ACADOS?
Is there literature explaining when IRK becomes computationally favorable over ERK?

As someone relatively new to OCP implementation, I’d appreciate insights into what drives this performance difference and whether my observations align with expected behavior.
Thanks for any guidance!

Hi Gery,

your ERK might be (close to) diverging and thus preventing the SQP method to converge. Do you get the same number of SQP iterations with ERK vs IRK?

I recommend to first look at the integrator separately (without the OCP). You can use the AcadosSimSolver, cf. this example, to first play around with the integration method and check whether you can reproduce your observations idenpendently of the OCP.

Regarding the compilation time, I don’t see a reason why IRK should be faster.

Best, Katrin