From ad6869e45855b783ce6ef232a7822a732fd1baab Mon Sep 17 00:00:00 2001 From: uliw Date: Thu, 29 Oct 2020 11:25:18 -0400 Subject: [PATCH] fixed error in rate constant process --- "esbmtk\t/esbmtk.py" | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git "a/esbmtk\t/esbmtk.py" "b/esbmtk\t/esbmtk.py" index 52daf22b..cd5bf6af 100644 --- "a/esbmtk\t/esbmtk.py" +++ "b/esbmtk\t/esbmtk.py" @@ -2657,7 +2657,7 @@ class RateConstant(Process): reservoir concentration C and a constant which describes the kvalue between the reservoir concentration and the flux scaling - F = kvalue * (C/C0) + F = (C/C0 -1) * k where C denotes the concentration in the ustream reservoir, C0 denotes the baseline @@ -2722,8 +2722,9 @@ def __call__(self, reservoir: Reservoir, i: int) -> None: """ this will be called by the Model.run() method """ - scale: float = reservoir.c[i - 1] / self.C0 * self.kvalue - self.f[i] = self.f[i] * scale + scale: float = (reservoir.c[i - 1] / self.C0 - 1) * self.kvalue + scale = scale * (scale >= 0) # prevent negative fluxes. + self.f[i] = self.f[i] + self.f[i] * scale class Monod(Process): """This process scales the flux as a function of the upstream