Skip to content

Commit

Permalink
Changed SteadyStateProblem conversion interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kaandocal committed Jun 25, 2024
1 parent 1453f65 commit d693b3b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/mainapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Computing steady-state distributions can be done using the SteadyStateDiffEq.jl

```@docs
Base.convert(::Type{ODEFunction}, ::FSPSystem, ::SteadyState)
Base.convert(::Type{SteadyStateProblem}, ::FSPSystem, u0, p)
DiffEqBase.SteadyStateProblem(::FSPSystem, u0, p)
```
4 changes: 2 additions & 2 deletions src/build_rhs_ss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ with `SteadyStateProblem`s.
Base.convert(::Type{ODEFunction}, sys::FSPSystem, ::SteadyState) = ODEFunction{true}(build_rhs_ss(sys))

"""
Base.convert(::Type{SteadyStateProblem}, sys::FSPSystem, u0[, p])
DiffEqBase.SteadyStateProblem(sys::FSPSystem, u0[, p])
Return a `SteadyStateProblem` for use in `DifferentialEquations.
"""
function Base.convert(::Type{SteadyStateProblem}, sys::FSPSystem, u0, pmap=NullParameters())
function DiffEqBase.SteadyStateProblem(sys::FSPSystem, u0, pmap=NullParameters())
SteadyStateProblem(convert(ODEFunction, sys, SteadyState()), u0, pmap_to_p(sys, pmap))
end
2 changes: 1 addition & 1 deletion test/birthdeath2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ solA = solve(probA, Vern7(), abstol=1e-6, saveat=tt)

## Steady-State Tests

prob = convert(SteadyStateProblem, sys, u0, pmap)
prob = SteadyStateProblem(sys, u0, pmap)
sol = solve(prob, SSRootfind())
sol.u ./= sum(sol.u)

Expand Down
2 changes: 1 addition & 1 deletion test/feedbackloop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ A_fsp_ss = SparseMatrixCSC(sys, (2, Nmax), pmap, SteadyState())

@test A_ss A_fsp_ss

prob = convert(SteadyStateProblem, sys, u0, pmap)
prob = SteadyStateProblem(sys, u0, pmap)
sol = solve(prob, SSRootfind())
sol.u ./= sum(sol.u)

Expand Down

0 comments on commit d693b3b

Please sign in to comment.