Skip to content

Commit d784d7f

Browse files
committed
up
1 parent 32b15fa commit d784d7f

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

docs/src/home.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ specified using Catalyst's domain-specific language (DSL). Leveraging
99
[Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl), Catalyst enables
1010
large-scale simulations through auto-vectorization and parallelism. Symbolic
1111
`ReactionSystem`s can be used to generate ModelingToolkit-based models, allowing
12-
the easy simulation and parameter estimation of mass action ODE models, Chemical
12+
the easy simulation and parameter estimation of mass action ODE models, chemical
1313
Langevin SDE models, stochastic chemical kinetics jump process models, and more.
1414
Generated models can be used with solvers throughout the broader
1515
[SciML](https://sciml.ai) ecosystem, including higher-level SciML packages (e.g.
1616
for sensitivity analysis, parameter estimation, machine learning applications,
1717
etc).
1818

19-
## [Features](@id doc_home_features)
20-
21-
#### [Features of Catalyst](@id doc_home_features_catalyst)
19+
## Features
2220

21+
#### Features of Catalyst
2322
- [The Catalyst DSL](@ref ref) provides a simple and readable format for manually specifying reaction
2423
network models using chemical reaction notation.
2524
- Catalyst `ReactionSystem`s provides a symbolic representation of reaction networks,
@@ -28,7 +27,7 @@ etc).
2827
- The [Catalyst.jl API](http://docs.sciml.ai/Catalyst/stable/api/catalyst_api) provides functionality
2928
for extending networks, building networks programmatically, and for composing
3029
multiple networks together.
31-
- Generated systems can be simulated using any
30+
- Generated models can be simulated using any
3231
[DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/)
3332
[ODE/SDE/jump solver](@ref ref), and can be used within `EnsembleProblem`s for carrying
3433
out [parallelized parameter sweeps and statistical sampling](@ref ref). Plot recipes
@@ -54,8 +53,7 @@ etc).
5453
deterministic and stochastic terms within resulting ODE, SDE or jump models.
5554
- [Steady states](@ref ref) (and their [stabilities](@ref ref)) can be computed for model ODE representations.
5655

57-
58-
#### [Features of Catalyst composing with other packages](@id doc_home_features_composed)
56+
#### Features of Catalyst composing with other packages
5957
- [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) Can be used to [perform model ODE
6058
simulations](@ref ref).
6159
- [StochasticDiffEq.jl](https://github.com/SciML/StochasticDiffEq.jl) Can be used to [perform model
@@ -85,7 +83,7 @@ etc).
8583
- [GlobalSensitivity.jl](https://github.com/SciML/GlobalSensitivity.jl) can be used to perform
8684
[global sensitivity analysis](@ref ref) of model behaviours.
8785

88-
#### [Features of packages built upon Catalyst](@id doc_home_features_other_packages)
86+
#### Features of packages built upon Catalyst
8987
- Catalyst [`ReactionSystem`](@ref)s can be [imported from SBML files](@ref ref) via
9088
[SBMLImporter.jl](https://github.com/SciML/SBMLImporter.jl) and [SBMLToolkit.jl](https://github.com/SciML/SBMLToolkit.jl),
9189
and [from BioNetGen .net files](@ref ref) and various stoichiometric matrix network representations
@@ -104,7 +102,6 @@ etc).
104102
- [PEtab.jl](https://github.com/sebapersson/PEtab.jl) a package that implements the PEtab format for
105103
fitting reaction network ODEs to data. Input can be provided either as SBML files or as Catalyst
106104
`ReactionSystem`s.
107-
108105

109106
## [How to read this documentation](@id doc_home_documentation)
110107
The Catalyst documentation is separated into sections describing Catalyst's various features. Where appropriate, some sections will also give advice on best practices for various modelling workflows, and provide links with further reading. Each section also contains a set of relevant example workflows. Finally, the [API](@ref api) section contains a list of all functions exported by Catalyst (as well as descriptions of them and their inputs and outputs).
@@ -120,7 +117,7 @@ For most code blocks in this documentation, the output of the last line of code
120117
and
121118
```@example home1
122119
@reaction_network begin
123-
(p,d), 0 <--> X
120+
(p,d), 0 <--> X
124121
end
125122
```
126123
However, in some situations (e.g. when output is extensive, or irrelevant to what is currently being described) we have disabled this, e.g. like here:
@@ -131,7 +128,7 @@ nothing # hide
131128
and
132129
```@example home1
133130
@reaction_network begin
134-
(p,d), 0 <--> X
131+
(p,d), 0 <--> X
135132
end
136133
nothing # hide
137134
```
@@ -152,21 +149,21 @@ is also needed.
152149

153150
A more throughout guide for setting up Catalyst and installing Julia packages can be found [here](@ref ref).
154151

155-
## [Illustrative example](@id doc_home_illustrative_example)
152+
## Illustrative example
156153

157-
#### [Deterministic ODE simulation of Michaelis-Menten enzyme kinetics](@id doc_home_illustrative_example_jump)
154+
#### Deterministic ODE simulation of Michaelis-Menten enzyme kinetics
158155
Here we show a simple example where a model is created using the Catalyst DSL, and then simulated as
159156
an ordinary differential equation.
160157

161-
```@example home2
158+
```@example home_simple_example
162159
# Fetch required packages.
163-
using Catalyst, DifferentialEquations, Plots
160+
using Catalyst, OrdinaryDiffEq, Plots
164161
165162
# Create model.
166163
model = @reaction_network begin
167-
kB, S + E --> SE
168-
kD, SE --> S + E
169-
kP, SE --> P + E
164+
kB, S + E --> SE
165+
kD, SE --> S + E
166+
kP, SE --> P + E
170167
end
171168
172169
# Create an ODE that can be simulated.
@@ -180,53 +177,56 @@ sol = solve(ode)
180177
plot(sol; lw = 5)
181178
```
182179

183-
![](https://user-images.githubusercontent.com/1814174/87864114-3bf9dd00-c932-11ea-83a0-58f38aee8bfb.png)
184-
185-
#### [Stochastic jump simulations](@id doc_home_illustrative_example_jump)
180+
#### Stochastic jump simulations
186181
The same model can be used as input to other types of simulations. E.g. here we instead perform a
187182
jump simulation
188-
```@example home2
183+
```@example home_simple_example
189184
# Create and simulate a jump process (here using Gillespie's direct algorithm).
185+
using JumpProcesses
190186
dprob = DiscreteProblem(model, u0, tspan, ps)
191187
jprob = JumpProblem(model, dprob, Direct())
192188
jump_sol = solve(jprob, SSAStepper())
189+
jump_sol = solve(jprob, SSAStepper(); seed = 1234) # hide
193190
plot(jump_sol; lw = 2)
194191
```
195192

196-
197-
## [Elaborate example](@id doc_home_elaborate_example)
198-
199-
In the above example, we used basic Catalyst-based workflows to simulate a simple model. Here we instead show how various Catalyst features can compose to create a much more advanced model. Our model describes how the volume of a cell ($V$) is affected by a growth factor ($G$). Typically the growth factor is inactive ($Gi$), but it is activated ($Ga$) by the presence of sunlight (modeled as the cyclic sinusoid $kA*(sin(t)+1)$). When the cell reaches a critical volume ($V$) it goes through cell division. First, we declare our model:
200-
```@example home3
201-
using Catalyst, Plots, StochasticDiffEq # hide
193+
## Elaborate example
194+
In the above example, we used basic Catalyst-based workflows to simulate a simple model. Here we instead show how various Catalyst features can compose to create a much more advanced model. Our model describes how the volume of a cell ($V$) is affected by a growth factor ($G$). The growth factor only promotes growth while in its phosphorylated form ($Gᴾ$). The phosphorylation of $G$ ($G \to Gᴾ$) is promoted by sunlight (modelled as the cyclic sinusoid $kₐ*(sin(t)+1)$) phosphorylates the growth factor (producing $Gᴾ$). When the cell reaches a critical volume ($V$) it goes through cell division. First, we declare our model:
195+
```@example home_elaborate_example
196+
using Catalyst
202197
cell_model = @reaction_network begin
203-
@parameters V_thres g
204-
@equations begin
205-
D(V) ~ g*Ga
206-
end
207-
@continuous_events begin
208-
[V ~ V_thres] => [V ~ V/2]
209-
end
210-
(kA*(sin(t)+1), kI), Gi <--> Ga
198+
@parameters Vₘₐₓ g Ω
199+
@default_noise_scaling Ω
200+
@equations begin
201+
D(V) ~ g*Gᴾ
202+
end
203+
@continuous_events begin
204+
[V ~ Vₘₐₓ] => [V ~ V/2]
205+
end
206+
kₚ*(sin(t)+1)/V, G --> Gᴾ
207+
kᵢ/V, Gᴾ --> G
211208
end
212209
```
213210
Next, we can use [Latexify.jl](https://korsbo.github.io/Latexify.jl/stable/) to show the ordinary differential equations associated with this model:
214-
```@example home3
211+
```@example home_elaborate_example
215212
using Latexify
216213
latexify(cell_model; form = :ode)
217214
```
218-
In this case we would like to perform stochastic simulations, so we transform our model to an SDE:
219-
```@example home3
220-
u0 = [:V => 0.5, :Gi => 1.0, :Ga => 0.0]
221-
tspan = (0.0, 10.0)
222-
ps = [:V_thres => 1.0, :g => 0.5, :kA => 5.0, :kI => 2.0]
215+
In this case, we would instead like to perform stochastic simulations, so we transform our model to an SDE:
216+
```@example home_elaborate_example
217+
u0 = [:V => 0.5, :G => 1.0, :Gᴾ => 0.0]
218+
tspan = (0.0, 20.0)
219+
ps = [:Vₘₐₓ => 1.0, :g => 0.2, :kₚ => 5.0, :kᵢ => 2.0, :Ω => 0.1]
223220
sprob = SDEProblem(cell_model, u0, tspan, ps)
224221
```
225222
Finally, we simulate it and plot the result.
226-
```@example home3
227-
sol = solve(oprob, Tsit5())
228-
plot(sol)
223+
```@example home_elaborate_example
224+
using StochasticDiffEq
225+
sol = solve(sprob, STrapezoid())
226+
sol = solve(sprob, STrapezoid(); seed = 1234) # hide
227+
plot(sol; xguide = "Time (au)", lw = 2)
229228
```
229+
![Elaborate SDE simulation](docs/src/assets/readme_elaborate_sde_plot.svg)
230230

231231
## [Getting Help](@id doc_home_help)
232232
Catalyst developers are active on the [Julia Discourse](https://discourse.julialang.org/),

0 commit comments

Comments
 (0)