In [1]:

```
import math
# Variables:
OC = 200./1000 #m
PC = 700./1000 #m
omega = 120. #rad/s
#Solution:
#Refer Fig. 15.5
OM = 127./1000
CM = 173./1000
QN = 93./1000
NO = 200./1000 #m
#Velocity and acceleration of the piston:
#Calculating the velocity of the piston P
vP = omega*OM #m/s
#Calculating the acceleration of the piston P
aP = omega**2*NO #m/s**2
#Velocity and acceleration of the mid-point of the connecting rod:
#By measurement
OD1 = 140./1000
OD2 = 193./1000 #m
#Calculating the velocity of D
vD = omega*OD1 #m/s
#Calculating the acceleration of D
aD = omega**2*OD2 #m/s**2
#Angular velocity and angular acceleration of the connecting rod:
#Calculating the velocity of the connecting rod PC
vPC = omega*CM #m/s
#Calculating the angular velocity of the connecting rod PC
omegaPC = vPC/PC #rad/s
#Calculating the math.tangential component of the acceleration of P with respect to C
atPC = omega**2*QN #m/s**2
#Calculating the angular acceleration of the connecting rod PC
alphaPC = atPC/PC #ra/s**2
#Results:
print " Velocity of the piston P, vP = %.2f m/s."%(vP)
print " Acceleration of the piston P, aP = %d m/s**2."%( aP)
print " Velocity of D, vD = %.1f m/s."%(vD)
print " Acceleration of D, aD = %.1f m/s**2."%(aD)
print " Angular velocity of the connecting rod PC, omegaPC = %.2f rad/s."%(omegaPC)
print " Angular acceleration of the connecting rod PC alphaPC = %.2f rad/s**2."%(alphaPC)
```

In [2]:

```
import math
# Variables:
OC = 150./1000 #m
PC = 600./1000 #m
CD = 150./1000 #m
N = 450. #rpm
#Solution:
#Refer Fig. 15.6
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#By measurement
OM = 145./1000
CM = 78./1000
QN = 130./1000
NO = 56./1000 #m
#Velocity and acceleration of alider:
#Calculating the velocity of the slider P
vP = omega*OM #m/s
#Calculating the acceleration of the slider P
aP = omega**2*NO #m/s**2
#Velocity and acceleration of point D on the connecting rod:
#Calculating the length od CD1
CD1 = CD/PC*CM #m
#By measurement
OD1 = 145./1000
OD2 = 120./1000 #m
#Calculating the velocity of point D
vD = omega*OD1 #m/s
#Calculating the acceleration of point D
aD = omega**2*OD2 #m/s**2
#Angular velocity and angular acceleration of the connecting rod:
#Calculating the velocity of the connecting rod PC
vPC = omega*CM #m/s
#Calculating the angular velocity of the connecting rod
omegaPC = vPC/PC #rad/s
#Calculating the tangential component of the acceleration of P with respect to C
atPC = omega**2*QN #m/s**2
#Calculating the angular acceleration of the connecting rod PC
alphaPC = atPC/PC #rad/s**2
#Results:
print " Velocity of the slider P vP = %.3f m/s."%(vP)
print " Acceleration of the slider P aP = %.1f m/s**2."%(aP)
print " Velocity of point D vD = %.3f m/s."%(vD)
print " Acceleration of point D aD = %.2f m/s**2."%(aD)
print " Angular velocity of the connecting rod omegaPC = %.3f rad/s."%(omegaPC)
print " Angular acceleration of the connecting rod PC alphaPC = %.2f rad/s**2."%(alphaPC)
```

In [6]:

