Skip to content

Add simple RK4 simulation for continuous systems#1065

Open
schillic wants to merge 2 commits intomasterfrom
schillic/simulate
Open

Add simple RK4 simulation for continuous systems#1065
schillic wants to merge 2 commits intomasterfrom
schillic/simulate

Conversation

@schillic
Copy link
Copy Markdown
Member

@schillic schillic commented Apr 5, 2026

This adds a RungeKutta simulation that can be used without loading OrdinaryDiffEq, which is a somewhat heavy dependency.

To still support the OrdinaryDiffEq solvers, which use a more complex interface, I had to make the algorithm (trajectories_alg) a positional argument in _solve_ensemble. This is not a breaking change because the user is not supposed to call this internal function directly (but we may consider exposing it in the future) and we internally convert the kwarg trajectories_alg to a positional argument.

Moreover, when loading OrdinaryDiffEq, the behavior is the same as before, i.e., the default algorithm will be switched internally to Tsit5.

The PR also includes a plot recipe.

@schillic schillic force-pushed the schillic/simulate branch from b995c85 to 4b0a706 Compare April 5, 2026 14:33
@schillic schillic marked this pull request as ready for review April 5, 2026 15:12
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