# Chapter 4 - Thermodynamics: the Second Law¶

## Example I1 - Pg 80¶

In [1]:
#Calculate the entropy change at 273 and 373 K
#Initialization of variables
H=100. #kJ
T1=273. #K
T2=373.#K
#calculations
S1=H*1000/T1
S2=H*1000/T2
#results
print '%s %d %s' %('Entropy change at 273 K is',S1,'J/K ')
print '%s %d %s' %('\n Entropy change at 373 K is',S2,'J/K ')

Entropy change at 273 K is 366 J/K

Entropy change at 373 K is 268 J/K


## Example I2 - Pg 84¶

In [2]:
#Calculate the enthalpy of vaporization
#Initialization of variables
T=59.2 #K
#calculations
Hvap=85*(273.2+T)/1000.
#results
print '%s %d %s' %('Enthalpy of vaportization  =',Hvap,'kJ/mol')

Enthalpy of vaportization  = 28 kJ/mol


## Example I3 - Pg 88¶

In [4]:
#Calculate the change in entropy
#Initialization of variables
SH2O=70 #J/K mol
SH2=131 #J/K mol
SO2=205 #J/K mol
#calculations
deltaS=2*SH2O-2*SH2-SO2
print '%s %d %s' %('Change in entropy =',deltaS,'J/K mol')

Change in entropy = -327 J/K mol


## Example E1 - Pg 84¶

In [5]:
#Calculate the net heat transferred and entropy production per day
#Initialization of variables
Power=100. #W
time=1 #day
T=20 #C
#calculations
timeins=1*24*3600
qsurr=timeins*Power
Ssurr=qsurr/(T+273.)
#results
print '%s %d %s' %('Heat transferred to surroundings =',qsurr,'J')
print '%s %.2e %s' %('\n Entropy production per day =',Ssurr,'J/k')

Heat transferred to surroundings = 8640000 J

Entropy production per day = 2.95e+04 J/k


## Example E2 - Pg 92¶

In [6]:
#calculate the amount of food bird must consume
#Initialization of variables
import math
g=9.81 #m/s^2
m=30*math.pow(10,-3) #kg
d=10 #m
H=2.828*math.pow(10,6) #j/mol
M=180. #g/mol
#calculations
w=g*m*d
n=w/H
m=n*M
#results
print '%s %.1e %s' %('Amount bird must consume =',m,'g')

Amount bird must consume = 1.9e-04 g