Skip to content

Commit 90a3e83

Browse files
GodotMisogiGodotMisogi
authored andcommitted
Reorganized high tolerance and low tolerance order in KdV pseudospectral
1 parent 8392599 commit 90a3e83

File tree

1 file changed

+80
-81
lines changed

1 file changed

+80
-81
lines changed

benchmarks/SimpleHandwrittenPDE/kdv_spectral_wpd.jmd

Lines changed: 80 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,86 @@ plt = heatmap(xs, tslices, ys', xlabel = "x", ylabel = "t")
8080

8181
## Work-Precision Diagrams
8282

83+
### High Tolerances
84+
85+
#### Implicit-Explicit Methods
86+
87+
```julia
88+
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
89+
reltols = 0.1 .^ (1:4)
90+
multipliers = 0.5 .^ (0:3)
91+
setups = [
92+
Dict(:alg => IMEXEuler(), :dts => 1e-4 * multipliers),
93+
Dict(:alg => CNAB2(), :dts => 1e-4 * multipliers),
94+
Dict(:alg => CNLF2(), :dts => 1e-4 * multipliers),
95+
Dict(:alg => SBDF2(), :dts => 1e-4 * multipliers),
96+
]
97+
labels = hcat(
98+
"IMEXEuler",
99+
"CNAB2",
100+
"CNLF2",
101+
"SBDF2",
102+
)
103+
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
104+
print_names=true, names=labels, numruns=5, error_estimate=:l2,
105+
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
106+
107+
plot(wp, label=labels, markershape=:auto, title="Work-Precision Diagram, High Tolerance")
108+
```
109+
110+
#### Exponential Integrators
111+
112+
```julia
113+
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
114+
reltols = 0.1 .^ (1:4)
115+
multipliers = 0.5 .^ (0:3)
116+
setups = [
117+
Dict(:alg => NorsettEuler(), :dts => 1e-4 * multipliers),
118+
Dict(:alg => NorsettEuler(krylov=true, m=5), :dts => 1e-4 * multipliers),
119+
Dict(:alg => NorsettEuler(krylov=true, m=20), :dts => 1e-4 * multipliers),
120+
Dict(:alg => ETDRK2(), :dts => 1e-4 * multipliers),
121+
Dict(:alg => ETDRK2(krylov=true, m=5), :dts => 1e-4 * multipliers),
122+
Dict(:alg => ETDRK2(krylov=true, m=20), :dts => 1e-4 * multipliers)
123+
]
124+
labels = hcat(
125+
"NorsettEuler (caching)",
126+
"NorsettEuler (m=5)",
127+
"NorsettEuler (m=20)",
128+
"ETDRK2 (caching)",
129+
"ETDRK2 (m=5)",
130+
"ETDRK2 (m=20)"
131+
)
132+
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
133+
print_names=true, names=labels, numruns=5, error_estimate=:l2,
134+
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
135+
136+
plot(wp, label=labels, markershape=:auto, title="ExpRK Methods, High Tolerance")
137+
```
138+
139+
140+
#### Comparisons Between Families
141+
142+
```julia
143+
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
144+
reltols = 0.1 .^ (1:4)
145+
multipliers = 0.5 .^ (0:3)
146+
setups = [
147+
Dict(:alg => CNAB2(), :dts => 1e-4 * multipliers),
148+
Dict(:alg => CNAB2(linsolve=KrylovJL_GMRES()), :dts => 1e-4 * multipliers),
149+
Dict(:alg => ETDRK2(), :dts => 1e-4 * multipliers),
150+
]
151+
labels = hcat(
152+
"CNAB2 (dense linsolve)",
153+
"CNAB2 (Krylov linsolve)",
154+
"ETDRK2 (caching)",
155+
)
156+
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
157+
print_names=true, names=labels, numruns=5, error_estimate=:l2,
158+
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
159+
160+
plot(wp, label=labels, markershape=:auto, title="Between Families, High Tolerances")
161+
```
162+
83163
### Low Tolerances
84164

85165
#### Implicit-Explicit Methods
@@ -163,87 +243,6 @@ labels = hcat(
163243
plot(wp, label=labels, markershape=:auto, title="Between Families, Low Tolerances")
164244
```
165245

166-
167-
### High Tolerances
168-
169-
#### Implicit-Explicit Methods
170-
171-
```julia
172-
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
173-
reltols = 0.1 .^ (1:4)
174-
multipliers = 0.5 .^ (0:3)
175-
setups = [
176-
Dict(:alg => IMEXEuler(), :dts => 1e-4 * multipliers),
177-
Dict(:alg => CNAB2(), :dts => 1e-4 * multipliers),
178-
Dict(:alg => CNLF2(), :dts => 1e-4 * multipliers),
179-
Dict(:alg => SBDF2(), :dts => 1e-4 * multipliers),
180-
]
181-
labels = hcat(
182-
"IMEXEuler",
183-
"CNAB2",
184-
"CNLF2",
185-
"SBDF2",
186-
)
187-
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
188-
print_names=true, names=labels, numruns=5, error_estimate=:l2,
189-
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
190-
191-
plot(wp, label=labels, markershape=:auto, title="Work-Precision Diagram, High Tolerance")
192-
```
193-
194-
#### Exponential Integrators
195-
196-
```julia
197-
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
198-
reltols = 0.1 .^ (1:4)
199-
multipliers = 0.5 .^ (0:3)
200-
setups = [
201-
Dict(:alg => NorsettEuler(), :dts => 1e-4 * multipliers),
202-
Dict(:alg => NorsettEuler(krylov=true, m=5), :dts => 1e-4 * multipliers),
203-
Dict(:alg => NorsettEuler(krylov=true, m=20), :dts => 1e-4 * multipliers),
204-
Dict(:alg => ETDRK2(), :dts => 1e-4 * multipliers),
205-
Dict(:alg => ETDRK2(krylov=true, m=5), :dts => 1e-4 * multipliers),
206-
Dict(:alg => ETDRK2(krylov=true, m=20), :dts => 1e-4 * multipliers)
207-
]
208-
labels = hcat(
209-
"NorsettEuler (caching)",
210-
"NorsettEuler (m=5)",
211-
"NorsettEuler (m=20)",
212-
"ETDRK2 (caching)",
213-
"ETDRK2 (m=5)",
214-
"ETDRK2 (m=20)"
215-
)
216-
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
217-
print_names=true, names=labels, numruns=5, error_estimate=:l2,
218-
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
219-
220-
plot(wp, label=labels, markershape=:auto, title="ExpRK Methods, High Tolerance")
221-
```
222-
223-
224-
#### Comparisons Between Families
225-
226-
```julia
227-
abstols = 0.1 .^ (5:8) # all fixed dt methods so these don't matter much
228-
reltols = 0.1 .^ (1:4)
229-
multipliers = 0.5 .^ (0:3)
230-
setups = [
231-
Dict(:alg => CNAB2(), :dts => 1e-4 * multipliers),
232-
Dict(:alg => CNAB2(linsolve=KrylovJL_GMRES()), :dts => 1e-4 * multipliers),
233-
Dict(:alg => ETDRK2(), :dts => 1e-4 * multipliers),
234-
]
235-
labels = hcat(
236-
"CNAB2 (dense linsolve)",
237-
"CNAB2 (Krylov linsolve)",
238-
"ETDRK2 (caching)",
239-
)
240-
@time wp = WorkPrecisionSet(prob, abstols, reltols, setups;
241-
print_names=true, names=labels, numruns=5, error_estimate=:l2,
242-
save_everystep=false, appxsol=test_sol, maxiters=Int(1e5));
243-
244-
plot(wp, label=labels, markershape=:auto, title="Between Families, High Tolerances")
245-
```
246-
247246
```julia, echo = false
248247
using SciMLBenchmarks
249248
SciMLBenchmarks.bench_footer(WEAVE_ARGS[:folder],WEAVE_ARGS[:file])

0 commit comments

Comments
 (0)