Skip to content

Commit a8a2404

Browse files
authored
Merge pull request #958 from SciML/doc_figure_update
[v14 - ready] Doc figure display performance update
2 parents cc2a777 + 6a8a9a2 commit a8a2404

File tree

6 files changed

+13
-320
lines changed

6 files changed

+13
-320
lines changed

docs/src/assets/long_ploting_times/model_creation/mm_kinetics.svg

Lines changed: 0 additions & 128 deletions
This file was deleted.

docs/src/assets/long_ploting_times/model_creation/sir_outbreaks.svg

Lines changed: 0 additions & 128 deletions
This file was deleted.

docs/src/assets/long_ploting_times/model_simulation/incomplete_brusselator_simulation.svg

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/src/introduction_to_catalyst/introduction_to_catalyst.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ u₀map = [:m₁ => 0, :m₂ => 0, :m₃ => 0, :P₁ => 20, :P₂ => 0, :P₃ =>
191191
dprob = DiscreteProblem(repressilator, u₀map, tspan, pmap)
192192
193193
# now, we create a JumpProblem, and specify Gillespie's Direct Method as the solver:
194-
jprob = JumpProblem(repressilator, dprob, Direct(), save_positions=(false,false))
194+
jprob = JumpProblem(repressilator, dprob, Direct())
195195
196196
# now, let's solve and plot the jump process:
197-
sol = solve(jprob, SSAStepper(), saveat=10.)
197+
sol = solve(jprob, SSAStepper())
198198
plot(sol)
199+
plot(sol, plotdensity = 1000, fmt = :png) # hide
199200
```
200201

201202
We see that oscillations remain, but become much noisier. Note, in constructing

docs/src/model_creation/examples/basic_CRN_library.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ using Plots
115115
oplt = plot(osol; title = "Reaction rate equation (ODE)")
116116
splt = plot(ssol; title = "Chemical Langevin equation (SDE)")
117117
jplt = plot(jsol; title = "Stochastic chemical kinetics (Jump)")
118-
plot(oplt, splt, jplt; lw = 2, size=(800,800), layout = (3,1))
118+
plot(oplt, splt, jplt; lw = 2, size=(800,800), layout = (3,1))
119+
oplt = plot(osol; title = "Reaction rate equation (ODE)", plotdensity = 1000, fmt = :png) # hide
120+
splt = plot(ssol; title = "Chemical Langevin equation (SDE)", plotdensity = 1000, fmt = :png) # hide
121+
jplt = plot(jsol; title = "Stochastic chemical kinetics (Jump)", plotdensity = 1000, fmt = :png) # hide
122+
plot(oplt, splt, jplt; lw = 2, size=(800,800), layout = (3,1), plotdensity = 1000, fmt = :png) # hide
119123
plot!(bottom_margin = 3Plots.Measures.mm) # hide
120-
nothing # hide
121124
```
122-
![MM Kinetics](../../assets/long_ploting_times/model_creation/mm_kinetics.svg)
123-
Note that, due to the large amounts of the species involved, the stochastic trajectories are very similar to the deterministic one.
124125

125126
## [SIR infection model](@id basic_CRN_library_sir)
126127
The [SIR model](https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology#The_SIR_model) is the simplest model of the spread of an infectious disease. While the real system is very different from the chemical and cellular processes typically modelled with CRNs, it (and several other epidemiological systems) can be modelled using the same CRN formalism. The SIR model consists of three species: susceptible ($S$), infected ($I$), and removed ($R$) individuals, and two reaction events: infection and recovery.
@@ -160,9 +161,11 @@ jplt1 = plot(jsol1; title = "Outbreak")
160161
jplt2 = plot(jsol2; title = "Outbreak")
161162
jplt3 = plot(jsol3; title = "No outbreak")
162163
plot(jplt1, jplt2, jplt3; lw = 3, size=(800,700), layout = (3,1))
163-
nothing # hide
164+
jplt1 = plot(jsol1; title = "Outbreak", plotdensity = 1000, fmt = :png) # hide
165+
jplt2 = plot(jsol2; title = "Outbreak", plotdensity = 1000, fmt = :png) # hide
166+
jplt3 = plot(jsol3; title = "No outbreak", plotdensity = 1000, fmt = :png) # hide
167+
plot(jplt1, jplt2, jplt3; lw = 3, size=(800,700), layout = (3,1), plotdensity = 1000, fmt = :png) # hide
164168
```
165-
![SIR Outbreak](../../assets/long_ploting_times/model_creation/sir_outbreaks.svg)
166169

167170
## [Chemical cross-coupling](@id basic_CRN_library_cc)
168171
In chemistry, [cross-coupling](https://en.wikipedia.org/wiki/Cross-coupling_reaction) is when a catalyst combines two substrates to form a product. In this example, the catalyst ($C$) first binds one substrate ($S₁$) to form an intermediary complex ($S₁C$). Next, the complex binds the second substrate ($S₂$) to form another complex ($CP$). Finally, the catalyst releases the now-formed product ($P$). This system is an extended version of the [Michaelis-Menten system presented earlier](@ref basic_CRN_library_mm).

docs/src/model_simulation/ode_simulation_performance.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ oprob = ODEProblem(brusselator, u0, tspan, ps)
3131
3232
sol1 = solve(oprob, Tsit5())
3333
plot(sol1)
34-
nothing # hide
34+
plot(sol1, plotdensity = 1000, fmt = :png) # hide
3535
```
36-
![Incomplete Brusselator Simulation](../assets/long_ploting_times/model_simulation/incomplete_brusselator_simulation.svg)
3736

3837
We get a warning, indicating that the simulation was terminated. Furthermore, the resulting plot ends at $t ≈ 12$, meaning that the simulation was not completed (as the simulation's endpoint is $t = 20$). Indeed, we can confirm this by checking the *return code* of the solution object:
3938
```@example ode_simulation_performance_1

0 commit comments

Comments
 (0)