【发布时间】:2021-06-01 05:57:28
【问题描述】:
我正在使用 gekko 来求解方程组。作为中间步骤,我使用了将 MV 温度插入以下函数的中间步骤:
def riedelVP(T, const):
'''Returns Vapor Pressure
INPUTS
:T - Temperature (K)
:const - A, B, C, D, E constants for eqn
OUTPUTS
:Y - Pressure in Pascals'''
# unpack constants
a, b, c, d, e = const
# plug into equation
Y = np.exp(a+b/T+c*np.log(T) + d*T**e)
return Y
当我这样做时,我得到以下错误:
我尝试使用 T.value 和 T.value[0] 作为函数的参数而不是 T。TypeError: loop of ufunc does not support argument 0 of type GKVariable which has no callable log method
如何使用 exp 函数并登录 gekko 中间体
【问题讨论】: