Skip to content

Commit f4ab044

Browse files
Update nelson.jmd
1 parent 17c3c55 commit f4ab044

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

benchmarks/AstroChem/nelson.jmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ using Sundials, LSODA
1010
using ODEInterface, ODEInterfaceDiffEq
1111
```
1212

13-
```julia
14-
#=
1513
The ODE function defined below models the reduced carbon-oxygen
1614
chemistry network of Nelson & Langer (1999, ApJ, 524, 923).
1715

@@ -31,8 +29,8 @@ and M represents the low ionization potential metals Mg, Fe, Ca, and Na.
3129
G₀ = 1.7 --> Go; "a factor that determines the flux of FUV radiation relative to the standard interstellar value (G₀ = 1) as reported by Habing (1968)."
3230
n_H = 611 --> Hydrogen Number Density
3331
shield = 1 --> "CO self-shielding factor of van Dishoeck & Black (1988), taken from Bergin et al. (1995)"
34-
=#
3532

33+
```julia
3634
function Nelson!(du,u,p,t)
3735
T, Av, Go, n_H, shield = p
3836

@@ -164,15 +162,16 @@ u0 = [0.5, # 1: H2
164162
2.0e-7, # 13: M+
165163
2.0e-7] # 14: M
166164

167-
168165
prob = ODEProblem(Nelson!, u0, tspan, params)
169166
refsol = solve(prob, Vern9(), abstol=1e-14, reltol=1e-14)
170167
sol1 = solve(prob, Rodas5P())
171168
sol2 = solve(prob, FBDF())
172169
sol3 = solve(prob, lsoda())
173170
sol4 = solve(prob, lsoda(), saveat = 1e10)
174171

172+
## Validation Plot
175173

174+
```julia
176175
using Plots
177176
colors = palette(:acton, 5)
178177
p1 = plot(sol1, vars = (0,11), lc=colors[1], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using Rodas5 (correct solution)")

0 commit comments

Comments
 (0)