# Chapter 4: Mechanisms with Lower Pairs¶

## Example 1, Page 138¶

In [1]:
import math

#Variable declaration
rpm=1000
angle=20#degree

#Calculations&Results
ang=(angle*math.pi)/180
w=2*math.pi*rpm/60
print "The angular velocity of the driving shaft is %.1f rad/s"%w
#maximum value of w1=w/cos(angle) and minimum value w2=w*cos(angle)
w1=w/math.cos(ang)
w2=w*math.cos(ang)
print "\nExtreme angular velocities :-"
print "maximum value of angular velocity w1=%.1f rad/s \nminimum value of angular velocity w2=%.1f rad/s"%(w1,w2)
#using equation 4.11, cos(2x)=(2*sin(angle)**2)/(2-sin(angle)**2)
x=math.acos((2*math.sin(ang)**2)/(2-math.sin(ang)**2))*180/(math.pi)
y=360-x#for cosine inverse, angle and 360-angle are same and must be considered
x1=x/2
y1=y/2
print "The acceleration of driven shaft is a maximum when theta =%.2f or %.2f degrees"%(x1,y1)
amax=(w**2*math.cos(ang)*(math.sin(ang)**2)*math.sin(x*math.pi/180))/((1-((math.cos(x1*math.pi/180)**2)*(math.sin(ang)**2)))**2)#maximum angular acceleration, numerically
print "Maximum angular acceleration is %.f rad/s^2"%amax

The angular velocity of the driving shaft is 104.7 rad/s

Extreme angular velocities :-
maximum value of angular velocity w1=111.4 rad/s
minimum value of angular velocity w2=98.4 rad/s
The acceleration of driven shaft is a maximum when theta =41.43 or 138.57 degrees
Maximum angular acceleration is 1370 rad/s^2