```
import math
# Variables:
r = 300./1000
l = 1. #m
N = 200. #rpm
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Crank angle at which the maximum velocity occurs:
#Calculating the ratio of length of connecting rod to crank radius
n = l/r
#Velocity of the piston vP = omega*r*(math.sin(math.radians(theta)+math.sin(math.radians(2*theta)/(2*n)) .....(i)
#For maximum velocity d(vP)/d(theta) = 0 .....(ii)
#Substituting (i) in (ii) we get 2(math.cos(theta))**2+n*math.cos(theta)-1 = 0
a = 2.
b = n
c = -1.
costheta = (-b+math.sqrt(b**2-4*a*c))/(2*a)
#Calculating the crank angle from the inner dead centre at which the maximum velocity occurs
theta = round(math.degrees(math.acos(costheta))) #degrees
#Calculating the maximum velocity of the piston:
vPmax = omega*r*(math.sin(math.radians(theta))+math.sin(math.radians(2*theta))/(2*n)) #m/s
#Results:
print " Crank angle from the inner dead centre at which the maximum velocity occurs theta = %.2f degrees."%(theta)
print " Maximum velocity of the piston( vPmax) = %.2f m/s."%(vPmax)
```

In [7]:

```
import math
# Variables:
r = 0.3 #m
l = 1.5 #m
N = 180. #rpm
theta = 40. #degrees
#Solution:
#Calculating the angular speed of the piston
omega = 2*math.pi*N/60 #rad/s
#Velocity of the piston:
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the velocity of the piston
vP = omega*r*(math.sin(math.radians(theta))+math.sin(math.radians(2*theta))/(2*n)) #m/s
#Calculating the acceleration of the piston
aP = omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #m/s**2
#Position of the crank for zero acceleration of the piston:
ap1 = 0
#Calculating the position of the crank from the inner dead centre for zero acceleration of the piston
#We have ap1 = omega**2*r*(math.cos(theta1)+math.cos(2*theta1)/n) or 2*(math.cos(theta1))**2+n*math.cos(theta1)-1 = 0
a = 2.
b = n
c = -1.
costheta1 = (-b+math.sqrt(b**2-4*a*c))/(2*a)
#Calculating the crank angle from the inner dead centre for zero acceleration of the piston
theta1 = math.degrees(math.acos(costheta1)) #degrees
#Results:
print " Velocity of the piston vP = %.2f m/s."%( vP)
print " Acceleration of the piston aP = %.2f m/s**2."%(aP)
print " Position of the crank for zero acceleration of the piston theta1 = %.2f degrees or\
%.2f degrees."%(theta1,360-theta1)
```

In [1]:

```
import math
# Variables:
r = 150./1000
l = 600./1000 #m
theta = 60. #degrees
N = 450. #rpm
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Velocity and acceleration of the slider:
#Calculating the ratio of length of connecting rod and crank
n = l/r
#Calculating the velocity of the slider
vP = omega*r*(math.sin(math.radians(theta))+math.sin(math.radians(2*theta))/(2*n)) #m/s
#Calculating the acceleration of the slider
aP = omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #m/s**2
#Angular velocity and angular acceleration of the connecting rod:
#Calculating the angular velocity of the connecting rod
omegaPC = omega*math.cos(math.radians(theta))/n #rad/s
#Calculating the angular acceleration of the connecting rod
alphaPC = round(omega**2*math.sin(math.radians(theta))/n) #rad/s**2
#Results:
print " Velocity of the slider vP = %.1f m/s."%(vP)
print " Acceleration of the slider aP = %.2f m/s**2."%(aP)
print " Angular velocity of the connecting rod omegaPC = %.1f rad/s."%(omegaPC)
print " Angular acceleration of the connecting rod alphaPC = %d rad/s**2."%(alphaPC)
```

In [2]:

```
import math
# Variables:
D = 175./1000 #m
L = 200./1000 #m
r = L/2 #m
l = 400./1000 #m
N = 500. #rpm
mR = 180. #kg
theta = 60 #degrees
#Solution:
omega = round(2*math.pi*N/60,1) #rad/s
# Graphical method
ON = 0.038 # m
aR = omega**2 * ON
FI = mR * aR/1000
print " Inertia force FI = %.2f kN."%(FI)
#Calculating the angular speed of the crank
#Analytical method:
#Calculating the ratio of lengths of connecting rod and crank
n = l/r
#Calculating the inertia force
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n)/1000 #kN
#Results:
print " Inertia force FI = %.2f kN."%(FI)
```

In [28]:

