In [ ]:

```
#It is desired to cool iron parts from 500 F to 100 F by dropping them into
#water intially at 75 F . The specific heat of the iron is 0.120 and the
#specific heat of water may be assumed to be 1. Assuming that all the heat from
#the iron goes to the water and tat none of the water evaporates and that none
#of the water are needed per pound of iron?
#initialisation of variables
T2w= 100. #F
T1w= 75. #F
cw= 1. #Btu/lb F
T2i= 100. #F
T1i= 500. #F
ci= 0.12 #Btu/lb F
mi= 1
#CALCULATIONS
Mw= -mi*ci*(T2i-T1i)/(cw*(T2w-T1w)) #Mass of water required
#RESULTS
print '%s %.2f' %('Pounds of water needed per pound of iron (lb water/lb iron) = ',Mw)
raw_input('press enter key to exit')
```

In [1]:

```
#The specific heat of a certain gas is given by the function. How much heat is
#transferred from a system consisting of 5 lb of this gas to cool it at
#constant pressure from 1540 F to 540 F?
#initialisation of variables
import math
import scipy
from scipy import integrate
m=5. #lb
T1=1540. +460 #R
T2=540+460. #R
#CALCULATIONS
def cp(T):
cp=0.248+0.448*T*T/math.pow(10,8)
return cp;
Qdot=scipy.integrate.quad(cp,T1,T2) #Heat
Q=m*Qdot[0]
#Results
print '%s %.2f' %('Net heat transferred to the system (Btu) = ',Q)
raw_input('press enter key to exit')
```

Out[1]:

In [2]:

```
#Ten pounds of solid sulfur at 70 C are to be heated at constant pressre until
#it is a vapor at 1 atm pressure. How much heat is required?
#initialisation of variables
m= 10 #lb
cp= 0.180 #Btu/lb F
cp1= 0.235 #Btu/lb F
L= 15.8 #btu/lb
L1= 120 #btu/lb
T1= 70 #F
T2= 235 #F
T3= 832 #F
#CALCULATIONS
Qa= m*cp*(T2-T1) #Heat to raise solid temperature
Qb= m*L #Heat to melt solid
Qc= m*cp1*(T3-T2) #Heat to raise liquid temperature
Qd= m*L1 #Heat to vaporize liquid
Q= Qa+Qb+Qc+Qd #Total Heat
#RESULTS
print '%s %.2f' %('Heat required (Btu) = ',Q)
raw_input('press enter key to exit')
```

Out[2]:

In [3]:

```
#A piece of ice having aan intital temperature of 22 F is dropped into an
#insulated tank, which contains 40 lb of water at 70 F. If the temperature
#of water, after equilibrium is reached, is 40F, how many pounds did the ice
#weigh? Assume no heat transfer with other bodies hs occured?
#initialisation of variables
m= 40 #lb
m1= 10 #lb
cp= 1.00 #Btu/lb F
cp1= 0.501 #Btu/lb F
cp2= 0.092 #Btu/lb F
L= 143.3 #btu/lb
L1= 120 #btu/lb
T1= 22 #F
T2= 32 #F
T3= 40 #F
T4= 70 #F
#CALCULATIONS
Qa= cp1*(T2-T1) #Heat to raise solid temperature
Qb= L #Heat to melt solid
Qc= cp*(T3-T2) #Heat to raise liquid temperature
Qd= m*cp*(T3-T4) #Heat required to lower water from 70 to 40F
mi= -Qd/(Qa+Qb+Qc) #Mass
Qe= m1*cp2*(T3-T4) #Heat in case 2 due to copper
mi1= -Qe/(Qa+Qb+Qc) #Mass in case 2
#RESULTS
print '%s %.2f' %('Ice weight (lb of ice) = ',mi)
print '%s %.3f' %(' \n Additional ice required (lb of ice) = ',mi1)
raw_input('press enter key to exit')
```

Out[3]: