Chapter 1 : Introduction

Example 1.1 Page No : 8

In [1]:
#Given 
m = 100 #m is the mass of the object in kg
a = 10 #a is the acceeleration due to gravity in m/s**2

#To determine the force exerted
F = m*a #F is the force exerted by the object in kg
print "Force exerted by the object= ",
print "%.6f" %F,
print "N"
F = (1/9.8065)*m*a;#F is the force exerted by the object in kgf
print "Force exerted by the object= ",
print "%.6f" %F,
print "N"
#end
Force exerted by the object=  1000.000000 N
Force exerted by the object=  101.973181 N

Example 1.4 Page No : 13

In [2]:
#Given
h = 100 #h is the height of the water fall in m
n = .855 #n is the efficiency of the turbine
g = 9.8 #g is the acceleration due to gravity in m/(s**2)
E = 100*10*3600;#E is the potential enery of water available to the bulb for 10 hours in watt or J/s

#To determine the mass of water required
m = (E/(g*h*n)) #m is the mass of water required for lighting the bulb for 10 hours in Kg
print "Mass of water required for lighting the bulb for 10 hours in Kg= ",
print "%.6f"%m,
print "Kg"
print "Mass of water required for lighting the bulb for 10 hours in tonnes= ",
print "%.6f"%(m/907.2),
print "Kg"
#end
Mass of water required for lighting the bulb for 10 hours in Kg=  4296.455424 Kg
Mass of water required for lighting the bulb for 10 hours in tonnes=  4.735952 Kg

Example 1.5 Page No : 17

In [6]:
import math 

#Given
n = 1. #n is the Kg mole of an ideal gas
P = 700.*(10**4) #P is the pressure of the system in N/(m**2)
W = 45. #W is the weight of the mass in Kg
M = 20. #M is the weight of the piston and piston rod together in Kg
T = 300. #T is the consmath.tant temperature of the bath in K
h = .4 #h is the height difference of the piston after expansion in m

#To calculate the work obtained
a = (10**-4) #a is the cross sectional area of the cylinder in m**2
V = h*a #V is the volume changed as gas expands in m**3

#(i). If gas alone is the system
#1Kgf = 9.8065Nm
P1 = ((W+M)*9.8065)/(10**-4) #P1 is the resisting pressure when the gas confined in the cylinder taken as a system
W1 = P1*V #W1 is the work done if the gas confined in the cylinder us taken as system
print "Work done by the system if the gas confined in the cylinder is taken as a system is ",
print "%.6f "%W1,
print "Nm"

#(ii). If gas + piston + piston rod is a system
P2 = ((W*9.8065)/(10**-4)) #P2 is the resisting pressure when the gas plus piston plus piston rod is taken as a system
W2 = P2*V #W2 is the Work done by the system if the gas plus piston plus piston rod is taken as a system
print "Work done by the system if the gas plus piston plus piston rod is taken as system is ",
print "%.6f"%W2,
print "Nm"

#(iii). If gas + piston + piston rod +weight is system
P3 = 0 #P3 is the resisting pressure when the gas plus piston plus piston rod plus weight is taken as a system
W3 = P3*V #W3 is the work done by the system if the gas plus piston plus piston rod plus weight is taken as a system
print "Work done by the system if the gas plus piston plus piston rod plus weight is taken as a system is ",
print "%.4f"%W3,
#end
Work done by the system if the gas confined in the cylinder is taken as a system is  254.969000  Nm
Work done by the system if the gas plus piston plus piston rod is taken as system is  176.517000 Nm
Work done by the system if the gas plus piston plus piston rod plus weight is taken as a system is  0.0000

Example 1.6 Page No : 19

In [7]:
import math 

#Given
n = 1 #n is the Kg mole of ideal gas.
P1 = 700*(10**4) #P1 is the initial pressure of the system in N/(m**2)
P2 = 638*(10**4) #P2 is the final pressure of the system in N/(m**2)
T = 300 #T is temperature of the system in K
R = 8314.4 #R is gas consmath.tant in Nm/Kgmole deg K

#To calculate the work done
W = n*R*T*math.log(P1/float(P2)) #W is the work done by the system in Nm
print "Work done by the system is ",
print "%.2e"%W,
print "Nm"
#end
Work done by the system is  2.31e+05 Nm