Hi,

I’m trying to estimate parameters of an ODE model using `DifferentialEquations`

, `SciMLSensitivity`

, and `Optimization`

packages. In particular, I’ve found that `Ipopt`

works quite well for my problem.

Sometimes, though, the ODE cannot be solved up to the final time during the course of the optimization. That is, the ODE solver terminates somewhere in the middle such that the residual / loss cannot be computed.

At the moment, an exception is raised since some arithmetics doesn’t work out (due to different vector dimensions). This crashes the optimizer as well.

Is there a general practice how to handle this problem with derivative-based optimizers?

For example, can I signal the optimizer to try a different step size in its line search or can I let it abort and return the best point encountered so far?