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 Scipy ODE integrator as fallback for PyGSL #20

Open
clinssen opened this issue May 5, 2020 · 0 comments
Open

Add Scipy ODE integrator as fallback for PyGSL #20

clinssen opened this issue May 5, 2020 · 0 comments

Comments

@clinssen
Copy link
Contributor

clinssen commented May 5, 2020

See #19:

Finally, I want to point out that Scipy's odeint does automatic switching between stiff and non-stiff methods and can return method choice and step size information for every step,

sol, info = scipy.integrate.odeint(f, y0, t, (), jac, full_output=True)
step_size_per_step = info['hu']
method_used_per_step = info['mused']
stiff_steps = (method_used_per_step == 2).sum()
non_stiff_steps = sol.size - stiff_steps
# etc

given your API, it would be straightforward to provide this as a fallback when PyGSL is not available (and looking at PyGSL's website does not inspire confidence as a long-term dependency).

This might require a slight redefinition of our solver selection criteria if automatic switching between solvers cannot be disabled in Scipy. Note that Scipy essentially wraps the ODEPACK solver library.

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

No branches or pull requests

1 participant