From 80d6e6ae6a6ebae1a765a18b9023f490091637d8 Mon Sep 17 00:00:00 2001 From: Denis-Titov Date: Thu, 4 Jul 2024 11:26:48 -0700 Subject: [PATCH] modify qssa rate equation derivation to allow rate calculation in absence of products --- src/qssa_general_rate_equation_derivation.jl | 8 ++++++-- test/runtests.jl | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qssa_general_rate_equation_derivation.jl b/src/qssa_general_rate_equation_derivation.jl index ea50d56..5d0ba85 100644 --- a/src/qssa_general_rate_equation_derivation.jl +++ b/src/qssa_general_rate_equation_derivation.jl @@ -2787,14 +2787,18 @@ end Keq, ) Vmax = 1.0 - Vmax_rev = + Vmax_rev = ifelse( + !isinf(product_K_products), Vmax * (product_K_products)^num_products / - (Keq * (product_K_substrates)^num_substrates) + (Keq * (product_K_substrates)^num_substrates), + 0.0, + ) Rate = ( Vmax * (S1 * S2 * S3 / (product_K_substrates)^num_substrates) - Vmax_rev * (P1 * P2 * P3 / (product_K_products)^num_products) ) / Z + return Rate end diff --git a/test/runtests.jl b/test/runtests.jl index 05f3bb8..d7c4cbd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,7 +9,7 @@ using SafeTestsets @safetestset "QSSA Rate Eq Derivation" begin include("tests_for_qssa_general_rate_eq_derivation.jl") end - @safetestset "MWC Rate Eq Fitting" begin + @safetestset "MWC and QSSA Rate Eq Fitting" begin include("tests_for_rate_eq_fitting.jl") end @safetestset "Plotting" begin