2525 u0 = [:X1 => 2.0 , :X2 => 2.0 , :X3 => 2.0 , :X2_2X3 => 2.0 ]
2626
2727 # Computes the single steady state, checks that when given to the ODE rhs, all are evaluated to 0.
28- hc_ss = hc_steady_states (rs, ps; u0= u0, show_progress= false )
28+ hc_ss = hc_steady_states (rs, ps; u0 = u0, show_progress = false , seed = 0x000004d1 )
2929 hc_ss = Pair .(unknowns (rs), hc_ss[1 ])
30- @test maximum (abs .(f_eval (rs, hc_ss, ps, 0.0 ))) ≈ 0.0 atol= 1e-12
30+ @test maximum (abs .(f_eval (rs, hc_ss, ps, 0.0 ))) ≈ 0.0 atol = 1e-12
3131
3232 # Checks that not giving a `u0` argument yields an error for systems with conservation laws.
33- @test_throws Exception hc_steady_states (rs, ps; show_progress= false )
33+ @test_throws Exception hc_steady_states (rs, ps; show_progress = false )
3434end
3535
3636# Tests for network with multiple steady state.
3737# Tests for Symbol parameter input.
38- # Tests that passing kwargs to HC.solve does not error.
38+ # Tests that passing kwargs to HC.solve does not error and have an effect (i.e. modifying the seed
39+ # slightly modified the output in some way).
3940let
4041 wilhelm_2009_model = @reaction_network begin
4142 k1, Y --> 2 X
4243 k2, 2 X --> X + Y
4344 k3, X + Y --> Y
4445 k4, X --> 0
4546 end
46- ps = [:k3 => 1.0 , :k2 => 2.0 , :k4 => 1.5 , :k1 => 8.0 ]
47+ ps = [:k3 => 1.0 , :k2 => 2.0 , :k4 => 1.5 , :k1 => 8.0 ]
4748
48- hc_ss_1 = hc_steady_states (wilhelm_2009_model, ps; seed= 0x000004d1 , show_progress= false )
49- @test sort (hc_ss_1, by= sol-> sol[1 ]) ≈ [[0.0 , 0.0 ], [0.5 , 2.0 ], [4.5 , 6.0 ]]
49+ hc_ss_1 = hc_steady_states (wilhelm_2009_model, ps; seed = 0x000004d1 , show_progress = false )
50+ @test sort (hc_ss_1, by = sol-> sol[1 ]) ≈ [[0.0 , 0.0 ], [0.5 , 2.0 ], [4.5 , 6.0 ]]
5051
51- hc_ss_2 = hc_steady_states (wilhelm_2009_model, ps; seed= 0x000004d2 , show_progress= false )
52- hc_ss_3 = hc_steady_states (wilhelm_2009_model, ps; seed= 0x000004d2 , show_progress= false )
52+ hc_ss_2 = hc_steady_states (wilhelm_2009_model, ps; seed = 0x000004d2 , show_progress = false )
53+ hc_ss_3 = hc_steady_states (wilhelm_2009_model, ps; seed = 0x000004d2 , show_progress = false )
5354 @test hc_ss_1 != hc_ss_2
5455 @test hc_ss_2 == hc_ss_3
5556end
6970 ps = (:kY1 => 1.0 , :kY2 => 3 , :kZ1 => 1.0 , :kZ2 => 4.0 )
7071 u0_1 = (:Y1 => 1.0 , :Y2 => 3 , :Z1 => 10 , :Z2 => 40.0 )
7172
72- ss_1 = sort (hc_steady_states (rs_1, ps; u0= u0_1, show_progress= false ), by= sol-> sol[1 ])
73+ ss_1 = sort (hc_steady_states (rs_1, ps; u0 = u0_1, show_progress = false , seed = 0x000004d1 ), by = sol-> sol[1 ])
7374 @test ss_1 ≈ [[0.2 , 0.1 , 3.0 , 1.0 , 40.0 , 10.0 ]]
7475
7576 rs_2 = @reaction_network begin
8182 end
8283 u0_2 = [:B2 => 1.0 , :B1 => 3.0 , :A2 => 10.0 , :A1 => 40.0 ]
8384
84- ss_2 = sort (hc_steady_states (rs_2, ps; u0= u0_2, show_progress= false ), by= sol-> sol[1 ])
85+ ss_2 = sort (hc_steady_states (rs_2, ps; u0 = u0_2, show_progress = false , seed = 0x000004d1 ), by = sol-> sol[1 ])
8586 @test ss_1 ≈ ss_2
8687end
8788
9697 d, X --> 0
9798 end
9899 ps = [:v => 5.0 , :K => 2.5 , :n => 3 , :d => 1.0 ]
99- sss = hc_steady_states (rs, ps; filter_negative= false , show_progress= false )
100+ sss = hc_steady_states (rs, ps; filter_negative = false , show_progress = false , seed = 0x000004d1 )
100101
101102 @test length (sss) == 4
102103 for ss in sss
103- @test f_eval (rs,sss[1 ], last .(ps), 0.0 )[1 ] ≈ 0.0 atol= 1e-12
104+ @test f_eval (rs,sss[1 ], last .(ps), 0.0 )[1 ] ≈ 0.0 atol = 1e-12
104105 end
105106
106- @test_throws Exception hc_steady_states (rs, [:v => 5.0 , :K => 2.5 , :n => 2.7 , :d => 1.0 ]; show_progress= false )
107+ ps = [:v => 5.0 , :K => 2.5 , :n => 2.7 , :d => 1.0 ]
108+ @test_throws Exception hc_steady_states (rs, ps; show_progress = false , seed = 0x000004d1 )
107109end
108110
109111
124126
125127 # Checks that homotopy continuation correctly find the system's single steady state.
126128 ps = [:p => 2.0 , :d => 1.0 , :k => 5.0 ]
127- hc_ss = hc_steady_states (rs, ps)
129+ hc_ss = hc_steady_states (rs, ps; show_progress = false , seed = 0x000004d1 )
128130 @test hc_ss ≈ [[2.0 , 0.2 , 10.0 ]]
129131end
130132
137139 p_start = [:p => 1.0 , :d => 0.2 ]
138140
139141 # Computes bifurcation diagram.
140- @test_throws Exception hc_steady_states (incomplete_network, p_start)
142+ @test_throws Exception hc_steady_states (incomplete_network, p_start; show_progress = false , seed = 0x000004d1 )
141143end
142144
143145# Tests that non-autonomous system throws an error
146148 (k,t), 0 <--> X
147149 end
148150 ps = [:k => 1.0 ]
149- @test_throws Exception hc_steady_states (rs, ps)
151+ @test_throws Exception hc_steady_states (rs, ps; show_progress = false , seed = 0x000004d1 )
150152end
0 commit comments