From 7128e74075d9f49b68e0bdbdf60478b08c579b58 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Thu, 12 Oct 2023 15:04:56 +0200 Subject: [PATCH] Add a better footer and update `benchmarks/runall.jl` --- benchmarks/lotkavolterra.jmd | 17 ++++++++++++++--- benchmarks/multi-language-wrappers.jmd | 15 +++++++++++++-- benchmarks/pleiades.jmd | 16 +++++++++++++--- benchmarks/rober.jmd | 18 +++++++++++++++--- benchmarks/runall.jl | 3 ++- benchmarks/vanderpol.jmd | 17 +++++++++++++++-- 6 files changed, 72 insertions(+), 14 deletions(-) diff --git a/benchmarks/lotkavolterra.jmd b/benchmarks/lotkavolterra.jmd index e1731b46c..c2c5a344c 100644 --- a/benchmarks/lotkavolterra.jmd +++ b/benchmarks/lotkavolterra.jmd @@ -4,7 +4,7 @@ Adapted from [SciMLBenchmarks.jl](https://docs.sciml.ai/SciMLBenchmarksOutput/stable/NonStiffODE/LotkaVolterra_wpd/). ```julia -using LinearAlgebra, Statistics, InteractiveUtils +using LinearAlgebra, Statistics using DiffEqDevTools, ParameterizedFunctions, SciMLBase, OrdinaryDiffEq, Plots using ProbNumDiffEq @@ -215,6 +215,7 @@ wp = WorkPrecisionSet( plot(wp, color=[2 2 2 4 4 4 5 5 5], xticks = 10.0 .^ (-16:1:5)) ``` + ## Conclusion - **Use the EK1!** It seems to be strictly better than the EK0 here. @@ -224,11 +225,21 @@ plot(wp, color=[2 2 2 4 4 4 5 5 5], xticks = 10.0 .^ (-16:1:5)) - Most likely, the default choice of `diffusionmodel=DynamicDiffusion` and `initialization=TaylorModeInit` are fine. - ## Appendix Computer information: - ```julia +using InteractiveUtils InteractiveUtils.versioninfo() ``` + +Package Information: +```julia +using Pkg +Pkg.status() +``` + +And the full manifest: +```julia +Pkg.status(mode=Pkg.PKGMODE_MANIFEST) +``` diff --git a/benchmarks/multi-language-wrappers.jmd b/benchmarks/multi-language-wrappers.jmd index 2bc1b1a02..c776fb8d7 100644 --- a/benchmarks/multi-language-wrappers.jmd +++ b/benchmarks/multi-language-wrappers.jmd @@ -5,7 +5,7 @@ Adapted from ```julia # Imports -using LinearAlgebra, Statistics, InteractiveUtils +using LinearAlgebra, Statistics using StaticArrays, DiffEqDevTools, ParameterizedFunctions, Plots, SciMLBase, OrdinaryDiffEq using ODEInterface, ODEInterfaceDiffEq, Sundials, SciPyDiffEq, deSolveDiffEq, MATLABDiffEq, LSODA using LoggingExtras @@ -330,7 +330,18 @@ plot( ## Appendix Computer information: - ```julia +using InteractiveUtils InteractiveUtils.versioninfo() ``` + +Package Information: +```julia +using Pkg +Pkg.status() +``` + +And the full manifest: +```julia +Pkg.status(mode=Pkg.PKGMODE_MANIFEST) +``` diff --git a/benchmarks/pleiades.jmd b/benchmarks/pleiades.jmd index 004999a68..2eaf6fac4 100644 --- a/benchmarks/pleiades.jmd +++ b/benchmarks/pleiades.jmd @@ -1,7 +1,7 @@ # Pleiades benchmark ```julia -using LinearAlgebra, Statistics, InteractiveUtils +using LinearAlgebra, Statistics using DiffEqDevTools, ParameterizedFunctions, SciMLBase, OrdinaryDiffEq, Sundials, Plots using ModelingToolkit using ProbNumDiffEq @@ -119,13 +119,23 @@ plot(wp, color=[1 1 2 2 3 3 4 4], ## Conclusion - If the problem is a second-order ODE, _implement it as a second-order ODE_! - Just use `SecondOrderODEProblem`. ## Appendix Computer information: - ```julia +using InteractiveUtils InteractiveUtils.versioninfo() ``` + +Package Information: +```julia +using Pkg +Pkg.status() +``` + +And the full manifest: +```julia +Pkg.status(mode=Pkg.PKGMODE_MANIFEST) +``` diff --git a/benchmarks/rober.jmd b/benchmarks/rober.jmd index f8046355b..0ef839f77 100644 --- a/benchmarks/rober.jmd +++ b/benchmarks/rober.jmd @@ -4,7 +4,7 @@ Adapted from [SciMLBenchmarks.jl](https://docs.sciml.ai/SciMLBenchmarksOutput/stable/DAE/ROBERDAE/). ```julia -using LinearAlgebra, Statistics, InteractiveUtils +using LinearAlgebra, Statistics using DiffEqDevTools, ParameterizedFunctions, SciMLBase, OrdinaryDiffEq, Sundials, Plots using ModelingToolkit using ProbNumDiffEq @@ -35,7 +35,7 @@ daeprob = DAEProblem(sys,[D(y₁)=>-0.04, D(y₂)=>0.04, D(y₃)=>0.0],[],(0.0,1 odaeprob = ODAEProblem(structural_simplify(sys),[],(0.0,1e5)) # can't handle this yet ref_sol = solve(daeprob,IDA(),abstol=1/10^14,reltol=1/10^14,dense=false) -plot(ref_sol, vars=[y₁,y₂,y₃], title="ROBER Solution", legend=false, ylims=(0, 1)) +plot(ref_sol, idxs=[y₁,y₂,y₃], title="ROBER Solution", legend=false, ylims=(0, 1)) ``` ## EK1 accross orders @@ -82,10 +82,22 @@ plot(wp, palette=Plots.palette([:blue, :red], length(_setups)), xticks = 10.0 .^ - The `EK1` can solve mass-matrix DAEs! But it only really works well for low errors. - Order 3 seems to work well here. But the order-to-error-tolerance heuristic should in principle still hold: lower tolerance level ``\rightarrow`` higher order. + ## Appendix Computer information: - ```julia +using InteractiveUtils InteractiveUtils.versioninfo() ``` + +Package Information: +```julia +using Pkg +Pkg.status() +``` + +And the full manifest: +```julia +Pkg.status(mode=Pkg.PKGMODE_MANIFEST) +``` diff --git a/benchmarks/runall.jl b/benchmarks/runall.jl index d086e17d0..a8557b7d0 100644 --- a/benchmarks/runall.jl +++ b/benchmarks/runall.jl @@ -8,12 +8,13 @@ FILES = [ "multi-language-wrappers.jmd", ] +filedir = @__DIR__ for file in FILES @info "Weave file" file weave( file; doctype="github", - out_path="../docs/src/benchmarks/", + out_path=joinpath(filedir, "../docs/src/benchmarks/"), fig_ext=".svg", ) end diff --git a/benchmarks/vanderpol.jmd b/benchmarks/vanderpol.jmd index 826e343fe..764f29168 100644 --- a/benchmarks/vanderpol.jmd +++ b/benchmarks/vanderpol.jmd @@ -2,7 +2,7 @@ ```julia -using LinearAlgebra, Statistics, InteractiveUtils +using LinearAlgebra, Statistics using DiffEqDevTools, ParameterizedFunctions, SciMLBase, OrdinaryDiffEq, Plots using ProbNumDiffEq @@ -117,15 +117,28 @@ wp = WorkPrecisionSet( plot(wp, color=[1 1 1 1 2 2 2 2], xticks = 10.0 .^ (-16:1:5)) ``` + ## Conclusion - Use the `EK1` to solve stiff problems, with orders $\leq 6$ depending on the error tolerance. - When the problem is actually a second-order ODE, as is the case for the Van der Pol system here, _solve it as a second-order ODE_. + ## Appendix Computer information: - ```julia +using InteractiveUtils InteractiveUtils.versioninfo() ``` + +Package Information: +```julia +using Pkg +Pkg.status() +``` + +And the full manifest: +```julia +Pkg.status(mode=Pkg.PKGMODE_MANIFEST) +``` \ No newline at end of file