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 2 commits 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 9736263... master / 9736263...
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK2() 1.14 ± 0.027 s 1.15 ± 0.043 s 0.991 ± 0.044
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK3() 16 ± 0.62 ms 16.2 ± 1.3 ms 0.986 ± 0.089
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK4() 3.01 ± 0.2 ms 3.01 ± 0.21 ms 1 ± 0.097
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK5() 8.78 ± 0.75 ms 8.79 ± 0.84 ms 0.998 ± 0.13
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK6() 1.55 ± 0.23 ms 1.54 ± 0.29 ms 1.01 ± 0.24
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 1.86 ± 0.66 ms 1.85 ± 0.62 ms 1.01 ± 0.49
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 3.15 ± 1 ms 3.12 ± 0.95 ms 1.01 ± 0.44
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.0666 ± 0.02 s 0.063 ± 0.0096 s 1.06 ± 0.36
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.0788 ± 0.021 s 0.0786 ± 0.022 s 1 ± 0.4
Simple Pendulum/IIP/Shooting(Tsit5()) 0.248 ± 0.075 ms 0.246 ± 0.07 ms 1.01 ± 0.42
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK2() 1.3 ± 0.012 s 1.31 ± 0.021 s 0.994 ± 0.019
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK3() 19 ± 5.8 ms 19 ± 6 ms 1 ± 0.44
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK4() 3.51 ± 0.17 ms 3.49 ± 0.16 ms 1.01 ± 0.067
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK5() 10.2 ± 0.66 ms 10.2 ± 0.59 ms 1 ± 0.087
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK6() 1.79 ± 0.16 ms 1.81 ± 0.15 ms 0.99 ± 0.12
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 3.51 ± 2.8 ms 3.51 ± 2.9 ms 1 ± 1.2
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 5.98 ± 4.9 ms 5.99 ± 4.8 ms 0.999 ± 1.1
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.115 ± 0.018 s 0.114 ± 0.02 s 1.01 ± 0.24
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.141 ± 0.025 s 0.14 ± 0.025 s 1.01 ± 0.25
Simple Pendulum/OOP/Shooting(Tsit5()) 0.634 ± 0.053 ms 0.633 ± 0.078 ms 1 ± 0.15
time_to_load 5 ± 0.035 s 5 ± 0.0078 s 1 ± 0.0072

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