Skip to content

Commit 834af28

Browse files
committed
add tolerance test
1 parent 522b6fa commit 834af28

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/steady_state_stability.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ ss_val_type(u::Vector{T}) where {T} = T
7878
ss_val_type(u::Vector{Pair{S,T}}) where {S,T} = T
7979
ss_val_type(u::Dict{S,T}) where {S,T} = T
8080

81-
8281
"""
8382
steady_state_jac(rs::ReactionSystem; u0 = [], sparse = false)
8483

test/miscellaneous_tests/stability_computation.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import HomotopyContinuation
88
using StableRNGs
99
rng = StableRNG(12345)
1010

11-
### Run Tests ###
11+
### Basic Tests ###
1212

1313
# Tests that stability is correctly assessed (using simulation) in multi stable system.
1414
# Tests that `steady_state_jac` function works.
@@ -86,4 +86,17 @@ let
8686

8787
# Confirms error when computing Jacobian with wrong length of u0.
8888
@test_throws Exception steady_state_jac(rn; u0 = [1.0, 1.0])
89-
end
89+
end
90+
91+
### Other Tests ###
92+
93+
# Tests `tol` option. In this case, the maximum eigenvalue real part is -1.0, which generates
94+
# and error with `tol = 100`.
95+
let
96+
rn = @reaction_network begin
97+
(p,d), 0 <--> X
98+
end
99+
p = [:p => 1.0, :d => 1.0]
100+
u = [1.0]
101+
@test_throws Exception steady_state_stability(u, rn, p; tol = 1e2)
102+
end

0 commit comments

Comments
 (0)