Skip to content

Support derivative boundary conditions #299

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ErikQQY
Copy link
Member

@ErikQQY ErikQQY commented Apr 2, 2025

Fix: #281
Fix: #83
Could possibly unblock #282

with this PR, we can just specify the derivative boundary condition as

function bc!(res, u, p, t)
    res[1] = u(0.0)[1] + pi / 2
    res[2] = u(1.0, Val{1})[2] - pi / 2 # u(1.0, Val{1})[2] is the u2'(1.0)=pi/2
end

Copy link
Contributor

github-actions bot commented Apr 2, 2025

Benchmark Results

master 9094c05... master / 9094c05...
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK2() 7.94 ± 0.42 ms 7.94 ± 0.27 ms 1
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK3() 2.95 ± 0.23 ms 2.93 ± 0.2 ms 1.01
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK4() 1.03 ± 0.11 ms 1.01 ± 0.1 ms 1.02
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK5() 2.64 ± 0.49 ms 2.61 ± 0.46 ms 1.01
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK6() 1.2 ± 0.2 ms 1.19 ± 0.23 ms 1.01
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 1.94 ± 0.69 ms 1.9 ± 0.68 ms 1.02
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 3.24 ± 1 ms 3.21 ± 1.1 ms 1.01
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.075 ± 0.019 s 0.0755 ± 0.02 s 0.993
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.0894 ± 0.02 s 0.0888 ± 0.022 s 1.01
Simple Pendulum/IIP/Shooting(Tsit5()) 0.267 ± 0.084 ms 0.267 ± 0.084 ms 1
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK2() 9.37 ± 0.44 ms 9.42 ± 0.48 ms 0.995
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK3() 3.41 ± 0.24 ms 3.43 ± 0.26 ms 0.994
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK4() 1.2 ± 0.11 ms 1.2 ± 0.12 ms 1
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK5() 3.07 ± 0.59 ms 3.11 ± 0.59 ms 0.99
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK6() 1.44 ± 0.18 ms 1.44 ± 0.19 ms 1
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 3.73 ± 3 ms 3.68 ± 3 ms 1.01
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 6.17 ± 5.2 ms 6.18 ± 5.3 ms 0.998
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.134 ± 0.019 s 0.132 ± 0.032 s 1.01
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.162 ± 0.036 s 0.161 ± 0.032 s 1
Simple Pendulum/OOP/Shooting(Tsit5()) 0.654 ± 0.081 ms 0.655 ± 0.12 ms 0.999
time_to_load 5.34 ± 0.035 s 5.29 ± 0.021 s 1.01

Benchmark Plots

A plot of the benchmark results have 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).

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.

Derivative boundary condition support is missing Feature request: Derivative boundary condition for BVP ODEs
1 participant