Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed May 25, 2024
1 parent dc04a1b commit b251652
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 24 deletions.
35 changes: 20 additions & 15 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,43 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
BenchmarkTools = "1.5.0"
BifurcationKit = "0.3"
Catalyst = "13"
DataFrames = "1"
DataFrames = "1.6.1"
DiffEqParamEstim = "2.1"
DifferentialEquations = "7.7"
Distributions = "0.25"
Documenter = "1.4.1"
GlobalSensitivity = "2.4.0"
HomotopyContinuation = "2.6"
JumpProcesses = "9"
Latexify = "0.15, 0.16"
ModelingToolkit = "9.5"
NonlinearSolve = "3.4.0"
Optim = "1"
Optimization = "3.19"
OptimizationBBO = "0.1.5, 0.2"
OptimizationNLopt = "0.1.8"
OptimizationOptimJL = "0.1.14"
OptimizationOptimisers = "0.1.1"
OrdinaryDiffEq = "6"
IncompleteLU = "0.2.1"
JumpProcesses = "9.11.1"
Latexify = "0.16"
LinearSolve = "2.30.1"
ModelingToolkit = "9.15"
NonlinearSolve = "3.12.0"
Optim = "1.9.4"
Optimization = "3.25.1"
OptimizationBBO = "0.2"
OptimizationNLopt = "0.2.0"
OptimizationOptimJL = "0.3.0"
OptimizationOptimisers = "0.2.0"
OrdinaryDiffEq = "6.80.0"
Plots = "1.36"
SciMLBase = "2.13"
QuasiMonteCarlo = "0.3.3"
SciMLBase = "2.38"
SciMLSensitivity = "7.19"
Setfield = "1.1"
SpecialFunctions = "2.1"
SteadyStateDiffEq = "2.0.1"
StochasticDiffEq = "6"
SteadyStateDiffEq = "2.2.0"
StochasticDiffEq = "6.65.1"
StructuralIdentifiability = "0.5.1"
Symbolics = "5.14"
3 changes: 0 additions & 3 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,13 @@ accessor functions.
```@docs
species
nonspecies
reactionsystemparams
reactions
nonreactions
numspecies
numparams
numreactions
numreactionsystemparams
speciesmap
paramsmap
reactionsystemparamsmap
isspecies
isautonomous
Catalyst.isconstant
Expand Down
10 changes: 10 additions & 0 deletions docs/src/assets/Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GlobalSensitivity = "af5da776-676b-467e-8baf-acd8249e4f0f"
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OptimizationBBO = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b"
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
Expand All @@ -23,6 +29,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
Expand All @@ -36,12 +43,15 @@ DiffEqParamEstim = "2.1"
DifferentialEquations = "7.7"
Distributions = "0.25"
Documenter = "1.4.1"
GlobalSensitivity = "2.4.0"
HomotopyContinuation = "2.6"
JumpProcesses = "9"
Latexify = "0.15, 0.16"
ModelingToolkit = "9.5"
NonlinearSolve = "3.4.0"
Optim = "1"
Optimization = "3.19"
OptimizationBBO = "0.1.5, 0.2"
OptimizationNLopt = "0.1.8"
OptimizationOptimJL = "0.1.14"
OptimizationOptimisers = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/inverse_problems/behaviour_optimisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Our model consists of 3 species: $X$ (the input node), $Y$ (an intermediary), an
```@example behaviour_optimization
using Catalyst
incoherent_feed_forward = @reaction_network begin
@discrete_event [10.0] ~ [p ~ 10*p]
@discrete_events [10.0] ~ [p ~ 10*p]
pX, 0 --> X
pY*X, 0 --> Y
pZ*X/Y, 0 --> Z
Expand Down
1 change: 1 addition & 0 deletions docs/src/model_creation/dsl_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Here, `<-->` is used to create a bi-directional reaction (with forward rate `kP`
## [Basic syntax](@id dsl_description_basic_syntax)
The basic syntax of the DSL is
```@example dsl_basics
using Catalyst # hide
rn = @reaction_network begin
2.0, X --> Y
1.0, Y --> X
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Above, we investigated the impact of linear pathways' lengths on their behaviour
First, we create a function, `generate_lp`, which creates a linear pathway model of length `n`. It utilises [*vector variables*](@ref ref) to create an arbitrary number of species, and also creates an [observable](@ref ref) for the final species of the chain.
```@example programmatic_generative_linear_pathway_generative
using Catalyst # hide
t = default_t()
function generate_lp(n)
# Creates a vector `X` with n+1 species.
@species X(t)[1:n+1]
Expand Down
4 changes: 3 additions & 1 deletion docs/src/model_simulation/ensemble_simulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ps = [:v0 => 0.1, :v => 2.5, :K => 40.0, :n => 4.0, :deg => 0.01]
```
We wish to simulate it as an SDE. Rather than performing a single simulation, however, we want to perform multiple ones. Here, we first create a normal `SDEProblem`, and use it as the single input to a `EnsembleProblem` (`EnsembleProblem` are created similarly for ODE and jump simulations, but the `ODEProblem` or `JumpProblem` is used instead).
```@example ensemble
using StochasticDiffEq
sprob = SDEProblem(sa_model, u0, tspan, ps)
eprob = EnsembleProblem(sprob)
nothing # hide
Expand All @@ -45,7 +46,8 @@ Previously, we assumed that each simulation used the same initial conditions and

Here, we first create an `ODEProblem` of our previous self-activation loop:
```@example ensemble
oprob = ODEProblem(sa_model, u0, tspan, p)
using OrdinaryDiffEq
oprob = ODEProblem(sa_model, u0, tspan, ps)
nothing # hide
```
Next, we wish to simulate the model for a range of initial conditions of $X$`. To do this we create a problem function, which takes the following arguments:
Expand Down
9 changes: 5 additions & 4 deletions docs/src/model_simulation/ode_simulation_performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ nothing # hide
### [Using a sparse Jacobian](@id ode_simulation_performance_sparse_jacobian)
For a system with $n$ variables, the Jacobian will be an $n\times n$ matrix. This means that, as $n$ becomes large, the Jacobian can become *very* large, potentially causing a significant strain on memory. In these cases, most Jacobian entries are typically $0$. This means that a [*sparse*](https://en.wikipedia.org/wiki/Sparse_matrix) Jacobian (rather than a *dense* one, which is the default) can be advantageous. To designate sparse Jacobian usage, simply provide the `sparse = true` option when constructing an `ODEProblem`:
```@example ode_simulation_performance_3
oprob = ODEProblem(brusselator, u0, tspan, p; sparse = true)
oprob = ODEProblem(brusselator, u0, tspan, ps; sparse = true)
nothing # hide
```

Expand Down Expand Up @@ -186,12 +186,12 @@ mm_model = @reaction_network begin
end
```
The model can be simulated, showing how $P$ is produced from $S$:
```@example ode_simulation_performance_3
```@example ode_simulation_performance_4
using OrdinaryDiffEq, Plots
u0 = [:S => 1.0, :E => 1.0, :SE => 0.0, :P => 0.0]
tspan = (0.0, 50.0)
p = [:kB => 1.0, :kD => 0.1, :kP => 0.5, :d => 0.1]
oprob = ODEProblem(mm_model, u0, tspan, p)
ps = [:kB => 1.0, :kD => 0.1, :kP => 0.5, :d => 0.1]
oprob = ODEProblem(mm_model, u0, tspan, ps)
sol = solve(oprob, Tsit5())
plot(sol)
```
Expand Down Expand Up @@ -236,6 +236,7 @@ plot(0.01:0.01:1.0, map(sol -> sol[:P][end], esol.u), xguide = "kP", yguide = "P

Above, we have simply used `EnsembleProblem` as a convenient interface to run a large number of similar simulations. However, these problems have the advantage that they allow the passing of an *ensemble algorithm* to the `solve` command, which describes a strategy for parallelising the simulations. By default, `EnsembleThreads` is used. This parallelises the simulations using [multithreading](https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)) (parallelisation within a single process), which is typically advantageous for small problems on shared memory devices. An alternative is `EnsembleDistributed` which instead parallelises the simulations using [multiprocessing](https://en.wikipedia.org/wiki/Multiprocessing) (parallelisation across multiple processes). To do this, we simply supply this additional solver to the solve command:
```@example ode_simulation_performance_4
addprocs(4)
esol = solve(eprob, Tsit5(), EnsembleDistributed(); trajectories=100)
nothing # hide
```
Expand Down

0 comments on commit b251652

Please sign in to comment.