You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/steady_state_stability.jl
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,8 @@ function steady_state_stability(u::Vector{T}, rs::ReactionSystem, p;
35
35
# Warning checks.
36
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
37
38
-
# Because Jacobian currently requires ps to be a normal vector, can be removed once this get fixed in MTK.
38
+
# Because Jacobian currently requires u and p to be a normal vector.
39
+
# Can be removed once this get fixed in MTK.
39
40
if (u isa Vector{<:Pair}) || (u isa Dict)
40
41
u_dict =Dict(symmap_to_varmap(rs, u))
41
42
u = [u_dict[var] for var instates(rs)]
@@ -45,12 +46,13 @@ function steady_state_stability(u::Vector{T}, rs::ReactionSystem, p;
45
46
p = [p_dict[var] for var inparameters(rs)]
46
47
end
47
48
48
-
# Computes stability
49
+
# Computes stability (by checking that the real part of all eigenvalues are negative).
49
50
jac =ss_jac(u, p, Inf)
50
51
returnmaximum(real.(eigvals(jac))) <0
51
52
end
52
53
# Computes the stability for a vector of steady states.
53
-
functionsteady_state_stability(us::Vector{Vector{T}}, rs::ReactionSystem, p; sparse=false, ss_jac =steady_state_jac(rs; u0=us[1], sparse=sparse)) where T
0 commit comments