Closed chr218 closed 3 years ago
It is already possible to do that on variable step methods, but it's not yet documented. For example:
import nbkode
def func(t, y):
return -y
>>> nbkode.RungeKutta45(func, 0, 1).run(1)
(array([1]), array([[0.37535081]]))
>>> nbkode.RungeKutta45(func, 0, 1, rtol=1e-12, atol=1e-12).run(1)
(array([1]), array([[0.36789539]]))
Which version is this? I have attempted to reproduce your code, but got the following error below:
import nbkodedef func(t, y): return -y nbkode.RungeKutta45(func, 0,
1).run(1)C:\Users\chr218\Anaconda3\lib\site-packages\nbkode\core.py:532:
NumbaExperimentalFeatureWarning: First-class function type feature is
experimental if not step(t_bound, rhs, cache,
args):C:\Users\chr218\Anaconda3\lib\site-packages\nbkode\core.py:532:
NumbaExperimentalFeatureWarning: First-class function type feature is
experimental if not step(t_bound, rhs, cache, args):Out[10]: (array([1]),
array([[0.37535081]]))nbkode.RungeKutta45(func, 0, 1, rtol=1e-12,
atol=1e-12).run(1)Traceback (most recent call last): File
"
On Mon, Jun 7, 2021 at 2:12 PM Mauro Silberberg @.***> wrote:
It is already possible to do that on variable step methods, but it's not yet documented. For example:
import nbkode def func(t, y): return -y
nbkode.RungeKutta45(func, 0, 1).run(1) (array([1]), array([[0.37535081]])) nbkode.RungeKutta45(func, 0, 1, rtol=1e-12, atol=1e-12).run(1) (array([1]), array([[0.36789539]]))
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hgrecco/numbakit-ode/issues/22#issuecomment-856152982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJYF5HFDLA25GUNBP3VW4ATTRUDXPANCNFSM46IFCMIA .
It was fixed in 1ab77ab8fff1616b606b5ff19b55ccd924cc332a, but there hasn't been a release to PyPI since then. Sorry. You would have to install from GitHub: pip install git+https://github.com/hgrecco/numbakit-ode
It would be nice to have the option to set relative and absolute tolerances for the integrators, like in "scipy.integrate.solve_ivp".
Thanks!