Skip to content

Add maxsol and minsol #332

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

Merged
merged 7 commits into from
May 22, 2025
Merged

Add maxsol and minsol #332

merged 7 commits into from
May 22, 2025

Conversation

ErikQQY
Copy link
Member

@ErikQQY ErikQQY commented May 17, 2025

Fix: #282

This PR implements the maxsol and minsol functionalities using root finding to find the critical points together with the maximum/minimum defined on intermediate solutions. Solely depending on root finding is insufficient to find the maximum and minimum values, especially in scenarios where the solutions are monotonic, so we need the maximum/minimum to cover these cases.

Copy link
Contributor

github-actions bot commented May 17, 2025

Benchmark Results

Click to check benchmark results
master 055e4f6... master / 055e4f6...
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK2() 0.628 ± 0.022 s 0.603 ± 0.038 s 1.04 ± 0.074
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK3() 14.1 ± 0.55 ms 14 ± 0.72 ms 1.01 ± 0.065
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK4() 3.2 ± 0.15 ms 3.21 ± 0.19 ms 0.998 ± 0.076
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK5() 9.49 ± 1.3 ms 9.77 ± 1.3 ms 0.972 ± 0.18
Simple Pendulum/IIP/BoundaryValueDiffEqMIRK.MIRK6() 1.65 ± 0.29 ms 1.68 ± 0.31 ms 0.982 ± 0.25
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 1.84 ± 0.67 ms 1.86 ± 0.68 ms 0.99 ± 0.51
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 3.11 ± 1 ms 3.17 ± 1 ms 0.983 ± 0.45
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.0654 ± 0.016 s 0.066 ± 0.013 s 0.991 ± 0.32
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.0777 ± 0.024 s 0.0791 ± 0.022 s 0.982 ± 0.4
Simple Pendulum/IIP/Shooting(Tsit5()) 0.244 ± 0.076 ms 0.248 ± 0.077 ms 0.984 ± 0.43
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK2() 0.738 ± 0.018 s 0.76 ± 0.011 s 0.972 ± 0.028
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK3() 16.6 ± 4.4 ms 16.9 ± 4.6 ms 0.984 ± 0.37
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK4() 3.65 ± 0.14 ms 3.68 ± 0.2 ms 0.991 ± 0.067
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK5() 10.8 ± 0.71 ms 11 ± 1.6 ms 0.984 ± 0.16
Simple Pendulum/OOP/BoundaryValueDiffEqMIRK.MIRK6() 1.88 ± 0.14 ms 1.9 ± 0.18 ms 0.991 ± 0.12
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 3.48 ± 2.9 ms 3.43 ± 2.9 ms 1.01 ± 1.2
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 5.89 ± 4.9 ms 5.88 ± 4.9 ms 1 ± 1.2
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.114 ± 0.028 s 0.114 ± 0.019 s 1 ± 0.3
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.14 ± 0.025 s 0.138 ± 0.031 s 1.01 ± 0.29
Simple Pendulum/OOP/Shooting(Tsit5()) 0.681 ± 0.04 ms 0.638 ± 0.046 ms 1.07 ± 0.1
time_to_load 5.01 ± 0.018 s 5.02 ± 0.033 s 0.998 ± 0.0074
### 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 ChrisRackauckas merged commit 1804133 into master May 22, 2025
30 of 31 checks passed
@ChrisRackauckas ChrisRackauckas deleted the qqy/max_min_sol branch May 22, 2025 15:32
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.

Request: minsol, maxsol for finding the lowest/highest values of solutions
2 participants