How do I stop Warning: Endpoints do not match. Return code: Terminated. Likely your time range is not a multiple of saveat

I am running a sciml_train on a differential equation with a neural network embedded in it.

In the differential equation I employee a callback to terminate the simulation when the trajectories are at their closest point of intersection. The time I have for end time on the simulation is really a “stop the madness” point so it doesn’t keep calculate something off in the weeds.

I don’t expect for a good run, the endpoints to ever match.

These warnings seem to imply I’m doing something dumb. How should I formulate this problem?

Should I not use “terminate!” as the argument to the callback. Should it be “success?”.

Should I do something goofy and change the derivatives to zero everything out so the answer just hovers until the end of time? (This does not seem like the right answer.)

Best Regards.
Allan Baker