```
import numpy
# Variables:
r = 300./1000 #m
l = 1.2 #m
D = 0.5 #m
mR = 250. #kg
theta = 60. #degrees
dp = 0.35 #p1-p2 N/mm**2
N = 250. #rpm
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Calculating the net load on the piston
FL = (dp)*math.pi/4*(D*1000)**2 #N
#Calculating the ratio of length of connecting rod and crank
n = l/r
#Calculating the accelerating or inertia force on reciprocating parts
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #N
#Calculating the piston effort
FP = (FL-FI)/1000 #kN
#Pressure on slide bars:
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the pressure on the slide bars
FN = FP*math.tan(math.radians(phi)) #kN
#Calculating the thrust in the connecting rod
FQ = FP/math.cos(math.radians(phi)) #kN
#Calculating the tangential force on the crank pin
FT = FQ*math.sin(math.radians(theta+phi)) #kN
#Calculating the turning moment on the crank shaft
T = FT*r #kN-m
#Results:
print " Pressure on the slide bars FN = %.2f kN."%(FN)
print " Thrust in the connecting rod FQ = %.2f kN."%(FQ)
print " Tangential force on the crank-pin FT = %.2f kN."%(FT)
print " Turning moment on the crank shaft T = %.3f kN-m."%(T)
```

In [35]:

```
import math
# Variables:
D = 300./1000 #m
L = 450./1000 #m
r = L/2 #m
d = 50./1000 #m
l = 1.2 #m
N = 200. #rpm
mR = 225. #kg
theta = 125. #degrees
p1 = 30*1000. #N/m**2
p2 = 1.5*1000. #N/m**2
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Calculating the area of the piston
A1 = math.pi/4*D**2 #m**2
#Calculating the area of the piston rod
a = math.pi/4*d**2 #m**2
#Calculating the force on the piston due to steam pressure
FL = round(p1*A1-p2*(A1-a)) #N
#Calculating the ratio of lengths of connecting rod and crank
n = l/r
#Calculating the inertia force on the reciprocating parts
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #N
#Calculating the net force on the piston or piston effort
FP = FL-FI+mR*9.81 #N
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the effective turning moment on the crank shaft
T = FP*math.sin(math.radians(theta+phi))/math.cos(math.radians(phi))*r #N-m
#Results:
print " Effective turning moment of the crank shaft T = %.f N-m."%(T)
# rounding off error
```

In [50]:

```
import math
# Variables:
N = 1800. #rpm
r = 50./1000 #m
l = 200./1000 #m
D = 80./1000 #m
x = 10./1000 #m
mR = 1. #kg
p = 0.7 #N/mm**2
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Net load on the gudgeon pin:
#Calculating the load on the piston
FL = round(math.pi/4*(D*1000)**2*p) #N
#Refer Fig. 15.10
#By measurement
theta = 33. #degrees
#Calculating the ratio of lengths of connecting rod and crank
n = l/r
#Calculating the inertia force on the reciprocating parts
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #N
#Calculating the net load on the gudgeon pin
FP = FL-FI #N
#Thrust in the connecting rod:
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the thrust in the connecting rod
FQ = FP/math.cos(math.radians(phi)) #N
#Calculating the reaction between the piston and cylinder
FN = FP*math.tan(math.radians(phi)) #N
#Engine speed at which the abov values will become zero:
#Calculating the speed at which FI = FL
omega1 = math.sqrt((math.pi/4*(D*1000)**2*p)/(mR*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n))) #rad/s
#Calculating the corresponding speed in rpm
N1 = omega1*60/(2*math.pi) #rpm
print phi
#Results:
print " Net load on the gudgeon pin FP = %.f N."%(FP)
print " Thrust in the connecting rod FQ = %.1f N."%(FQ)
print " Reaction between the piston and cylinder FN = %d N."%(FN)
print " Engine speed at which the above values will become zero N1 = %d rpm."%(N1)
```

In [60]:

```
import math
# Variables:
aP = 36. #m/s**2
theta = 30. #degrees
p = 0.5 #N/mm**2
RF = 600. #N
D = 300./1000 #m
r = 300./1000 #m
mR = 180. #kg
n = 4.5
#Solution:
#Reaction on the guide bars:
#Calculating the load on the piston
FL = round(p*math.pi/4*(D*1000)**2) #N
#Calculating the inertia force due to reciprocating parts
FI = mR*aP #N
#Calculating the piston effort
FP = (FL-FI-RF)/1000 #kN
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the reaction on the guide bars
FN = FP*math.tan(phi) #kN
#Calculating the thrust on the crank shaft bearing
FB = (FP*math.cos(math.radians(phi+theta)))/math.cos(math.radians(phi)) #kN
#Calculating the turning moment on the crank shaft
T = (FP*math.sin(math.radians(theta+phi)))/math.cos(math.radians(phi))*r #kN-m
#Results:
print " Reaction on the guide bars FN = %.f kN."%(FN)
print " Thrust on the crank shaft bearing FB = %.1f kN."%(FB)
print " Turning moment on the crank shaft T = %.2f kN-m."%(T)
# rounding off error
```

In [71]:

```
import math
# Variables:
D = 100./1000 #m
L = 120./1000 #m
r = L/2 #m
l = 250./1000 #m
mR = 1.1 #kg
N = 2000. #rpm
theta = 20. #degrees
p = 700. #kN/m**2
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Net force on the piston:
#Calculating the force due to gas pressure
FL = p*math.pi/4*D**2 #kN
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the inertia force on the piston
FI = round(mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n)) #N
#Calculating the net force on the piston
FP = (FL*1000)-FI+mR*9.81 #N
#Resulmath.tant force on the gudgeon pin:
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(theta)/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the resultant load on the gudgeon pin
FQ = round(FP/math.cos(phi)) #N
#Calculating the thrust on the cylinder walls
FN = FP*math.tan(math.radians(4.7)) #N
#Speed above which the gudgeon pin load would be reversed in direction:
#Calculating the minimum speed for FP to be negative
omega1 = math.sqrt((FL*1000+mR*9.81)/(mR*r*(math.cos(theta)+math.cos(2*theta)/n))) #rad/s
#Calculating the corresponding speed in rpm
N1 = 273*60/(2*math.pi) #rpm
#Results:
print " Net force on the piston FP = %.1f N."%(FP)
print " Resultant load on the gudgeon pin FQ = %d N."%(FQ)
print " Thrust on the cylinder walls FN = %.1f N."%(FN)
print " Speed above which the gudgeon pin load would be reversed in direction N1 > %d rpm."%(N1)
```

In [1]:

```
import math
# Variables:
N = 120. #rpm
D = 250./1000 #m
L = 400./1000 #m
r = L/2 #m
l = 0.6 #m
d = 50./1000 #m
mR = 60. #kg
theta = 45. #degrees
p1 = 550.*1000 #N/m**2
p2 = 70.*1000 #N/m**2
#Solution:
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Turning moment on the crankshaft:
#Calculating the area of the piston on the cover end side
A1 = math.pi/4*D**2 #m**2
#Calculating the area of the piston rod
a = math.pi/4*d**2 #m**2
#Calculating the net load on the piston
FL = p1*A1-p2*(A1-a) #N
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the inertia force on the reciprocating parts
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #N
#Calculating the net force on the piston or piston effort
FP = (FL-FI)/1000 #kN
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the turning moment on the crank shaft
T = (FP*math.sin(math.radians(theta+phi)))/math.cos(math.radians(phi))*r*1000 #N-m
#Calculating the thrust on the bearings
FB = (FP*math.cos(math.radians(theta+phi)))/math.cos(math.radians(phi)) #kN
#Acceleration of the flywheel:
P = 20.*1000 #W
m = 60. #kg
k = 0.6 #m
#Calculating the mass moment of inertia of the flywheel
I = m*k**2 #kg-m**2
#Calculating the resisting torque
TR = P*60/(2*math.pi*N) #N-m
#Calculating the acceleration of the flywheel
alpha = (T-TR)/I #rad/s**2
#Results:
print " Turning moment on the crank shaft T = %f N-m."%(T) # rounding off error
print " Thrust on the bearings FB = %.2f kN."%(FB)
print " Acceleration of the flywheel alpha = %.1f rad/s**2."%(alpha)
```

