Chapter 3 : The first law of thermodynamics

Example 3.1 Page No : 34

In [1]:
# Variables
p = 1.013*10**6 			#dynecm**2
T = 273.16 			#K
V = 773.4  			#cc
n = 0.0687 			#cal
#CALCCULATIONS
W = p*V/T
k = W/n

# Results
print  'Work of expansion  = %.2e ergs'%(W)
print  ' 1 cal  = %.2e ergs'%(k)
Work of expansion  = 2.87e+06 ergs
 1 cal  = 4.17e+07 ergs

Example 3.2 Page No : 44

In [2]:
# Variables
import math 
R = 8.314*10**7 			#J/mol K
T = 298.2    	    		#K
p1 = 1.         			#atm
p2 = 5.	    		        #atm

# Calculations
W = R*T*math.log(p1/p2)

# Results
print  'Work of expansion  = %.2e ergs mole**-1 '%(W)
Work of expansion  = -3.99e+10 ergs mole**-1 
In [ ]: