In [1]:

```
#A body of mass 5 kg falls freely from a height of 10 m.
#Calculate the kinetic energy of the body as it strikes the ground.
#Show that it is equal to the initial potential energy.
#initialisation of variables
m= 5 #kg
h= 10 #m
gc= 1.0 #kg m/N s^2
#CALCULATIONS
v2= 2*h*gc*9.8 #velocity squared
KE= (m*v2)/(2*gc) #Kinetic energy
PE= (m*gc*9.8*h)/(gc) #Potential energy
#RESULTS
print '%s %.2f' % ('Kinetic Energy (J) = ',KE)
print '%s %.2f' % (' \n Potential Energy (J) = ',PE)
raw_input('press enter key to exit')
```

Out[1]:

In [2]:

```
#At one state in a flow process steam at 149 F has a quality of 20%.
#What is the enthalpy?
#initialisation of variables
T= 149 #F
p= 20 #No units
#CALCULATIONS
print '%s' %('From keenan and keyes steam tables')
h= 116.96+(p/100.)*1008.7 #enthalpy
#RESULTS
print '%s %.2f' % ('\n h (Btu/lbm) = ',h)
raw_input('press enter key to exit')
```

Out[2]:

In [7]:

```
#A horizontal force of 30 lb moves a block weighing 40 lb a distance of 10 ft
#to the left in 2 s. Determine (a) the total work?
#(b) the work done against friction
#(c) the work done against gravity
#(d)the frictional horse power.Assume the kinetic coefficient of friction=0.1
#initialisation of variables
F= 30 #lb
w= 40 #lb
l= 10 #ft
t= 2 #sec
mu= 0.1
#CALCULATIONS
f= mu*w #Frictional force
W= F*l-f*l #Total work done
FW= f*l #Frictional work
Fhp= FW/(550.*t) #Frictional horsepower
#RESULTS
print '%s %.2f' % ('Total work done (ft lbf) = ',W)
print '%s %.2f' % (' \n Frictional work (ft lbf) = ',FW)
print '%s %.4f' % (' \n Frictional horsepower (hp) = ',Fhp)
raw_input('press enter key to exit')
```

Out[7]:

In [4]:

```
#If all the frictional work in the previous problem is converted into heat,
#how many Btu's are involved?
#initialisation of variables
N= 40 #lbf
mu= 0.1
l= 10 #ft
J= 778. #ft lbf/Btu
#CALCULATIONS
f= mu*N #frictional force
FW= f*l #frictional work
n= FW/J #No. of btu involved
#RESULTS
print '%s %.3f' % ('No of Btu involved (ft Btu) = ',n)
raw_input('press enter key to exit')
```

Out[4]:

In [5]:

```
#A 50 gm sample of metal is finely divided, heated at 98 C,
#and then dropped into 75 gm water at 19 C in a calorimeter.
#The final temperature of the mixture is 27 C. The mass of the calorimeter is
#123 gm, and its specific heat is 0.1 If no heat is lost, determine the mean
#specific heat of the metal sample.
#initialisation of variables
M= 50. #gm
T= 98. #C
Mw= 75. #gm
T1= 19. #C
Tm= 27. #C
Mc= 123. #gm
SH= 0.1 #cal gm^-1 C^-1
Qinst= 6.5 #cal
#CALCULATIONS
c= (Mc*SH+Mw+Qinst)/(M*(T-Tm)) #Mean specific heat of the metal sample
c=0.21
#RESULTS
print '%s %.4f' % ('Mean specific heat of the metal sample (cal/C gm) = ',c)
print '%s' %('\n The answer given in textbook is a bit different due to rounding off error')
print '%s' %('\n Please use a calculator to find that the answer given in textbook is wrong.')
raw_input('press enter key to exit')
```

Out[5]:

In [6]:

```
#A beaker contains 500 gm of water at 80 C. How many grams of ice at -4F must
#be added to water so that the final temperature will be 50 C?
#initialisation of variables
Mw= 500 #gm
Tw= 80 #C
Ti= -4 #F
Tf= 50 #C
ci= 0.5 #cal/gm
L= 79.7 #cal/gm
cw= 1 #cal/gm
Dt= Tw-Tf
#CALCULATIONS
Tf1= (5./9.)*(Ti-32) #Temp in F
Dt1= Tf1-Tf #delta T
m= (Mw*cw*Dt)/(ci*(-Dt1)+L) #grams of ice
#RESULTS
print '%s %.2f' % ('Grams of ice can be added (gm) = ',m)
raw_input('press enter key to exit')
```

Out[6]: