【发布时间】:2017-06-06 22:15:59
【问题描述】:
if 1:
T1=300
P1=1
h1=462
s1=4.42
hf=29
sf=0.42
print("The inlet conditions to compressor are 1atm pressure & 300K")
Wi=(T1*(s1-sf))-(h1-hf)
P2= input("What is the final compression pressure? ")
T2= input("What is the final compression temperature? ")
h2= float(input("From graph, enthalpy at point 2 is "))
s2= float(input("From graph, entropy at point 2 is "))
y= float((h1-h2)/(h1-hf))
W= float((T1*(s1-s2))-(h1-h2))
Wf= float(W/y)
FOM= float(Wi/Wf)
print("")
print("Yield= %f") %(y)
print("Work reqd per unit mass of gas compressed= %f KJ/kg") %(W)
print("Work reqd per unit mass of gas liquified= %f KJ/kg") %(Wf)
print("Figure of Merit= %f") %(FOM)
压缩机的入口条件是 1atm 压力和 300K 最终压缩压力是多少? 20 最终压缩温度是多少? 300 从图中,点 2 的焓为 432 从图中,点 2 的熵为 2.74
产量= %f 回溯(最近一次通话最后): 文件“”,第 19 行,在 print("产量 = %f") %(y) TypeError: 不支持的操作数类型 %: 'NoneType' 和 'float'
【问题讨论】:
-
print函数返回None,然后您将%运算符应用到它,其值为y,即float,因此您得到错误@987654327 @
标签: python python-3.x