Skip to content

Commit 9cc5f9c

Browse files
committed
doc changes
1 parent 834af28 commit 9cc5f9c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/src/steady_state_functionality/steady_state_stability_computation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
After system steady states have been found using [HomotopyContinuation.jl](@ref homotopy_continuation), [NonlinearSolve.jl](@ref nonlinear_solve), or other means, their stability can be computed using Catalyst's `steady_state_stability` function. Systems with conservation laws will automatically have these removed, permitting stability computation on systems with singular Jacobian.
33

44
!!! warn
5-
Catalyst currently computes steady state stabilities using the naive approach of checking whether a system's largest eigenvalue real part is negative. While more advanced stability computation methods exist (and would be a welcome addition to Catalyst), there is no direct plans to implement these. Furthermore, Catalyst uses a arbitrary tolerance $tol ~ 1.5*10^-7$ to determine whether a computed eigenvalue is far away enough from 0 to be reliably used. This selected threshold, however, have not been subject to further analysis (and can be changed through the `tol` argument).
5+
Catalyst currently computes steady state stabilities using the naive approach of checking whether a system's largest eigenvalue real part is negative. While more advanced stability computation methods exist (and would be a welcome addition to Catalyst), there is no direct plans to implement these. Furthermore, Catalyst uses a arbitrary tolerance $tol 1.5*10^-7$ to determine whether a computed eigenvalue is far away enough from 0 to be reliably used. This selected threshold, however, have not been subject to further analysis (and can be changed through the `tol` argument).
66

77
## Basic examples
88
Let us consider the following basic example:
@@ -19,7 +19,7 @@ steady_state = [:X => 4.0]
1919
steady_state_stability(steady_state, rn, ps)
2020
```
2121

22-
Next, let us consider the following self-activation loop:
22+
Next, let us consider the following [self-activation loop](@ref ref):
2323
```@example stability_1
2424
sa_loop = @reaction_network begin
2525
(hill(X,v,K,n),d), 0 <--> X
@@ -31,18 +31,15 @@ import HomotopyContinuation
3131
ps = [:v => 2.0, :K => 0.5, :n => 3, :d => 1.0]
3232
steady_states = hc_steady_states(sa_loop, ps)
3333
```
34-
Next, we can apply `steady_state_stability` directly to this steady state vector, receiving the stability for each:
34+
Next, we can apply `steady_state_stability` to each steady state yielding a vector of their stabilities:
3535
```@example stability_1
36-
steady_state_stability(steady_states, sa_loop, ps)
36+
[steady_state_stability(sstate, sa_loop, ps) for sstate in steady_states]
3737
```
3838

39-
!!! note
40-
For systems with [conservation laws](@ref homotopy_continuation_conservation_laws), `steady_state_jac` must be supplied a `u0` vector (indicating species concentrations for conservation law computation). This is required to eliminate the conserved quantities, preventing a singular Jacobian. These are supplied using the `u0` optional argument.
41-
4239
## Pre-computing the Jacobian to increase performance when computing stability for many steady states
4340
Catalyst uses the system Jacobian to compute steady state stability, and the Jacobian is computed once for each call to `steady_state_stability`. If you repeatedly compute stability for steady states of the same system, pre-computing the Jacobian and supplying it to the `steady_state_stability` function can improve performance.
4441

45-
In this example we use the self-activation loop from previously, pre-computes the Jacobian, and uses it to multiple `steady_state_stability` calls:
42+
In this example we use the self-activation loop from previously, pre-computes its Jacobian, and uses it to multiple `steady_state_stability` calls:
4643
```@example stability_1
4744
ss_jac = steady_state_jac(sa_loop)
4845
@@ -60,4 +57,7 @@ It is possible to designate that a [sparse Jacobian](@ref ref) should be used us
6057
```@example stability_1
6158
ss_jac = steady_state_jac(sa_loop; sparse = true)
6259
nothing # hide
63-
```
60+
```
61+
62+
!!! warn
63+
For systems with [conservation laws](@ref homotopy_continuation_conservation_laws), `steady_state_jac` must be supplied a `u0` vector (indicating species concentrations for conservation law computation). This is required to eliminate the conserved quantities, preventing a singular Jacobian. These are supplied using the `u0` optional argument.

src/steady_state_stability.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ function steady_state_jac(rs::ReactionSystem; u0 = [sp => 0.0 for sp in unknowns
119119

120120
# Creates an `ODEProblem` with a Jacobian. Dummy values for `u0` and `ps` must be provided.
121121
ps = [p => 0.0 for p in parameters(rs)]
122-
return ODEProblem(rs, u0, 0, ps; jac = true, remove_conserved = true,
123-
combinatoric_ratelaws = get_combinatoric_ratelaws(rs))
122+
return ODEProblem(rs, u0, 0, ps; jac = true, remove_conserved = true, sparse = sparse,
123+
combinatoric_ratelaws = combinatoric_ratelaws)
124124
end
125125

126126
# Converts a `u` vector from a vector of values to a map.

0 commit comments

Comments
 (0)