Skip to content

Commit f668160

Browse files
committed
update heaviside argument
1 parent ebbcb8e commit f668160

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chempy/kinetics/rates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ def heaviside(x, z):
198198
elif hasattr(backend, 'clip'): # e.g. numpy
199199
def heaviside(x, z):
200200
assert z == 0
201-
lx = backend.log(backend.maximum(x, tiny))
202-
xclp = be.clip(lx, lo, hi)
201+
lx = backend.log(backend.maximum(backend.array(x), tiny))
202+
xclp = backend.clip(lx, lo, hi)
203+
x = (xclp - lo)/(hi - lo)
203204
y = (3 - 2*x)*x*x
204205
return y
205206
else:

0 commit comments

Comments
 (0)