Skip to content

Add data field for stiff problems or specify appropiate solver #43

Description

@fumagall

The Radau method is used to integrate most (all?) ODEs. However, to my understanding Radau was developed for stiff problems [1], so problems such as the Lorenz63 do not befinite form it. Futher, Radau performs a magnitude slower than e.g. RK45.

from dysts.flows import Lorenz, Hadley

## Load and simulate an attractor
model = Lorenz()
sol = model.make_trajectory(10_000, resample=True, method="Radau")
plt.figure()
plt.plot(sol[:, 0], sol[:, 1])

takes 1.33 min.

from dysts.flows import Lorenz, Hadley

## Load and simulate an attractor
model = Lorenz()
sol = model.make_trajectory(10_000, resample=True, method="RK45")
plt.figure()
plt.plot(sol[:, 0], sol[:, 1])

takes 7.1 seconds.

I would suggest adding a data field if a problem is stiff and then use fast methods for the non-stiff problems, or you could add a method, where the appropriate solver was used.

[1] https://www.emergentmind.com/topics/radau-iia-method

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions