Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stop_iteration to NLBVP #256

Open
bpbrown opened this issue Jun 27, 2023 · 1 comment
Open

Add stop_iteration to NLBVP #256

bpbrown opened this issue Jun 27, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bpbrown
Copy link
Contributor

bpbrown commented Jun 27, 2023

It would be handy to have a method for stopping NLBVP iterations if they exceed some threshold. Sometimes a NLBVP can get stuck in oscillatory non-convergent states, and a user-defined threshold could prevent a solution in that space from continuing to run.

This can be done by the user inside their main loop, but we have the concept of solver.stop_iteration for IVP, and extending this to NLBVP would keep the same approach for addressing similar situations.

Default value should probably be:

solver.stop_iteration = np.inf

to parallel IVP behaviour and current experience with NLBVP.

@bpbrown bpbrown added the enhancement New feature or request label Jun 27, 2023
@kburns
Copy link
Member

kburns commented Jun 27, 2023

I think the easiest thing is just to wrap this into the newton loop in the script, like:

while error > tolerance and solver.iteration < 20:
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants