Untitled

 avatar
unknown
python
2 years ago
512 B
3
Indexable
# calculate initial and final pressures
R = 8.314 # ideal gas constant
m = 8 # mass of helium
M = 4 # molar mass of helium
n = m / M # number of moles
T1 = 158 + 273 # initial temperature
T2 = 808 + 273 # final temperature
V1 = 3 # initial volume
V2 = 0.5 # final volume
P1 = n * R * T1 / V1 # initial pressure
P2 = n * R * T2 / V2 # final pressure

# calculate increase in useful work potential
w = P1 * V1 - P2 * V2 # work done
DeltaU = abs(w) # increase in useful work potential

print(DeltaU) # output: 4980
Editor is loading...