Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add non-fileld arrow (=>) documentation to DSL docs #1123

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/introduction_to_catalyst/math_models_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ while the jump process propensity function is
a(\mathbf{X}(t)) = k A (A-1) B.
```

## Reaction Rate Equation (RRE) ODE Models
## [Reaction Rate Equation (RRE) ODE Models](@id math_models_in_catalyst_rre_odes)
The RRE ODE models Catalyst creates for a general system correspond to the coupled system of ODEs given by
```math
\frac{d X_m}{dt} =\sum_{k=1}^K \nu_m^k a_k(\mathbf{X}(t),t), \quad m = 1,\dots,M.
Expand Down
34 changes: 34 additions & 0 deletions docs/src/model_creation/dsl_advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,37 @@ nothing # hide

!!! note
When using interpolation, expressions like `2$spec` won't work; the multiplication symbol must be explicitly included like `2*$spec`.

## [Disabling mass action for reactions](@id dsl_advanced_options_disable_ma)

As [described previously](@ref math_models_in_catalyst_rre_odes), Catalyst uses *mass action kinetics* to generate ODEs from reactions. Here, each reaction generates a term for each of its reactants, which consists of the reaction's rate, substrates, and the reactant's stoichiometry. E.g. the following reaction:
```@example dsl_advanced_disable_ma
using Catalyst # hide
rn = @reaction_network begin
k, X --> ∅
end
```
generates a single term $-k*[X]$:
```@example dsl_advanced_disable_ma
using Latexify
latexify(rn; form = :ode)
```

It is possible to remove the substrate contribution by using any of the following non-filled arrows when declaring the reaction: `<=`, `⇐`, `⟽`, `=>`, `⇒`, `⟾`, `⇔`, `⟺`. This means that the reaction
```@example faq7
rn = @reaction_network begin
k, X => ∅
end
latexify(rn; form = :ode)
```
will occur at rate $d[X]/dt = -k$ (which might become a problem since $[X]$ will be degraded at a constant rate even when very small or equal to 0). This functionality allows the user to fully customise the ODEs generated by their models.

Note, stoichiometric coefficients are still included, i.e. the reaction
```@example faq7
rn = @reaction_network begin
k, 2*X ⇒ ∅
end
latexify(rn; form = :ode)
```
has rate $d[X]/dt = -2 k$.

2 changes: 1 addition & 1 deletion docs/src/model_creation/dsl_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ It should be noted that the following symbols are *not permitted* to be used as
- `∅` ([used for production/degradation reactions](@ref dsl_description_symbols_empty_set)).
- `im` (used in Julia to represent [complex numbers](https://docs.julialang.org/en/v1/manual/complex-and-rational-numbers/#Complex-Numbers)).
- `nothing` (used in Julia to denote [nothing](https://docs.julialang.org/en/v1/base/constants/#Core.nothing)).
- `Γ` (used by Catalyst to represent conserved quantities).
- `Γ` (used by Catalyst to represent [conserved quantities](@ref constraint_equations)).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change, but saw it and figured it was minor enough that I'd sneak it in here anyway.

Loading