diff --git a/docs/src/mainapi.md b/docs/src/mainapi.md index f3bb370..1ea66cf 100644 --- a/docs/src/mainapi.md +++ b/docs/src/mainapi.md @@ -23,9 +23,10 @@ DiffEqBase.ODEProblem(::FSPSystem, u0, tmax, p) ## 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. +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. Pass a [`SteadyState`](@ref) instance to the conversion methods to request this steady-state formulation. ```@docs +SteadyState Base.convert(::Type{ODEFunction}, ::FSPSystem, ::SteadyState) DiffEqBase.SteadyStateProblem(::FSPSystem, u0, p) ``` diff --git a/src/build_rhs_ss.jl b/src/build_rhs_ss.jl index d6f662d..81fb7ad 100644 --- a/src/build_rhs_ss.jl +++ b/src/build_rhs_ss.jl @@ -1,3 +1,18 @@ +""" + struct SteadyState end + +Marker type used to select the steady-state formulation of the Chemical +Master Equation. Passing a `SteadyState()` instance to the conversion and +matrix-building methods requests the right-hand side in which transitions +out of the truncated state space are dropped (their propensity is set to +zero), as required for solving for the stationary distribution rather than +the time-dependent one. + +It is used as a dispatch tag by +[`Base.convert(::Type{ODEFunction}, ::FSPSystem, ::SteadyState)`](@ref), +[`SparseArrays.SparseMatrixCSC(::FSPSystem, ::NTuple, ps, ::SteadyState)`](@ref) +and [`DiffEqBase.SteadyStateProblem(::FSPSystem, u0, p)`](@ref). +""" struct SteadyState end """