Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

import 

math
import matplotlib.pyplot as plt
print("SAVITRIBAI PHULE PUNE UNIVERSITY")
print("\n SUBJECT: KINEMATICS OF MACHINERY")
print("\n KINEMATIC ANALYSIS OF SLIDER CRANK MECHANISM")
print("\n ----------------------------------------------STUDENT DETAILS------------------------------------------------------------")
n1=(input("ENTER YOUR NAME::"))
r1=int(input("ENTER YOUR ROLL NUMBER::"))
print("\n ----------------------------------------------INPUT PARAMETER------------------------------------------------------------")
r=float(input("Enter crank radius::"))
n=float(input("Enter Obliquity ratio::"))
w=float(input("Angular Velocity(Rad/Sec)::"))
print("\n ----------------------------------------------VELOCITY AND ACCELERATION PLOT------------------------------------------------")
ang=[] #Value of angles store in this list
disp=[] #Value of displacement store in this list
vel=[] #Value of Velocity store in this list
acc=[] #Value of Acceleration store in this list
for i in range(0,360): #change value of angle(i) from 0 to 360
 ang.append(i) #Store value of i in "ang" List
 a = math.radians(i) #Angele Concersion
 d1 = r * ((1- math.cos(a) ) + (math.sin(a))* (math.sin(a)) / (2 * n))
 displacement = round(d1, 4)
 v1 = w * r * (math.sin(a) + (math.sin(2 * a)) / (2 * n))
 velocity = round(v1, 4)
 a1 = (w ** 2) * r * (math.cos(a) + ((math.cos(2 * a)) / n))
 acclr = round(a1, 4) #round value of acceleration upto 4 Digit
 disp.append(displacement) #Store value of displacement in "disp"List
 vel.append(velocity) #Store value of velocity in "vel" List
 acc.append(acclr) #Store value of acceleration in "acc" List
fig, axs = plt.subplots(3) #Mention 3 graph
#Displacement Graph
axs[0].plot(ang, disp)
axs[0].set_title('Displacement')
#Velocity Graph
print("----------")
axs[1].plot(ang, vel)
axs[1].set_title('Velocity')
#Acceleration Graph
axs[2].plot(ang, acc)
axs[2].set_title('Acceleration')
plt.show()
print("\n ----------------------------------------------RESULT--------- ---------------------------------------------")
 
SAVITRIBAI PHULE PUNE UNIVERSITY

SUBJECT: KINEMATICS OF MACHINERY

KINEMATIC ANALYSIS OF SLIDER CRANK MECHANISM

----------------------------------------------STUDENT DETAILS-------------------------------------------------------
ENTER YOUR NAME::Ishan Somvanshi
ENTER YOUR ROLL NUMBER::64

----------------------------------------------INPUT PARAMETER-------------------------------------------------------
Enter crank radius::100
Enter Obliquity ratio::4
Angular Velocity(Rad/Sec)::157.08

----------------------------------------------VELOCITY AND ACCELERATION PLOT----------------------------------------


----------

----------------------------------------------RESULT--------- ---------------------------------------------
check 1m 35s completed at 11:42 PM

You might also like