From 7bc2444c8d642d2e02f0d3f0d51d98caa11516f1 Mon Sep 17 00:00:00 2001 From: jialinl6 Date: Thu, 29 Feb 2024 21:15:45 -0600 Subject: [PATCH 1/4] Fix issues found on website generated by Documenter.jl --- docs/src/dry_deposition.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/dry_deposition.md b/docs/src/dry_deposition.md index 02962898..e7bd4f06 100644 --- a/docs/src/dry_deposition.md +++ b/docs/src/dry_deposition.md @@ -3,7 +3,7 @@ This is an implementation of a box model used to calculate changes in gas species concentration due to dry deposition. ## Running the model -Here's an example of how concentration of different species, such as SO2, O3, NO2, NO, H2O2 and CH2O change due to dry deposition. +Here's an example of how concentration of different species, such as SO₂, O₃, NO₂, NO, H₂O₂ and CH₂O change due to dry deposition. We can create an instance of the model in the following manner: ```julia @example 1 @@ -17,27 +17,27 @@ using Unitful model = DrydepositionG(t) ``` Before running any simulations with the model we need to convert it into a system of differential equations. -```julia @example 1 +```@example 1 sys = structural_simplify(get_mtk(model)) tspan = (0.0, 3600*24) u0 = [2.0,10.0,5,5,2.34,0.15] # initial concentrations of SO₂, O₃, NO₂, NO, H₂O₂, CH₂O sol = solve(ODEProblem(sys, u0, tspan, []),AutoTsit5(Rosenbrock23()), saveat=10.0) # default parameters ``` which we can plot as -```julia @example 1 +```@example 1 using Plots plot(sol, xlabel="Time (second)", ylabel="concentration (ppb)", legend=:outerright) ``` ## Parameters The parameters in the model are: -```julia @example 1 +```@example 1 parameters(sys) # [z, z₀, u_star, L, ρA, G, T, θ] ``` where ```z``` is the top of the surface layer [m], ```z₀``` is the roughness length [m], ```u_star``` is friction velocity [m/s], and ```L``` is Monin-Obukhov length [m], ```ρA``` is air density [kg/m3], ```T``` is surface air temperature [K], ```G``` is solar irradiation [W m-2], ```Θ``` is the slope of the local terrain [radians]. Let's run some simulation with different value for parameter ```z```. -```julia @example 1 +```@example 1 @unpack O3 = sys p1 = [50,0.04,0.44,0,1.2,300,298,0] From 60ca6dae9f7f28d0785559cf7ac75d07160543d0 Mon Sep 17 00:00:00 2001 From: jialinl6 Date: Thu, 29 Feb 2024 21:22:53 -0600 Subject: [PATCH 2/4] Typo --- docs/src/dry_deposition.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/dry_deposition.md b/docs/src/dry_deposition.md index e7bd4f06..82a294fc 100644 --- a/docs/src/dry_deposition.md +++ b/docs/src/dry_deposition.md @@ -6,7 +6,7 @@ This is an implementation of a box model used to calculate changes in gas specie Here's an example of how concentration of different species, such as SO₂, O₃, NO₂, NO, H₂O₂ and CH₂O change due to dry deposition. We can create an instance of the model in the following manner: -```julia @example 1 +```@example 1 using AtmosphericDeposition using ModelingToolkit using DifferentialEquations From 4cfe9ad37b7aa31cd2350f4d2d7097c17787fda7 Mon Sep 17 00:00:00 2001 From: jialinl6 Date: Fri, 1 Mar 2024 11:51:40 -0600 Subject: [PATCH 3/4] Combine with @setup to hide some outputs --- docs/src/dry_deposition.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/src/dry_deposition.md b/docs/src/dry_deposition.md index 82a294fc..ece25144 100644 --- a/docs/src/dry_deposition.md +++ b/docs/src/dry_deposition.md @@ -6,7 +6,7 @@ This is an implementation of a box model used to calculate changes in gas specie Here's an example of how concentration of different species, such as SO₂, O₃, NO₂, NO, H₂O₂ and CH₂O change due to dry deposition. We can create an instance of the model in the following manner: -```@example 1 +```julia @example 1 using AtmosphericDeposition using ModelingToolkit using DifferentialEquations @@ -17,11 +17,28 @@ using Unitful model = DrydepositionG(t) ``` Before running any simulations with the model we need to convert it into a system of differential equations. -```@example 1 +```julia @example 1 sys = structural_simplify(get_mtk(model)) tspan = (0.0, 3600*24) u0 = [2.0,10.0,5,5,2.34,0.15] # initial concentrations of SO₂, O₃, NO₂, NO, H₂O₂, CH₂O sol = solve(ODEProblem(sys, u0, tspan, []),AutoTsit5(Rosenbrock23()), saveat=10.0) # default parameters + +```@setup 1 +using AtmosphericDeposition +using ModelingToolkit +using DifferentialEquations +using EarthSciMLBase +using Unitful + +@parameters t [unit = u"s", description="Time"] +model = DrydepositionG(t) + +sys = structural_simplify(get_mtk(model)) +tspan = (0.0, 3600*24) +u0 = [2.0,10.0,5,5,2.34,0.15] # initial concentrations of SO₂, O₃, NO₂, NO, H₂O₂, CH₂O +sol = solve(ODEProblem(sys, u0, tspan, []),AutoTsit5(Rosenbrock23()), saveat=10.0) # default parameters +``` + ``` which we can plot as ```@example 1 @@ -31,7 +48,7 @@ plot(sol, xlabel="Time (second)", ylabel="concentration (ppb)", legend=:outerrig ## Parameters The parameters in the model are: -```@example 1 +```julia @example 1 parameters(sys) # [z, z₀, u_star, L, ρA, G, T, θ] ``` where ```z``` is the top of the surface layer [m], ```z₀``` is the roughness length [m], ```u_star``` is friction velocity [m/s], and ```L``` is Monin-Obukhov length [m], ```ρA``` is air density [kg/m3], ```T``` is surface air temperature [K], ```G``` is solar irradiation [W m-2], ```Θ``` is the slope of the local terrain [radians]. From 39de957aa440bbf8b7d7cf2ba3d0cd3becf1b906 Mon Sep 17 00:00:00 2001 From: jialinl6 Date: Fri, 1 Mar 2024 12:12:52 -0600 Subject: [PATCH 4/4] Fix typo in documentation --- docs/src/dry_deposition.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/dry_deposition.md b/docs/src/dry_deposition.md index ece25144..8b944633 100644 --- a/docs/src/dry_deposition.md +++ b/docs/src/dry_deposition.md @@ -6,7 +6,7 @@ This is an implementation of a box model used to calculate changes in gas specie Here's an example of how concentration of different species, such as SO₂, O₃, NO₂, NO, H₂O₂ and CH₂O change due to dry deposition. We can create an instance of the model in the following manner: -```julia @example 1 +```julia using AtmosphericDeposition using ModelingToolkit using DifferentialEquations @@ -17,11 +17,12 @@ using Unitful model = DrydepositionG(t) ``` Before running any simulations with the model we need to convert it into a system of differential equations. -```julia @example 1 +```julia sys = structural_simplify(get_mtk(model)) tspan = (0.0, 3600*24) u0 = [2.0,10.0,5,5,2.34,0.15] # initial concentrations of SO₂, O₃, NO₂, NO, H₂O₂, CH₂O sol = solve(ODEProblem(sys, u0, tspan, []),AutoTsit5(Rosenbrock23()), saveat=10.0) # default parameters +``` ```@setup 1 using AtmosphericDeposition @@ -39,7 +40,6 @@ u0 = [2.0,10.0,5,5,2.34,0.15] # initial concentrations of SO₂, O₃, NO₂, NO sol = solve(ODEProblem(sys, u0, tspan, []),AutoTsit5(Rosenbrock23()), saveat=10.0) # default parameters ``` -``` which we can plot as ```@example 1 using Plots @@ -48,7 +48,7 @@ plot(sol, xlabel="Time (second)", ylabel="concentration (ppb)", legend=:outerrig ## Parameters The parameters in the model are: -```julia @example 1 +```julia parameters(sys) # [z, z₀, u_star, L, ρA, G, T, θ] ``` where ```z``` is the top of the surface layer [m], ```z₀``` is the roughness length [m], ```u_star``` is friction velocity [m/s], and ```L``` is Monin-Obukhov length [m], ```ρA``` is air density [kg/m3], ```T``` is surface air temperature [K], ```G``` is solar irradiation [W m-2], ```Θ``` is the slope of the local terrain [radians].