In [94]:

```
import math
# Variables:
D = 300./1000 #m
L = 500./1000 #m
r = L/2 #m
n = 4.5
N = 180. #rpm
mR = 280. #kg
theta = 45. #degrees
p1 = 0.1 #N/mm**2
CR = 14. #Compression ration V1/V2
p4 = 2.2
#Solution:
#Refer Fig. 15.12
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Calculating the pressure corresponding to point 2
p2 = p1*(CR)**1.35 #N/mm**2
#Calculating the swept volume
VS = math.pi/4*D**2*L #m**3
VC = VS/(CR-1) #m**3
#Calculating the volume corresponding to point 3
V3 = VC+(1/10*VS) #m**3
#Calculating the print lacement of the piston corresponding to crank print lacement of 45 degrees
x = r*((1-math.cos(math.radians(theta)))+(math.sin(math.radians(theta)))**2/(2*n)) #m
#Calculating the volume corresponding to point 4'
V4dash = VC+(math.pi/4*D**2*x) #m**2
#Calculating the pressure corresponding to point 4'
p3 = p2
p4dash = p3*(V3/V4dash)**1.35 #N/mm**2
#Calculating the difference of pressures on two sides of the piston
p = (p4-p1)*10**6 #N/m**2
#Calculating the net load on the piston
FL = p*math.pi/4*D**2 #N
#Calculating the inertia force on the reciprocating parts
FI = mR*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #N
#Calculating the net force on the piston or piston effort
FP = FL-FI+mR*9.81 #N
#Crank-pin effort:
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = math.degrees(math.asin(sinphi))
#Calculating the crank-pin effort
FT = (FP*math.sin(math.radians(theta+phi)))/(math.cos(math.radians(phi))*1000) #kN
#Calculating the thrust on the bearings
FB = (FP*math.cos(math.radians(theta+phi)))/(math.cos(math.radians(phi))*1000) #kN
#Calculating the turning moment on the crankshaft
T = FT*r #kN-m
#Results:
print " Crank-pin effort FT = %.3f kN."%(FT)
print " Thrust on the bearings FB = %.3f kN."%(FB)
print " Turning moment on the crankshaft T = %.2f kN-m."%(T)
```

In [12]:

```
import math
# Variables:
D = 240./1000 #m
L = 360./1000 #m
r = L/2 #m
l = 0.6 #m
N = 300. #rpm
mR = 160. #kg
pA = (8+1.03)*10**5
pE = (-0.75+1.03)*10**5 #N/m**2
FR = 500. #N
theta = 75. #degrees
#Solution:
#Refer Fig. 15.13
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Calculating the stroke volume
VS = math.pi/4*D**2*L #m**3
#Calculating the volume of steam at cut-off
VB = VS/3 #m**3
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the print lacement of the piston when the crank position is 75 degrees from the top dead centre
x = r*((1-math.cos(math.radians(theta)))+(math.sin(math.radians(theta)))**2/(2*n)) #m**3
#Calculating the volume corresponding to point C'
VCdash = VS*x/L #m**3
#Calculating the pressure corresponding to point C'
pB = pA
pCdash = round((pB*VB)/VCdash) #N/m**2
#Calculating the difference of pressures on the two sides of the piston
p = round(pCdash-pE) #N/m**2
#Calculating the net load on the piston
FL = round(math.pi/4*D**2*p) #N
#Calculating the inertia force on the reciprocating parts
FI = round(mR*omega**2*r*(math.cos(math.radians(theta))+(math.cos(math.radians(2*theta))/n))) #N
#Calculating the piston effort
FP = FL-FI+mR*9.81-FR #N
#Turning moment on the crankshaft:
#Calculating the angle of inclination of the connecting rod to the line of stroke
sinphi = math.sin(math.radians(theta))/n #degrees
phi = round(math.degrees(math.asin(sinphi)),3)
#Calculating the turning moment on the crankshaft
T = (FP*math.sin(math.radians(theta+phi)))/math.cos(math.radians(phi))*r #N-m
#Results:
print " Turning moment on the crankshaft T = %d N-m."%(T)
# note : rounding error. please check using calculator
```

