@@ -15,7 +15,7 @@ using ODEInterface, ODEInterfaceDiffEq
1515The ODE function defined below models the reduced carbon-oxygen
1616chemistry 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.
1919The solution was compared with results derived by DESPOTIC, (Mark Krumholz, 2013)
2020a code to Derive the Energetics and Spectra of Optically Thick Insterstellar Clouds.
2121DESPOTIC has pre-defined networks, one of them coming from the Nelson & Langer paper,
@@ -167,18 +167,18 @@ u0 = [0.5, # 1: H2
167167
168168prob = ODEProblem(Nelson!, u0, tspan, params)
169169refsol = solve(prob, Vern9(), abstol=1e-14, reltol=1e-14)
170-
171170sol1 = solve(prob, Rodas5P())
172171sol2 = 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
176176using Plots
177177colors = palette(:acton, 5)
178178p1 = plot(sol1, vars = (0,11), lc=colors[1], legend = false, titlefontsize = 12, lw = 3, xlabel = "", title = "HCO+ solved using Rodas5 (correct solution)")
179179p2 = 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 ")
182182combined_plot = plot(p1, p2, p3, p4, layout=(4, 1), dpi = 600, pallete=:acton)
183183display(combined_plot)
184184```
0 commit comments