From f83cdf37fce4c63835574c03860c6043c2b874ba Mon Sep 17 00:00:00 2001 From: Sam Isaacson Date: Fri, 15 Nov 2024 11:50:38 -0500 Subject: [PATCH] drop new test --- test/extensions/bifurcation_kit.jl | 78 +++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/test/extensions/bifurcation_kit.jl b/test/extensions/bifurcation_kit.jl index f2c2523b8..539c5c8ff 100644 --- a/test/extensions/bifurcation_kit.jl +++ b/test/extensions/bifurcation_kit.jl @@ -233,42 +233,42 @@ let end # Tests the bifurcation when one of the parameters depends on another parameter, initial condition, etc. -let - rn = @reaction_network begin - @parameters k ksq = k^2 ratechange - (k, ksq), A <--> B - end - - rn = complete(rn) - u0_guess = [:A => 1., :B => 1.] - p_start = [:k => 2.] - - bprob = BifurcationProblem(rn, u0_guess, p_start, :k; plot_var = :A, u0 = [:A => 5., :B => 3.]) - p_span = (0.1, 6.0) - opts_br = ContinuationPar(dsmin = 0.0001, dsmax = 0.001, ds = 0.0001, max_steps = 10000, p_min = p_span[1], p_max = p_span[2], n_inversion = 4) - bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside = true) - plot(bif_dia, xlabel = "k", ylabel = "A", xlims = (0, 6), ylims=(0,8)) - - xs = getfield.(bif_dia.γ.branch, :x) - ks = getfield.(bif_dia.γ.branch, :param) - @test_broken @. 8 * (ks / (ks + ks^2)) ≈ xs - - # Test that parameter updating happens correctly in ODESystem - t = default_t() - kval = 4. - @parameters k ksq = k^2 tratechange = 10. - @species A(t) B(t) - rxs = [(@reaction k, A --> B), (@reaction ksq, B --> A)] - ratechange = (t == tratechange) => [k ~ kval] - u0 = [A => 5., B => 3.] - tspan = (0.0, 30.0) - p = [k => 1.0] - - @named rs2 = ReactionSystem(rxs, t, [A, B], [k, ksq, tratechange]; discrete_events = ratechange) - rs2 = complete(rs2) - - oprob = ODEProblem(rs2, u0, tspan, p) - sol = OrdinaryDiffEq.solve(oprob, Tsit5(); tstops = 10.0) - xval = sol.u[end][1] - @test isapprox(xval, 8 * (kval / (kval + kval^2)), atol=1e-3) -end +# let +# rn = @reaction_network begin +# @parameters k ksq = k^2 +# (k, ksq), A <--> B +# end + +# rn = complete(rn) +# u0_guess = [:A => 1., :B => 1.] +# p_start = [:k => 2.] + +# bprob = BifurcationProblem(rn, u0_guess, p_start, :k; plot_var = :A, u0 = [:A => 5., :B => 3.]) +# p_span = (0.1, 6.0) +# opts_br = ContinuationPar(dsmin = 0.0001, dsmax = 0.001, ds = 0.0001, max_steps = 10000, p_min = p_span[1], p_max = p_span[2], n_inversion = 4) +# bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside = true) +# plot(bif_dia, xlabel = "k", ylabel = "A", xlims = (0, 6), ylims=(0,8)) + +# xs = getfield.(bif_dia.γ.branch, :x) +# ks = getfield.(bif_dia.γ.branch, :param) +# @test_broken @. 8 * (ks / (ks + ks^2)) ≈ xs + +# # Test that parameter updating happens correctly in ODESystem +# t = default_t() +# kval = 4. +# @parameters k ksq = k^2 tratechange = 10. +# @species A(t) B(t) +# rxs = [(@reaction k, A --> B), (@reaction ksq, B --> A)] +# ratechange = (t == tratechange) => [k ~ kval] +# u0 = [A => 5., B => 3.] +# tspan = (0.0, 30.0) +# p = [k => 1.0] + +# @named rs2 = ReactionSystem(rxs, t, [A, B], [k, ksq, tratechange]; discrete_events = ratechange) +# rs2 = complete(rs2) + +# oprob = ODEProblem(rs2, u0, tspan, p) +# sol = OrdinaryDiffEq.solve(oprob, Tsit5(); tstops = 10.0) +# xval = sol.u[end][1] +# @test isapprox(xval, 8 * (kval / (kval + kval^2)), atol=1e-3) +# end