In [26]:

```
import math
# Variables:
l = 300. #mm
l1 = 200. #mm
m = 15. #kg
I = 7000. #kg-mm**2
#Solution:
#Refer Fig. 15.16 and Fig. 15.17
#Calculating the radius of gyration of the connecting rod about an axis pasmath.sing through its centre of gravity
kG = math.sqrt(I/m) #mm
#Calculating the distance of other mass from the centre of gravity
l2 = (kG)**2/l1 #mm
#Calculating the magnitude of mass placed at the small end centre
m1 = (l2*m)/(l1+l2) #kg
#Calculating the magnitude of the mass placed at a dismath.tance l2 from the centre of gravity
m2 = (l1*m)/(l1+l2) #kg
#Results:
print " Mass placed at the small end centre m1 = %.2f kg."%(m1)
print " Mass placed at a distance %.2f mm from the centre of gravity m2 = %.2f kg."%(l2,m2)
```

In [27]:

```
import math
# Variables:
h = 650./1000 #m
l1 = (650.-25)/1000 #m
m = 37.5 #kg
tp = 1.87 #seconds
#Solution:
#Refer Fig. 15.18 and Fig. 15.19
#Calculating the radius of gyration of the connecting rod about an axis pasmath.sing through its centre of gravity
kG = math.sqrt((tp/(2*math.pi))**2*(9.81*h)-h**2) #m
#Calculating the dismath.tance of mass m2 from the centre of gravity
l2 = (kG)**2/l1 #m
#Calculating the magnitude of mass placed at the small end centre
m1 = (l2*m)/(l1+l2) #kg
#Calculating the magnitude of mass placed at a dismath.tance l2 from centre of gravity
m2 = (l1*m)/(l1+l2) #kg
#Results:
print " Mass placed at the small end centre A m1 = %d kg."%(m1)
print " Mass placed at a distance %.3f m from G m2 = %.1f kg."%(l2,m2)
```

In [28]:

```
from scipy.optimize import fsolve
import math
# Variables:
m = 55. #kg
l = 850./1000 #m
d1 = 75./1000 #m
d2 = 100./1000 #m
tp1 = 1.83 #sec
tp2 = 1.68 #seconds
#Solution:
#Refer Fig. 15.20
#Calculating the length of equivalent simple pendulum when suspended from the top of small end bearing
L1 = 9.81*(tp1/(2*math.pi))**2 #m
#Calculating the length of equivalent simple pendulum when suspended from the top of big end bearing
L2 = 9.81*(tp2/(2*math.pi))**2 #m
#Radius of gyration of the rod about an axis pasmath.sing through the centre of gravity and perpendicular to the plane of oscillation:
#Calculating the distances of centre of gravity from the top of small end and big end bearings
#We have h1*(L1-h1) = h2*(L2-h2) or h1**2-h2**2+h2*L2-h1*L1 = 0 .....(i)
#Also h1+h2 = d1/2+l+d2/2 or h1+h2-d1/2-l-d2/2 = 0 .....(ii)
def f(x):
y = [0,0]
h1 = x[0]
h2 = x[1]
y[0] = h1**2-h2**2+h2*L2-h1*L1
y[1] = h1+h2-d1/2-l-d2/2
return y
z = fsolve(f,[1,1])
h1 = z[0]
h2 = z[1] #m
#Calculating the required radius of gyration of the rod
kG = math.sqrt(h1*(L1-h1)) #m
#Calculating the moment of inertia of the rod
I = m*(kG)**2 #kg-m**2
#Dynamically equivalent system for the rod:
#Calculating the distance of the mass situated at the centre of small end bearing from the centre of gravity
l1 = h1-d1/2 #m
#Calculating the distance of the second mass from the centre of gravity towards big end bearing
l2 = (kG)**2/l1 #m
#Calculating the magnitude of the mass situated at the centre of small end bearing
m1 = (l2*m)/(l1+l2) #kg
#Calculating the magnitude of the second mass
m2 = (l1*m)/(l1+l2) #kg
#Results:
print " Radius of gyration of the rod about an axis passing through the centre of\
gravity and perpendicular to the plane of oscillation, kG = %.3f m."%(kG)
print " Moment of inertia of the rod, I = %.2f kg-m**2."%(I)
print " Magnitude of the mass situated at the centre of small end bearing, m1 = %.2f kg."%(m1)
print " Magnitude of the second mass, m2 = %.2f kg."%(m2)
```

In [30]:

```
import math
# Variables:
m = 2. #kg
l = 250./1000 #m
l1 = 100./1000 #m
kG = 110./1000 #m
alpha = 23000. #rad/s**2
#Solution:
#Equivalent dynamical system:
#Calculating the distance of the second mass from the centre of gravity
l2 = (kG)**2/l1 #m
#Calculating the magnitude of the mass placed at the gudgeon pin
m1 = (l2*m)/(l1+l2) #kg
#Calculating the magnitude of the mass placed at a distance l2 from centre of gravity
m2 = (l1*m)/(l1+l2) #kg
#Correction couple:
#Calculating the magnitude of l3
l3 = l-l1 #m
#Calculating the new radius of gyration
k1 = math.sqrt(l1*l3) #m**2
#Calculating the correction couple
Tdash = m*(k1**2-kG**2)*alpha #N-m
#Results:
print " Mass placed at the gudgeon pin, m1 = %.1f kg."%(m1)
print " Mass placed at a distance %.3f m from the centre of gravity m2 = %.1f kg."%(l2,m2)
print " Correction couple Tdash = %.1f N-m."%(Tdash)
```

In [32]:

```
import math
# Variables:
r = 125. #mm
OC = r #mm
l = 500. #mm
PC = l #mm
PG = 275. #mm
kG = 150. #mm
mC = 60. #kg
N = 600. #rpm
theta = 45. #degrees
#Solution:
#Refer Fig. 15.24
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Acceleration of the piston:
#By measurement
NO = 90./1000 #m
#Calculating the acceleration of the piston
aP = omega**2*NO #m/s**2
#The magnitude position and direction of inertia force due to the mass of the connecting rod:
#By measurement
gO = 103./1000 #m
#Calculating the magnitude of the inertia force of the connecting rod
FC = mC*omega**2*gO/1000 #kN
#Results:
print " Acceleration of the piston aP = %.1f m/s**2."%(aP)
print " The magnitude of inertia force due to the mass of the connecting rod FC = %.1f kN."%(FC)
```

In [110]:

```
import math
# Variables:
D = 240./1000 #m
L = 600./1000 #m
r = L/2 #m
l = 1.5 #m
GC = 500./1000 #m
kG = 650./1000 #m
mR = 300.
mC = 250. #kg
N = 125. #rpm
theta = 30. #degrees
#Solution:
#Refer Fig. 15.25
#Calculating the angular speed of the crank
omega = round(2*math.pi*N/60,1) #rad/s
#Analytical method:
#Calculating the distance of centre of gravity of the connecting rod from P
l1 = l-GC #m
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the inertia force due to total mass of the reciprocating parts at P
FI = int((mR+(l-l1)/l*mC)*omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n)) #N
#Calculating the corresponding torque due to FI
TI = int(FI*r*(math.sin(math.radians(theta))+math.sin(math.radians(2*theta))/ \
(2*math.sqrt(n**2-(math.sin(math.radians(theta)))**2)))) #N-m
#Calculating the equivalent length of a simple pendulum when swung about an axis through P
L = ((kG)**2+(l1)**2)/l1 #m
#Calculating the correcting torque
TC = mC*l1*(l-L) *(omega**2 * math.sin(math.radians(60)))/(2*n**2) #N-m
#Calculating the torque due to the weight of the connecting rod at C
TW = mC*9.81*(l1/n)*math.cos(math.radians(theta)) #N-m
#Calculating the total torque exerted on the crankshaft
Tt = TI+TC+TW #Total torque exerted on the crankshaft N-m
#Results:
print " Total torque exerted on the crankshaft = %.1f N-m."%(round(Tt,-1))
# rounding off error
```

In [112]:

```
import math
# Variables:
N = 1200. #rpm
L = 110./1000
r = L/2
l = 250./1000
PC = l
CG = 75./1000 #m
mC = 1.25 #kg
theta = 40. #degrees
#Solution:
#Refer Fig. 15.26
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#Radius of gyration of the connecting rod about an axis through its mass centre:
#Calculating the distance of the centre of gravity from the point of suspension
l1 = l-CG #m
PG = l1
#Calculating the frequency of oscillation
n = 21./20 #Hz
#Calculating the radius of gyration of the connecting rod about an axis through its mass centre
kG = round(math.sqrt((9.81*l1/(2*math.pi*n)**2)-l1**2)*1000) #mm
#Acceleration of the piston:
#Calculating the ratio of lengths of the connecting rod and crank
n = l/r
#Calculating the acceleration of the piston
aP = omega**2*r*(math.cos(math.radians(theta))+math.cos(math.radians(2*theta))/n) #m/s**2
#Calculating the angular acceleration of the connecting rod
alphaPC = (-omega**2*math.sin(math.radians(theta)))/n #rad/s**2
#Inertia torque exerted on the crankshaft:
#Calculating the mass of the connecting rod at P
m1 = (l-l1)/l*mC #kg
#Calculating the vertical inertia force
FI = round(m1*aP) #N
#By measurement
OM = 0.0425
NC = 0.035 #m
#Calculating the corresponding torque due to FI
TI = FI*OM #N-m
#Calculating the equivalent length of a simple pendulum when swung about an axis pasmath.sing through P
L = ((kG/1000)**2+(l1)**2)/l1 #m
#Calculating the correction couple
Tdash = mC*l1*(l-L)*alphaPC #N-m
#Calculating the corresponding torque on the crankshaft
TC = -Tdash*math.cos(math.radians(theta))/n #N-m
#Calculating the torque due to mass at P
TP = m1*9.81*OM #N-m
#Calculating the equivalent mass of the connecting rod at C
m2 = mC*(l1/l) #kg
#Calculating the torque due to mass at C
TW = m2*9.81*NC #N-m
#Calculating the inertia force exerted on the crankshaft
Ti = TI+TC-TP-TW #Inertia torque exerted on the crankshaft N-m
#Results:
print " Radius of gyration of the connecting rod about an axis through its mass centre kG = %d mm."%(kG)
print " Acceleration of the piston aP = %.1f m/s**2."%(aP)
print " Angular acceleration of the connecting rod alphaPC = %.1f rad/s**2."%(alphaPC)
print " Inertia torque exerted on the crankshaft = %.3f N-m."%(Ti)
# rounding off error
```

In [36]:

```
import math
# Variables:
l = 225./1000 #m
PC = l #m
L = 150./1000 #m
r = L/2 #m
D = 112.5/1000 #m
PG = 150./1000 #m
kG = 87.5/1000 #m
mC = 1.6
mR = 2.4 #kg
theta = 40 #degrees
p = 1.8*10**6 #N/m**2
N = 2000. #rpm
#Solution:
#Refer Fig. 15.27
#Calculating the angular speed of the crank
omega = 2*math.pi*N/60 #rad/s
#By measurement
NO = 0.0625
gO = 0.0685
IC = 0.29
IP = 0.24
IY = 0.148
IX = 0.08 #m
#Calculating the force due to gas pressure
FL = math.pi/4*D**2*p #N
#Calculating the inertia force due to mass of the reciprocating parts
FI = mR*omega**2*NO #N
#Calculating the net force on the piston
FP = FL-FI #N
#Calculating the inertia force due to mass of the connecting rod
FC = mC*omega**2*gO #N
#Calculating the force acting perpendicular to the crank OC
FT = ((FP*IP)-((mC*9.81*IY)+(FC*IX)))/IC #N
#By measurement
FN = 3550.
FR = 7550.
FQ = 13750. #N
#Results:
print " Resultant force on the crank pin FQ = %d N."%(FQ)
```