# Chapter 8 - First law of thermodynamics¶

## Example 1 - pg 211¶

In :
#calculate the Joules required
#Initialization of variables
P=1.0132*10**6 #dynes/cm**2
A=100 #cm**2
z=10 #cm
#calculations
w=P*A*z*10**-7
#results
print '%s %.4e %s' %("Joules =",w,"J")

Joules = 1.0132e+02 J


## Example 2 - pg 211¶

In :
#calculate the Calories required
#Initialization of variables
P=1.0132*10**6 #dynes/cm**2
A=100 #cm**2
z=10 #cm
#calculations
w=P*A*z*10**-7
cal=w/4.184
#results
print '%s %.3f %s' %("Calories =",cal,"cal")

Calories = 24.216 cal


## Example 3 - pg 217¶

In :
#calculate the Heat of vaporization and the Change in energy
#Initialization of variables
T=373.2 #K
n=1. #mol
qp=9720. #cal/mol
#calculations
q=n*qp
w=1.987*T
dE=q-w
#results
print '%s %d %s' %("Heat of vaporization =",q,"cal")
print '%s %d %s' %("\n Change in energy =",dE,"cal")

Heat of vaporization = 9720 cal

Change in energy = 8978 cal


## Example 4 - pg 222¶

In :
#calculate the work done, Heat transferred and change in energy
#Initialization of variables
T1=25+273. #K
T2=25+273. #K
#calculations
print "Since, T2=T1, dE=0"
dE=0
w=0
q=dE+w
#results
print '%s %d %s' %("\n Work done = ",w,"J")
print '%s %d %s' %("\n Heat transferred =",q,"J")
print '%s %d %s' %("\n Change in energy = ",dE,"J")

Since, T2=T1, dE=0

Work done =  0 J

Heat transferred = 0 J

Change in energy =  0 J


## Example 5 - pg 224¶

In :
#calculate the Vibrational energy
#Initialization of variables
R=1.987 #cal/deg mol
#calculations
Cvtr=1.5*R
Cvrot=1.5*R
Cvt=Cvtr+Cvrot
print "Observed Cv= 6.43"
Cvobs=6.43
Cvvib=Cvobs-Cvt
#results
print '%s %.2f %s' %("Vibrational =",Cvvib,"cal/deg mol")

Observed Cv= 6.43
Vibrational = 0.47 cal/deg mol