0% found this document useful (0 votes)
12 views

EXPT 1 Python

The document outlines an experiment aimed at performing kinematic analysis of Hooke's joint mechanism using Python programming. It includes a program that calculates and plots the velocity of the output shaft in relation to the input shaft across various angles. The conclusion emphasizes that the analysis was successfully conducted using both programming and analytical methods.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

EXPT 1 Python

The document outlines an experiment aimed at performing kinematic analysis of Hooke's joint mechanism using Python programming. It includes a program that calculates and plots the velocity of the output shaft in relation to the input shaft across various angles. The conclusion emphasizes that the analysis was successfully conducted using both programming and analytical methods.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment No.

Aim: To do computer programming (using software/programming languages like C, Python,


Scilab, Matlab etc.) for Kinematic Analysis of Hooke‟s joint Mechanism using Analytical Method

Objective: by using python language we study and analyze the for Kinematics analysis of
mechanism example
https://mybinder.org/v2/gh/ipython/ipython-in-
depth/7e5ce96cc9251083979efdfc393425f1229a4a68

#Program : KINEMATIC ANALYSIS OF HOOKE'S JOINT


print("SAVITRIBAI PHULE PUNE UNIVERSITY")
print("\n SUBJECT: KINEMATICS OF MACHINERY")
print("\n KINEMATIC ANALYSIS OF HOOKE'S JOINT")
import math #import Math Library
import matplotlib.pyplot as plt #import Library to plot Polar Diagram
print("\n ----------------------------------------------STUDENT DETAILS --------------------------------")
n1=(input("ENTER YOUR NAME::"))
r1=int(input("ENTER YOUR ROLL NUMBER::"))
print("\n INPUT PARAMETERS ")
w1=float(input("Velocity of input shaft (RPM)::"))
alpha=float(input("shaft angle IN DEGREE::"))
alpha= math.radians(alpha) # Convert angle into radian
ang=[] # Empty Cell to store angle values
velocity=[] # Empty Cell to store velocity
Values
print("\n POLAR DIGRAM ")
for i in range(0,361): # plot the velocity of output shaft for angle ranging 0 to 360 with
1 degree inteval
ang.append(i) # Value of i will be stored in Empty ang=[] cell
ang_r = math.radians(i) # value of theta
w2 = (w1 * math.cos(alpha)) / (1 - ((math.cos(ang_r)) ** 2) * ((math.sin(alpha)) ** 2)) #
formula of velocity ratio for hooks joint
w2=round(w2,4) # Round of velocity value upto precision points.
velocity.append(w2) # Value of velocity will be stored in empty Ang_velocity=[] cell
plt.axes(projection='polar') # draw polar plot
for i in range(0,361): # plot the velocity of output shaft for angle ranging 0 to 360 with 1
degree inteval
plt.polar(math.radians(ang[i]), w1, 'r.') # plot polar diagram of input shaft
plt.polar(math.radians(ang[i]), velocity[i], 'g.') # plot polar diagram of output shaft
plt.title("POLAR DIAGRAM") # Title of Diagram
plt.legend(labels=('Input speed', 'Output speed'), loc=1) # Add legend
plt.show() # plot diagram
print("\n ")
print("MAXIMUM VELOCITY: ",velocity[0]) # print Maximum velocity
print("MINIMUM VELOCITY: ",velocity[90]) # print Minimum velocity
for h in range(0,361,60): # print vslus of output speed at an interval of 60 degree
print("for angle ",ang[h],"= ","Angular velocity of output shaft", velocity[h]," RPM")

Program runs Python Software:


Conclusion:
The computer programming of Hooke‟s joint Mechanism is carried out using Python
Language. The Kinematic Analysis obtained by both programming and Analytical Method

You might also like