QNDF Benchmarks for ROBER

These are some of the benchmarks on Stiff-ODE problems for QNDF Methods. The problems are based on DiffEqBenchmarks.jl

Installing required dependencies

using Pkg
pkg"update"
pkg"add BenchmarkTools DiffEqBase DiffEqDevTools DiffEqFlux DiffEqOperators DiffEqProblemLibrary DifferentialEquations FillArrays Flux LSODA ODE ODEInterfaceDiffEq ParameterizedFunctions Test Plots RecursiveArrayTools StaticArrays Sundials LinearAlgebra Random"
pkg"add OrdinaryDiffEq"
9.6s
using OrdinaryDiffEq, DiffEqDevTools, Sundials, ParameterizedFunctions, Plots, ODE, ODEInterfaceDiffEq, LSODA
gr() # gr(fmt=:png)
using LinearAlgebra
LinearAlgebra.BLAS.set_num_threads(1)
733.1s

Defining the ROBER Problem

rober = @ode_def begin
  dy₁ = -k₁*y₁+k₃*y₂*y₃
  dy₂ =  k₁*y₁-k₂*y₂^2-k₃*y₂*y₃
  dy₃ =  k₂*y₂^2
end k₁ k₂ k₃
prob = ODEProblem(rober,[1.0,0.0,0.0],(0.0,1e5),(0.04,3e7,1e4))
29.7s
ODEProblem with uType Array{Float64,1} and tType Float64. In-place: true timespan: (0.0, 100000.0) u0: [1.0, 0.0, 0.0]

Defining our test solution to compare our benchmarks with

sol = solve(prob,CVODE_BDF(),abstol=1/10^14,reltol=1/10^14)
test_sol = TestSolution(sol)
7.2s
retcode: Success Interpolation: 3rd order Hermite t: nothing u: nothing
plot(sol,dpi=200)
63.1s

High Tolerances

The speed of solvers when you just want the answer.

Setups

abstols = 1.0 ./ 10.0 .^ (5:8)
reltols = 1.0 ./ 10.0 .^ (1:4);
setups = [Dict(:alg=>Rosenbrock23()),
          Dict(:alg=>TRBDF2()),
          Dict(:alg=>ImplicitEulerExtrapolation()),
          #Dict(:alg=>ImplicitDeuflhardExtrapolation()), # Diverges
          #Dict(:alg=>ImplicitHairerWannerExtrapolation()), # Diverges
          #Dict(:alg=>ABDF2()), # Maxiters
          Dict(:alg=>QNDF()),
          Dict(:alg=>Exprb43()),
          Dict(:alg=>Exprb32()),
]
names= ["Rosenbrock23" "TRBDF2" "ImplicitEulerExtrapolation" "QNDF"  "Exprb43" "Exprb32"]
3.6s
1×6 Array{String,2}: "Rosenbrock23" "TRBDF2" … "QNDF" "Exprb43" "Exprb32"
wp = WorkPrecisionSet(prob,abstols,reltols,setups; 
 save_everystep=false,appxsol=test_sol,maxiters=Int(1e5),numruns=10)
plot(wp)
110.3s

The QNDF performs much better which was diverging previously in POLLU benchmarks here .

versioninfo()
5.0s
Runtimes (1)