Skip to content
Closed
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions benchmarks/NonStiffBVP/nonlinear_wpi.jmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
---
title: Nonlinear BVP Benchmarks
author: Michelle Zong
TESTING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this. This is not valid YAML Syntax

---

This is a benchmark of MIRK methods and Shooting method on some nonlinear boundary value problems. The testing BVPs are a set of standard BVP test problems as described [here](https://archimede.uniba.it/~bvpsolvers/testsetbvpsolvers/?page_id=29)

# Setup

Fetch required packages.

```julia
using BoundaryValueDiffEq, OrdinaryDiffEq, DiffEqDevTools, BenchmarkTools, BVProblemLibrary, Weave, Plots
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Weave from here

```

Set up the benchmarked solvers.

```julia
setups = [ Dict(:alg=>MIRK2(), :dt=>0.1),
Dict(:alg=>MIRK3(), :dt=>0.1),
Dict(:alg=>MIRK4(), :dt=>0.1),
Dict(:alg=>MIRK5(), :dt=>0.1),
Dict(:alg=>MIRK6(), :dt=>0.1),]
labels = ["MIRK2";
"MIRK3";
"MIRK4";
"MIRK5";
"MIRK6"];
```

Sets tolerances.

```julia
abstols = 1.0 ./ 10.0 .^ (1:4)
reltols = 1.0 ./ 10.0 .^ (1:4);
```

# Benchmarks

We here run the BVP benchmarks for all the MIRK methods.

## Nonlinear boundary value problems

### Nonlinear BVP 1

```julia
prob_1 = BVProblemLibrary.prob_bvp_nonlinear_1
sol_1 = solve(prob_1, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_1 = TestSolution(sol_1.t, sol_1.u)
wp_1 = WorkPrecisionSet(prob_1, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_1,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce the maxiters and numruns for now. We can increase them once we have some results

```

### Nonlinear BVP 2

```julia
prob_2 = BVProblemLibrary.prob_bvp_nonlinear_2
sol_2 = solve(prob_2, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_2 = TestSolution(sol_2.t, sol_2.u)
wp_2 = WorkPrecisionSet(prob_2, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_2,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_2)
```

### Nonlinear BVP 3

```julia
prob_3 = BVProblemLibrary.prob_bvp_nonlinear_3
sol_3 = solve(prob_3, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_3 = TestSolution(sol_3.t, sol_3.u)
wp_3 = WorkPrecisionSet(prob_3, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_3,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_3)
```

### Noninear BVP 4

```julia
prob_4 = BVProblemLibrary.prob_bvp_nonlinear_4
sol_4 = solve(prob_4, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_4 = TestSolution(sol_4.t, sol_4.u)
wp_4 = WorkPrecisionSet(prob_4, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_4,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_4)
```

### Nonlinear BVP 5

```julia
prob_5 = BVProblemLibrary.prob_bvp_nonlinear_5
sol_5 = solve(prob_5, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_5 = TestSolution(sol_5.t, sol_5.u)
wp_5 = WorkPrecisionSet(prob_5, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_5,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_5)
```

### Nonlinear BVP 6

```julia
prob_6 = BVProblemLibrary.prob_bvp_nonlinear_6
sol_6 = solve(prob_6, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_6 = TestSolution(sol_6.t, sol_6.u)
wp_6 = WorkPrecisionSet(prob_6, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_6,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_6)
```

### Nonlinear BVP 7

```julia
prob_7 = BVProblemLibrary.prob_bvp_nonlinear_7
sol_7 = solve(prob_7, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_7 = TestSolution(sol_7.t, sol_7.u)
wp_7 = WorkPrecisionSet(prob_7, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_7,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_7)
```

### Nonlinear BVP 8

```julia
prob_8 = BVProblemLibrary.prob_bvp_nonlinear_8
sol_8 = solve(prob_8, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_8 = TestSolution(sol_8.t, sol_8.u)
wp_8 = WorkPrecisionSet(prob_8, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_8,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_8)
```

### Nonlinear BVP 9

```julia
prob_9 = BVProblemLibrary.prob_bvp_nonlinear_9
sol_9 = solve(prob_9, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_9 = TestSolution(sol_9.t, sol_9.u)
wp_9 = WorkPrecisionSet(prob_9, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_9,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_9)
```

### Nonlinear BVP 10

```julia
prob_10 = BVProblemLibrary.prob_bvp_nonlinear_10
sol_10 = solve(prob_10, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_10 = TestSolution(sol_10.t, sol_10.u)
wp_10 = WorkPrecisionSet(prob_10, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_10,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_10)
```

### Nonlinear BVP 11

```julia
prob_11 = BVProblemLibrary.prob_bvp_nonlinear_11
sol_11 = solve(prob_11, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_11 = TestSolution(sol_11.t, sol_11.u)
wp_11 = WorkPrecisionSet(prob_11, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_11,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_11)
```

### Nonlinear BVP 12

```julia
prob_12 = BVProblemLibrary.prob_bvp_nonlinear_12
sol_12 = solve(prob_12, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_12 = TestSolution(sol_12.t, sol_12.u)
wp_12 = WorkPrecisionSet(prob_12, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_12,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_12)
```

### Nonlinear BVP 13

```julia
prob_13 = BVProblemLibrary.prob_bvp_nonlinear_13
sol_13 = solve(prob_13, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_13 = TestSolution(sol_13.t, sol_13.u)
wp_13 = WorkPrecisionSet(prob_13, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_13,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_13)
```

### Nonlinear BVP 14

```julia
prob_14 = BVProblemLibrary.prob_bvp_nonlinear_14
sol_14 = solve(prob_14, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_14 = TestSolution(sol_14.t, sol_14.u)
wp_14 = WorkPrecisionSet(prob_14, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_14,
dense=false, save_everystep=false,numruns=100,maxiters=10000000, timeseries_errors=false,verbose=false)
plot(wp_14)
```

### Nonlinear BVP 15

```julia
prob_15 = BVProblemLibrary.prob_bvp_nonlinear_15
sol_15 = solve(prob_15, MIRK3(), abstol=1e-8, reltol=1e-8, dt = 0.1)
testsol_15 = TestSolution(sol_15.t, sol_15.u)
wp_15 = WorkPrecisionSet(prob_15, abstols, reltols, setups; names = labels, print_names = true, appxsol = testsol_15,
dense=false, save_everystep=false,numruns=100,maxiters=10000000,timeseries_errors=false,verbose=false)
plot(wp_15)
```

# ```julia, echo = false
# using SciMLBenchmarks
# SciMLBenchmarks.bench_footer(WEAVE_ARGS[:folder],WEAVE_ARGS[:file])
# ```