Skip to content

Commit

Permalink
Add a initialization comparison to the Vanderpol benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Nov 4, 2023
1 parent a726d7b commit 986a89d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions benchmarks/vanderpol.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,52 @@ wp = WorkPrecisionSet(
plot(wp, palette=Plots.palette([:blue, :red], length(_setups)), xticks = 10.0 .^ (-16:1:5))
```

## Comparison of the different initialization schemes

```julia
DENSE = false;
SAVE_EVERYSTEP = false;

abstols = 1.0 ./ 10.0 .^ (6:13)
reltols = 1.0 ./ 10.0 .^ (3:10)

orders = (2, 3, 5, 8)
ps = []
for o in orders
_setups = [
"EK1($o) TaylorInit" => Dict(:alg => EK1(order=o, smooth=DENSE, initialization=TaylorModeInit(o)))
"EK1($o) ForwardDiffInit" => Dict(:alg => EK1(order=o, smooth=DENSE, initialization=ForwardDiffInit(o)))
"EK1($o) SimpleInit" => Dict(:alg => EK1(order=o, smooth=DENSE, initialization=SimpleInit()))
"EK1($o) ClassicSolverInit" => Dict(:alg => EK1(order=o, smooth=DENSE, initialization=ClassicSolverInit()))
]

labels = first.(_setups)
setups = last.(_setups)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
names = labels,
#print_names = true,
appxsol = test_sol,
dense = DENSE,
save_everystep = SAVE_EVERYSTEP,
numruns = 10,
maxiters = Int(1e7),
timeseries_errors = false,
verbose = false,
)

p = plot(wp, color=[2 4 5 6], xticks = 10.0 .^ (-16:1:5))
push!(ps, p)
end
plot(
ps...,
layout=(length(orders), 1),
size = (1000, length(orders)*300),
xlabel=["" "" "" "Error"],
)
```

## Solving the first- vs second-order ODE

```julia
Expand Down

0 comments on commit 986a89d

Please sign in to comment.