Skip to content

Commit

Permalink
Merge pull request #483 from isaacsas/update_docs_for_float_stoich
Browse files Browse the repository at this point in the history
Update docs for float stoich
  • Loading branch information
isaacsas authored Feb 21, 2022
2 parents b11755d + d572eda commit bcf361f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Catalyst"
uuid = "479239e8-5488-4da2-87a7-35f2df7eef83"
version = "10.5.1"
version = "10.6"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ the current master branch.
- Catalyst `ReactionSystem`s provide a symbolic representation of reaction networks,
built on [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl) and
[Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl).
- Non-integer (e.g. `Float64`) stoichiometric coefficients are supported for generating ODE
models.
- The [Catalyst.jl API](http://catalyst.sciml.ai/dev/api/catalyst_api) provides
functionality for extending networks, building networks programmatically,
network analysis, and for composing multiple networks together.
Expand Down
24 changes: 24 additions & 0 deletions docs/src/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ osys = convert(ODESystem, rn; combinatoric_ratelaws=false)
Disabling these rescalings should work for all conversions of `ReactionSystem`s
to other `ModelingToolkit.AbstractSystem`s.

## How to use non-integer stoichiometric coefficients?
```julia
rn = @reaction_network begin
k, 2.5*A --> 3*B
end k
```
or directly via
```julia
@parameters k b
@variables t A(t) B(t) C(t) D(t)
rx1 = Reaction(k,[B,C],[B,D], [2.5,1],[3.5, 2.5])
rx2 = Reaction(2*k, [B], [D], [1], [2.5])
rx3 = Reaction(2*k, [B], [D], [2.5], [2])
@named mixedsys = ReactionSystem([rx1,rx2,rx3],t,[A,B,C,D],[k,b])
osys = convert(ODESystem, mixedsys; combinatoric_ratelaws=false)
```
Note, when using `convert(ODESystem, mixedsys; combinatoric_ratelaws=false)` the
`combinatoric_ratelaws=false` parameter must be passed. This is also true when
calling `ODEProblem(mixedsys,...; combinatoric_ratelaws=false)`. As described
above, this disables Catalyst's standard rescaling of reaction rates when
generating reaction rate laws, see also the [Reaction rate laws used in
simulations](@ref) section. Leaving this keyword out for systems with floating
point stoichiometry will give an error message.

## How to set default values for initial conditions and parameters?
When directly constructing a `ReactionSystem` these can be passed to the
constructor, and allow solving the system without needing initial condition or
Expand Down
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ etc).
- Catalyst `ReactionSystem`s provide a symbolic representation of reaction networks,
built on [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl) and
[Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl).
- Non-integer (e.g. `Float64`) stoichiometric coefficients are supported for generating ODE
models.
- The [Catalyst.jl API](@ref) provides functionality for extending networks,
building networks programmatically, network analysis, and for composing multiple
networks together.
Expand Down

0 comments on commit bcf361f

Please sign in to comment.