MHE calculation time

Hi :wave:

I’m using the python interface for moving horizon estimation, and it seems like increasing the trajectory length (with the fixed horizon length), results in the solver taking more time to solve the OCP. I’m calculating the average time for the trajectory. At a horizon of 10 and a trajectory of 1000 steps, the solver takes 0.0003 per step to solve the OCP. At a horizon of 10 and a trajectory length of 5000 the solver takes 0.006 to solvve the OCP. I also tried the same thing with the closed_loop_mhe_ocp.py example, I used trajectories of 100 and 100,000 for comparison since the model is simple, and it seems like the solver takes more time with longer trajectories. Is there an explanation for that?

All suggestions are appreciated :slight_smile:
:pray:

It seems like large weight matrices causes this issue. Resolved by decreasing the weights.

It is a bit weird but of course different cost function tunings can influence the number of QP and SQP iterations and thus the runtime of the algorithm.