Skip to content

Conversation

@slishak
Copy link
Contributor

@slishak slishak commented Sep 1, 2022

For some ODE functions, there are certain feasible regions of state values, and states outside this region result in undefined derivatives. In this situation, it is helpful to be able to communicate to an adaptive solver that it should try a smaller step instead.

This PR adds a RejectStepError exception class that can be raised by an ODE function. If this happens, an adaptive step solver will reject the step and reduce the step size. If the step size is already at the minimum, the exception will be re-raised to avoid an infinite loop.

I've fixed the error ratio to 10 for the new step size calculation, but open to other ideas as this is somewhat arbitrary.

If you think this contribution is worth merging, I can add some documentation and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant