Chapter 2 : Work

Example 2.1 Page No : 28

In [1]:
import math

			
# Variables
Force = 180 			#in N 			#horizontal force
theta = 30 			#in degrees 			#angle of inclination
distance = 12 			#in m 			#distance moved by block along inclined plane.
 
			
# Calculations and Results
Work = Force * (distance * math.cos(math.radians(theta))) 			#in J 			# Work done
Work = 0.001 * Work 			# Work done in KJ
print "Work done by block = %.4f KJ"%(Work);
Work done by block = 1.8706 KJ

Example 2.2 Page No : 31

In [1]:
			
# Variables
mass_body = 2 			#in kg 			#mass of body
L = 5 			#in m 			#vertical distance
g = 9.8 			#in m/s**2 			#acceleration due to gravity

			
# Calculations and Results
Work_done_by_agent = mass_body * g * L 			#in Nm 			#work done by agent
Work_done_by_body = -1*Work_done_by_agent
print "Work done by agent = %.0f Nm"%(Work_done_by_agent);
print "Work done by body = %.0f Nm"%(Work_done_by_body);
Work done by agent = 98 Nm
Work done by body = -98 Nm

Example 2.4 Page No : 39

In [5]:
import math 
from scipy.integrate import quad 
			
# Variables
p1 = 1.5 * 10**(5) 			#N/m**2 			#initial pressure in ballon
d1 = 0.25 			#m 			#initial diameter of balloon
d2 = 0.3 			#m 			#final diameter of balloon
p_atm = 10**(5) 			#N/m**2 			#atmospheric pressure
			
# Calculations and Results

#Part (a)
print "Part a";
print "As p is proportional to d, p = k*d, where k is proportionality constant"
print "Therefore,";

k = p1/d1;
print "p1 = k*d1 => k = p1/d1 = %.2f/%.2f) = %.1e N/m**3"%(p1,d1,k);

p2 = k*d2; 			#N/m**2 			#final pressure in balloon
print "p2 = k*d2 = %.2f*%.2f) = %.1e N/m**2"%(k,d2,p2);


def f0(d): 
	 return k*(math.pi/2)*(d**3)

W_air =  quad(f0,d1,d2)[0]

print "Work done by balloon on air = %.0f Nm"%(W_air);

			#Part (b)
print "Part b";

def f1(d): 
	 return p_atm*(0.5*math.pi*(d**2))

W_atm =  quad(f1,d2,d1)[0]

print "Work done by atmosphere on balloon = %.2f Nm"%(W_atm);
W_balloon = -1*(W_air+W_atm);
print "Work done by balloon = -Work done by air + Work done by atmosphere = -%.0f %.0f = %.0f Nm"%(W_air,W_atm,W_balloon);
Part a
As p is proportional to d, p = k*d, where k is proportionality constant
Therefore,
p1 = k*d1 => k = p1/d1 = 150000.00/0.25) = 6.0e+05 N/m**3
p2 = k*d2 = 600000.00*0.30) = 1.8e+05 N/m**2
Work done by balloon on air = 988 Nm
Part b
Work done by atmosphere on balloon = -595.59 Nm
Work done by balloon = -Work done by air + Work done by atmosphere = -988 -596 = -393 Nm

Example 2.5 Page No : 40

In [5]:
import math 


# Variables
p1 = 10 			#bar 			#initial pressure
V1 = 0.1 			#m**3 			#initial volume
p2 = 2 			#bar 			#final pressure
V2 = 0.35 			#m**3 			#final volume

			
# Calculations and Results
print "Let the expansion process follow the path pV**n = constant";
print "Therefore "
n = (math.log(p1/p2))/(math.log(V2/V1));
print "n = lnp1/p2/lnV2/V1 = ln%.2f/%.2f/ln %.2f/%.2f = %.4f"%(p1,p2,V2,V1,n);
W_d = (p1*V1 - p2*V2)*10**5/(n-1) 			#J 			#Work interaction for pure substance
print "Work interaction for pure substance = p1V1 - p2V2)/n-1) = %.2f kJ"%(W_d*.001)
Let the expansion process follow the path pV**n = constant
Therefore 
n = lnp1/p2/lnV2/V1 = ln10.00/2.00/ln 0.35/0.10 = 1.2847
Work interaction for pure substance = p1V1 - p2V2)/n-1) = 105.37 kJ

Example 2.6 Page No : 41

In [6]:
import math 
			
# Variables
p1 = 1.0 			#bar 			#initial pressure
V1 = 0.1 			#m**3 			#initial volume
p2 = 6   			#bar 			#final pressure
         			#and p1*(V1**1.4) = p2*(V2**1.4)

			
# Calculations and Results
#Part (a)
print "Part a";
V2 = V1*(p1/p2)**(1/1.4) 			#m**3 			#final volume
print "Final Volume = %.4f m**3"%(V2);

W_d = (10**5)*(p1*V1 - p2*V2)/(1.4-1); 			#J 			#Work of compression for air
print "Work of compression for air = %.1f KJ"%(W_d*.001);

