## FiniteStateProjection.jl

Finite State Projection algorithms for chemical reaction networks
Author kaandocal
Popularity
18 Stars
Updated Last
1 Year Ago
Started In
April 2021

# FiniteStateProjection.jl

Finite State Projection [1] algorithms for chemical reaction networks based on Catalyst.jl and ModelingToolkit.jl. Converts descriptions of reaction networks into ODEProblems and SteadyStateProblems for use with DifferentialEquations.jl.

## Features:

• Built on top of Catalyst.jl
• FSP equations are generated as ODEFunction/ODEProblems and can be solved with DifferentialEquations.jl, with on-the-fly generation of targeted functions for improved performance
• The Chemical Master Equation can be represented as a SparseMatrixCSC

More information is available in the documentation. Please feel free to open issues and submit pull requests!

## Examples

### Birth-Death System

using FiniteStateProjection
using OrdinaryDiffEq

rn = @reaction_network begin
σ, 0 --> A
d, A --> 0
end σ d

sys = FSPSystem(rn)

# Parameters for our system
ps = [ 10.0, 1.0 ]

# Initial distribution (over 1 species)
u0 = zeros(50)
u0[1] = 1.0

prob = convert(ODEProblem, sys, u0, (0, 10.0), ps)
sol = solve(prob, Vern7())

### Telegraph Model

using FiniteStateProjection
using OrdinaryDiffEq

rn = @reaction_network begin
σ_on * (1 - G_on), 0 --> G_on
σ_off, G_on --> 0
ρ, G_on --> G_on + M
d, M --> 0
end σ_on σ_off ρ d

sys = FSPSystem(rn)

# Parameters for our system
ps = [ 0.25, 0.15, 15.0, 1.0 ]

# Initial distribution (over two species)
u0 = zeros(2, 50)
u0[1,1] = 1.0

prob = convert(ODEProblem, sys, u0, (0, 10.0), ps)
sol = solve(prob, Vern7())