Skip to content

Move BVP default solver from DifferentialEquations.jl to BoundaryValueDiffEq.jl - #370

Closed
ChrisRackauckas wants to merge 3 commits into
masterfrom
ChrisRackauckas-patch-1
Closed

Move BVP default solver from DifferentialEquations.jl to BoundaryValueDiffEq.jl#370
ChrisRackauckas wants to merge 3 commits into
masterfrom
ChrisRackauckas-patch-1

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

Matches https://github.com/SciML/DifferentialEquations.jl/blob/master/src/bvp_default_alg.jl. This definitely isn't what the final form should be, but it's a step towards splitting DifferentialEquations.jl so we should follow up later on this. I think we should in this day and age make one of the FIRKs the default, but without autodiff requirements? Or auto-autodiff.

…eDiffEq.jl

Matches https://github.com/SciML/DifferentialEquations.jl/blob/master/src/bvp_default_alg.jl. This definitely isn't what the final form should be, but it's a step towards splitting DifferentialEquations.jl so we should follow up later on this. I think we should in this day and age make one of the FIRKs the default, but without autodiff requirements? Or auto-autodiff.
@@ -0,0 +1,24 @@
@testitem "Default Solvers" begin
using BoundaryValueDiffEq, Test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

du[1] = v
du[2] = -x
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

resid[1] = sol[1][1]
resid[2] = sol[end][1] - 1
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

resid_f = Array{Float64}(undef, 2)
sol = solve(bvp, Shooting(Tsit5()))
sol2 = solve(bvp)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

@github-actions

github-actions Bot commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Benchmark Results

Click to check benchmark results
master 7023fd1... master / 7023fd1...
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK2() 0.673 ± 0.067 s 0.724 ± 0.25 s 0.929 ± 0.33
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK3() 16.3 ± 3.9 ms 15 ± 3.2 ms 1.09 ± 0.35
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK4() 3.75 ± 2.6 ms 3.66 ± 1.3 ms 1.03 ± 0.8
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK5() 10.7 ± 3.2 ms 12.4 ± 6.4 ms 0.863 ± 0.51
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK6() 3.73 ± 0.93 ms 1.81 ± 0.43 ms 2.06 ± 0.71
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 2.03 ± 0.88 ms 1.79 ± 0.75 ms 1.13 ± 0.68
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 4.85 ± 2.5 ms 4.51 ± 1.9 ms 1.08 ± 0.72
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.107 ± 0.042 s 0.0815 ± 0.026 s 1.32 ± 0.66
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.179 ± 0.058 s 0.0891 ± 0.016 s 2.01 ± 0.75
Simple Pendulum/IIP/Shooting(Tsit5()) 0.3 ± 0.17 ms 0.311 ± 0.11 ms 0.966 ± 0.65
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK2() 0.778 ± 0.027 s 0.728 ± 0.017 s 1.07 ± 0.045
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK3() 28 ± 13 ms 17.7 ± 6.8 ms 1.58 ± 0.96
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK4() 3.56 ± 0.67 ms 3.57 ± 0.37 ms 0.998 ± 0.21
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK5() 11.5 ± 3.1 ms 11 ± 2 ms 1.05 ± 0.35
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK6() 2.2 ± 0.53 ms 1.93 ± 0.45 ms 1.14 ± 0.38
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 6.92 ± 4.1 ms 3.55 ± 4.1 ms 1.95 ± 2.5
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 7.03 ± 7.4 ms 6.47 ± 6.1 ms 1.09 ± 1.5
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.132 ± 0.021 s 0.121 ± 0.0092 s 1.09 ± 0.19
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.155 ± 0.067 s 0.196 ± 0.087 s 0.792 ± 0.49
Simple Pendulum/OOP/Shooting(Tsit5()) 0.641 ± 0.61 ms 0.596 ± 0.046 ms 1.08 ± 1
time_to_load 6.11 ± 0.79 s 6.01 ± 0.44 s 1.02 ± 0.15
### Benchmark Plots A plot of the benchmark results has been uploaded as an artifact to the workflow run for this PR. Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/BoundaryValueDiffEq.jl that referenced this pull request Aug 10, 2025
…eDiffEq.jl

- Add default `__init` and `__solve` methods for BVProblem
- Use Shooting(Tsit5()) as the default solver algorithm
- Add OrdinaryDiffEqTsit5 as a dependency
- Update Aqua tests to allow type-piracy for BVProblem
- Add test for default solver functionality

This follows the pattern from PR SciML#370 but targets master branch and
properly handles the type-piracy in Aqua tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ChrisRackauckas
ChrisRackauckas deleted the ChrisRackauckas-patch-1 branch August 10, 2025 19:46
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