#Part (b)
print "Part b";
V2 = (p1/p2)*V1; 			#m**3 			#final volume
print "Final Volume = %.4f m**3"%(V2);

W_d = (10**5)*p1*V1*math.log(V2/V1); 			#J 			#Work done on air
print "Work done on air = %.1f KJ"%(W_d*.001);
Part a
Final Volume = 0.0278 m**3
Work of compression for air = -16.7 KJ
Part b
Final Volume = 0.0167 m**3
Work done on air = -17.9 KJ

Example 2.7 Page No : 43

In [7]:
import math 
			
# Variables
#four-stroke engine
x = 3. 			#number of cylinders
y = 1. 			#engine is math.single-acting
n = 500. 			#rev/min 
N = n/2 			#cycles/min
D = 0.075 			#m 			#bore length
L = 0.1 			#m 			#stroke length
a = 6.*10**(-4) 			#m**2 			#area
l = 0.05 			#m 			#length
S = 2.*10**8 			#N/m**3 			#spring constant

			
# Calculations and Results
p_m = (a/l)*S 			#Pa 			#mep

print "Mean effective pressure, mep{Pm} = %.2f kPa"%(p_m*.001)
A = (math.pi/4)*D**2 			#m**2

print "Indicated power{P_ind} = %.2f kW"%(x*y*p_m*L*A*N/60000)
Mean effective pressure, mep{Pm} = 2400.00 kPa
Indicated power{P_ind} = 13.25 kW

Example 2.8 Page No : 45

In [8]:
import math 
from numpy import *
			
# Variables
N = poly1d([.5,0]) 			#n is engine speed
x = 6 			#six cylinders
y = 1 			#assumed
d = 0.1 			#m 			#bore length
A = math.pi*(0.1)**2/4 			#m**2 			#Area
L = 0.15 			#m 			#stroke length
P_shaft = 24.78 			#KW 			#Power of shaft
T = 474.9 			#Nm 			#Torque in the crank shaft
l = 0.05 			#m 			#length of indicator diagram
a = 9.37*10**(-4) 			#cm**2 			#area of indicator diagram
S = 0.5*(10**8) 			#N/m**3 			#spring constant

			
# Calculations and Results
p_m = a*S/l 			#mean pressure difference
print "Mean pressure difference = %.2f N/m**2"%(p_m);

P_ind = (x*y)*p_m*(L*A*N/60000) 			#indicated power
#C = coeff(P_ind)
C = poly(P_ind)
print "Indicated Power = %.6f n kW"%(C[1])

P_shaft = 2*math.pi*poly([1,0])*T/60000 			#shaft power output
print "Shaft power output in KW)= %.5f n kW"%(P_shaft[0])

#Mechanical_efficiency = poly(P_shaft,1)/coeff(P_ind,1)*100
Mechanical_efficiency = poly(P_shaft[1])/poly(P_ind[1])*100
print "Mechanical Efficiency = %.0f %%"%(-Mechanical_efficiency[1])
Mean pressure difference = 937000.00 N/m**2
Indicated Power = -0.055194 n kW
Shaft power output in KW)= 0.04973 n kW
Mechanical Efficiency = 90 %

Example 2.9 Page No : 46

In [9]:
import math 
			
# Variables
d = 0.4 			#m 			#cylinder diameter
t = 10. 			#min 			#Time taken for stirring
L = 0.49 			#m 			#distance moved by the piston
p_atm = 1. 			#bar 			#atmospheric pressure
W_net = -1965. 			#Nm 			#net work done
n = 750. 			#rev/min 			#rotational velocity of electric motor
I = 0.9 			#A 			#current
V = 24. 			#V 			#voltage

			
# Calculations and Results
#Part(a)
print "Part a";
W_d = 10**5*p_atm * (math.pi/4) * d**2 * L; 			#Nm 			#work done by fluid on piston
print "Work done by fluid on the piston = %.1f Nm"%(W_d);
W_str = W_net - W_d; 			#Nm 			#Work done by stirrer
print "Work done by stirrer on the fluid = %.1f Nm"%(W_str);
P_shaft = abs(W_str)/(t*60); 			#W 			#shaft power output
print "Shaft power output = %.2f W"%(P_shaft);
T = (P_shaft*60)/(2*math.pi*n); 			#Nm 			#Torque in the driving shaft
print "Torque in the driving shaft = %.3f Nm"%( T);

#Part(b)
print "Part b";
W_bat = I*V*t*60; 			#Nm 			#work done by battery
print "Work done by battery = %.1f Nm"%(W_bat);
W_motor = -1*(W_bat+W_str) 			#Nm 			#work done by motor
print "Work done by motor = %.1f Nm"%(W_motor);
Part a
Work done by fluid on the piston = 6157.5 Nm
Work done by stirrer on the fluid = -8122.5 Nm
Shaft power output = 13.54 W
Torque in the driving shaft = 0.172 Nm
Part b
Work done by battery = 12960.0 Nm
Work done by motor = -4837.5 Nm