Skip to content

Commit 0d50188

Browse files
committed
merge fix
1 parent 4a890af commit 0d50188

File tree

3 files changed

+20
-109
lines changed

3 files changed

+20
-109
lines changed

src/steady_state_stability.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Stability Analysis ###
22

33
"""
4-
stability(u::Vector{T}, rs::ReactionSystem, p; sparse=false, ss_jac = steady_state_jac(u, rs, p; sparse=sparse), t=Inf, non_autonomous_war=true)
4+
stability(u::Vector{T}, rs::ReactionSystem, p; sparse=false, ss_jac = steady_state_jac(u, rs, p; sparse=sparse), t = Inf, non_autonomous_warn = true)
55
66
Compute the stability of a steady state (Returned as a `Bool`, with `true` indicating stability).
77
@@ -11,8 +11,8 @@ Arguments:
1111
- `p`: The parameter set for which we want to compute stability.
1212
- `sparse=false`: If we wish to create a sparse Jacobian for the stability computation.
1313
- `ss_jac = steady_state_jac(u, rs; sparse=sparse)`: It is possible to pre-compute the Jacobian used for stability computation using `steady_state_jac`. If stability is computed for many states, precomputing the Jacobian may speed up evaluation.
14-
- `t=Inf`: The time point at which stability is computed.
15-
- `non_autonomous_war=true`: If the system is non-autonomous (e.g. a rate depends on t), a warning will be given. Set this to false to remove that. Alternatively, specify a nonInf value for `t`.
14+
- `t = Inf`: The time point at which stability is computed.
15+
- `non_autonomous_warn = true`: If the system is non-autonomous (e.g. a rate depends on t), a warning will be given. Set this to false to remove that. Alternatively, specify a nonInf value for `t`.
1616
1717
Example:
1818
```julia
@@ -31,9 +31,10 @@ Notes:
3131
y states (each being a `Vector`) is provided as `u`, stability is computed for each state separately.
3232
"""
3333
function steady_state_stability(u::Vector{T}, rs::ReactionSystem, p;
34-
sparse=false, ss_jac = steady_state_jac(rs; u0=u, sparse=sparse), t=Inf, non_autonomous_war=true) where T
34+
sparse=false, ss_jac = steady_state_jac(rs; u0=u, sparse=sparse),
35+
t = Inf, non_autonomous_warn =true) where T
3536
# Warning checks.
36-
!is_autonomous(rs) && non_autonomous_war && @warn "Attempting to compute stability for a non-autonomous system. Set `non_autonomous_war=false` to disable this warning."
37+
!is_autonomous(rs) && non_autonomous_warn && @warn "Attempting to compute stability for a non-autonomous system. Set `non_autonomous_warn = false` to disable this warning."
3738

3839
# Because Jacobian currently requires u and p to be a normal vector.
3940
# Can be removed once this get fixed in MTK.

test/extensions/bifurcation_kit.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ let
174174
@test all(1 ./ k1s .* (1 .- xs) .≈ xs)
175175

176176
# Checks that there is an error if information for conserved quantities computation is not provided.
177-
@test_throws Exception bprob = BifurcationProblem(rn, u_guess, p_start, k1; plot_var = X1)
177+
@test_throws Exception BifurcationProblem(rn, u_guess, p_start, k1; plot_var = X1)
178178
end
179179

180180

@@ -214,4 +214,17 @@ let
214214

215215
# Computes bifurcation diagram.
216216
@test_throws Exception BifurcationProblem(incomplete_network, u0_guess, p_start, :p)
217+
end
218+
219+
# Tests that computation for non-autonomous systems yields appropriate errors.
220+
let
221+
# Create t-dependant model.
222+
rn = @reaction_network begin
223+
(p/t,d), 0 <--> X
224+
end
225+
u0_guess = [:X => 1.0]
226+
p_start = [:p => 1.0, :d => 0.2]
227+
228+
# Attempts to build a BifurcationProblem.
229+
@test_throws Exception BifurcationProblem(rn, u0_guess, p_start, :p)
217230
end

test/simulation_and_solving/solve_nonlinear.jl

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)