Skip to content

Commit e7c20a8

Browse files
committed
Use numpy exp() in tsat()
1 parent 40fdb20 commit e7c20a8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

t2thermo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def sat(t, bounds = False):
258258
"""Saturation pressure (Pa) as a function of temperature (deg C).
259259
If bounds is True, returns None if the temperature is out of
260260
range."""
261+
import numpy as np
261262
a = [0., -7.691234564, -2.608023696e1, -1.681706546e2, 6.423285504e1,
262263
-1.189646225e2, 4.167117320, 2.097506760e1, 1.0e9, 6.0]
263264
if bounds:
@@ -275,7 +276,7 @@ def sat(t, bounds = False):
275276
SC = SC * X1
276277
d1 = 1.0 + a[6] * X1 + a[7] * X2
277278
d2 = a[8] * X2 + a[9]
278-
PC = exp(SC / (TC * d1) - X1 / d2)
279+
PC = np.exp(SC / (TC * d1) - X1 / d2)
279280
return PC * 2.212e7
280281
else: return None
281282
else: return None

0 commit comments

Comments
 (0)