Main API
Reaction Systems
This section describes the FSPSystem
struct, a thin wrapper around Catalyst's ReactionSystem
for use with this package.
FiniteStateProjection.FSPSystem
— TypeThin wrapper around Catalyst.ReactionSystem
for use with this package.
Constructor: FSPSystem(rs::ReactionSystem[, ih=DefaultIndexHandler(); combinatoric_ratelaw::Bool=true])
Creating ODE systems
The following methods convert a reaction network into a system of ODEs representing the time-dependent FSP. This package provides a flexible way to represent the FSP in memory via index handlers, see [Index Handlers] for more information.
Base.convert
— MethodBase.convert(::Type{ODEFunction}, sys::FSPSystem)
Return an ODEFunction
defining the right-hand side of the CME.
Creates an ODEFunction
for use with DifferentialEquations
. This is where most of the work in the package happens; for best performance it is suggested to build an ODEFunction
once for a given reaction system and reuse it instead of directly converting a reaction system to an ODEProblem
(which implicitly calls this function).
SciMLBase.ODEProblem
— MethodDiffEqBase.ODEProblem(sys::FSPSystem, u0, tmax[, p])
Return an ODEProblem
for use in DifferentialEquations
. This function implicitly calls convert(ODEFunction, sys)
. It is usually more efficient to create an ODEFunction
first and then use that to create ODEProblem
s.
Steady-State Problems
Computing steady-state distributions can be done using the SteadyStateDiffEq.jl package. At the moment FiniteStateProjection.jl adjusts the rate matrix so that reactions leaving the truncated state space have propensity 0.
Base.convert
— MethodBase.convert(::Type{ODEFunction}, sys::FSPSystem, ::SteadyState)
Return an ODEFunction
defining the right-hand side of the CME, for use with SteadyStateProblem
s.
SciMLBase.SteadyStateProblem
— MethodDiffEqBase.SteadyStateProblem(sys::FSPSystem, u0[, p])
Return a SteadyStateProblem
for use in `DifferentialEquations.