Skip to content

Commit 17c3c55

Browse files
nnd389ChrisRackauckas
authored andcommitted
Updated the nelson ODE function, (made it nicer to look at) and added parameters
1 parent 2b8fa0a commit 17c3c55

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

benchmarks/AstroChem/nelson.jmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using ODEInterface, ODEInterfaceDiffEq
1515
The ODE function defined below models the reduced carbon-oxygen
1616
chemistry network of Nelson & Langer (1999, ApJ, 524, 923).
1717

18-
This Julia ODE function was written by Nina De La Torre advised by Stella Offner.
18+
This Julia ODE function was written by Nina De La Torre advised by Dr. Stella Offner.
1919
The solution was compared with results derived by DESPOTIC, (Mark Krumholz, 2013)
2020
a code to Derive the Energetics and Spectra of Optically Thick Insterstellar Clouds.
2121
DESPOTIC has pre-defined networks, one of them coming from the Nelson & Langer paper,
@@ -167,18 +167,18 @@ u0 = [0.5, # 1: H2
167167

168168
prob = ODEProblem(Nelson!, u0, tspan, params)
169169
refsol = solve(prob, Vern9(), abstol=1e-14, reltol=1e-14)
170-
171170
sol1 = solve(prob, Rodas5P())
172171
sol2 = solve(prob, FBDF())
173-
sol3 = solve(prob, QNDF())
174-
sol4 = solve(prob, CVODE_BDF())
172+
sol3 = solve(prob, lsoda())
173+
sol4 = solve(prob, lsoda(), saveat = 1e10)
174+
175175

176176
using Plots
177177
colors = palette(:acton, 5)
178178
p1 = plot(sol1, vars = (0,11), lc=colors[1], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using Rodas5 (correct solution)")
179179
p2 = plot(sol2, vars = (0,11), lc=colors[2], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using FBDF")
180-
p3 = plot(sol3, vars = (0,11), lc=colors[3], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using QNDF")
181-
p4 = plot(sol4, vars = (0,11), lc=colors[4], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using CVODE FBDF")
180+
p3 = plot(sol3, vars = (0,11), lc=colors[3], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using lsoda")
181+
p4 = plot(sol4, vars = (0,11), lc=colors[4], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using lsoda with saveat")
182182
combined_plot = plot(p1, p2, p3, p4, layout=(4, 1), dpi = 600, pallete=:acton)
183183
display(combined_plot)
184184
```

0 commit comments

Comments
 (0)