Skip to content

Commit

Permalink
Merge pull request #970 from SciML/docs___update___simulation_introdu…
Browse files Browse the repository at this point in the history
…ction

Simulation introduction doc page update
  • Loading branch information
TorkelE authored Jul 7, 2024
2 parents 33254f3 + d42214e commit a4c75fc
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ModelingToolkit = "9.16.0"
NonlinearSolve = "3.12"
Optim = "1.9"
Optimization = "3.25"
OptimizationBBO = "0.2.1"
OptimizationBBO = "0.3"
OptimizationNLopt = "0.2.1"
OptimizationOptimJL = "0.3.1"
OptimizationOptimisers = "0.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ nothing # hide
```

---
## [Citation](@id structural_identifiability_citation)
## [Citation](@id optimization_parameter_fitting_citation)
If you use this functionality in your research, please cite the following paper to support the authors of the Optimization.jl package:
```
@software{vaibhav_kumar_dixit_2023_7738525,
Expand Down
63 changes: 62 additions & 1 deletion docs/src/model_simulation/simulation_introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ sol = solve(sprob, STrapezoid(); seed = 12345, abstol = 1e-1, reltol = 1e-1) # h
plot(sol)
```

### [SDE simulations with fixed time stepping](@id simulation_intro_SDEs_fixed_dt)
StochasticDiffEq implements SDE solvers with adaptive time stepping. However, when using a non-adaptive solver (or using the `adaptive = false` argument to turn adaptive time stepping off for an adaptive solver) a fixed time step `dt` must be designated. Here we simulate the same `SDEProblem` which we struggled with previously, but using the non-adaptive [`EM`](https://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method) solver and a fixed `dt`:
```@example simulation_intro_sde
sol = solve(sprob, EM(); dt = 0.001)
sol = solve(sprob, EM(); dt = 0.001, seed = 1234567) # hide
plot(sol)
```
We note that this approach also enables us to successfully simulate the SDE we previously struggled with.

Generally, using a smaller fixed `dt` provides a more exact simulation, but also increases simulation runtime.

### [Scaling the noise in the chemical Langevin equation](@id simulation_intro_SDEs_noise_saling)
When using the CLE to generate SDEs from a CRN, it can sometimes be desirable to scale the magnitude of the noise. This can be done by introducing a *noise scaling term*, with each noise term generated by the CLE being multiplied with this term. A noise scaling term can be set using the `@default_noise_scaling` option:
```@example simulation_intro_sde
Expand Down Expand Up @@ -336,4 +347,54 @@ circadian_model = @reaction_network begin
d, P --> 0
end
```
This type of model will generate so called *variable rate jumps*. Simulation of such model is non-trivial (and Catalyst currently lacks a good interface for this). A detailed description of how to carry out jump simulations for models with time-dependant rates can be found [here](https://docs.sciml.ai/JumpProcesses/stable/tutorials/simple_poisson_process/#VariableRateJumps-for-processes-that-are-not-constant-between-jumps).
This type of model will generate so called *variable rate jumps*. Simulation of such model is non-trivial (and Catalyst currently lacks a good interface for this). A detailed description of how to carry out jump simulations for models with time-dependant rates can be found [here](https://docs.sciml.ai/JumpProcesses/stable/tutorials/simple_poisson_process/#VariableRateJumps-for-processes-that-are-not-constant-between-jumps).


---
## [Citation](@id simulation_intro_citation)
When you simulate Catalyst models in your research, please cite the corresponding paper(s) to support the simulation package authors. For ODE simulations:
```
@article{DifferentialEquations.jl-2017,
author = {Rackauckas, Christopher and Nie, Qing},
doi = {10.5334/jors.151},
journal = {The Journal of Open Research Software},
keywords = {Applied Mathematics},
note = {Exported from https://app.dimensions.ai on 2019/05/05},
number = {1},
pages = {},
title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
volume = {5},
year = {2017}
}
```
For SDE simulations:
```
@article{rackauckas2017adaptive,
title={Adaptive methods for stochastic differential equations via natural embeddings and rejection sampling with memory},
author={Rackauckas, Christopher and Nie, Qing},
journal={Discrete and continuous dynamical systems. Series B},
volume={22},
number={7},
pages={2731},
year={2017},
publisher={NIH Public Access}
}
```
For jump simulations:
```
@misc{2022JumpProcesses,
author = {Isaacson, S. A. and Ilin, V. and Rackauckas, C. V.},
title = {{JumpProcesses.jl}},
howpublished = {\url{https://github.com/SciML/JumpProcesses.jl/}},
year = {2022}
}
@misc{zagatti_extending_2023,
title = {Extending {JumpProcess}.jl for fast point process simulation with time-varying intensities},
url = {http://arxiv.org/abs/2306.06992},
doi = {10.48550/arXiv.2306.06992},
publisher = {arXiv},
author = {Zagatti, Guilherme Augusto and Isaacson, Samuel A. and Rackauckas, Christopher and Ilin, Vasily and Ng, See-Kiong and Bressan, Stéphane},
year = {2023},
}
```

0 comments on commit a4c75fc

Please sign in to comment.