Solver residual cannot be recovered

Hi acados community :wave:

I tried to combine the acados solver with the Neural Network training, in each epoch, I use the acados to solve the trajectory. The training pipeline works well when the solver works as expected. At the new epoch, the solver solves the new trajectory. However, sometimes the solver will report that it cannot find a solution, and I noticed that at this moment, the solver could not be recovered at the new epoch, as the error message shows, during the two separate epochs, the dynamics equality residual and the inequality residual keep the same value.

stationary residuals=  3150541.127168882
dynamics_eq_residual=  79.06209457698436
inequality_residual=  11.234786904464084
No solution found
epoch:172, penalty:198.81116008758545:   0%| | 173/40000 [35:36<134:17:05, 12.14
stationary residuals=  26604288.040639162
dynamics_eq_residual=  79.06209457698436
inequality_residual=  11.234786904464084
No solution found

I also tried the API acados_solver.reset(), but this setting changes my training curve.
Your explanation will help me a lot!!!

Hi :waving_hand:

I guess you need some way of initializing the solver after a failure. The solver reset sets the iterates to zero, but there might be smarter ways to initialize depending in your application.

For instance, if your problem includes a reference trajectory it might help to initialize with the references.

Best, Katrin

1 Like

Dear Kathe,

Thank you so much for your suggestions. I will figure out a better way.

Regards,
Orange787