import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
t=0.3 #s #Time
r=0.8 #m #Amplitude
T=1.6 #s #Period of oscillations
#Calculations
#frequency
f=2*pi*T**-1 #rad/s
#Velocity
v=round(f,3)*r*sin(round(f,3)*t) #m/s
#Accleration
a=f**2*r*cos(f*t) #m/s**2
#Value for acceleration in textbook is incorrect
#Result
print"Velocity is",round(v,2),"m/s"
print"Acceleration is",round(a,2),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
r=1 #m #Amplitude
T=2 #s #Period of oscillations
#Calculations
#Time taken by body from mid pos
t=T*5**-1 #s
#Time taken by body from extreme position to mid position
t2=T*4**-1 #s
#time taken by body fom extreme position
t3=t2-t #s
#Angular velocity
f=2*pi*T**-1 #rad/s
#Velocity
v=-f*r*sin(f*t3) #m/s
#Value of velocity in book is incorrect in textbook i.e 0.09831
#Acceleration
a=-f**2*r*cos(pi*t3) #m/s**2
#Result
print"Velocity is",round(v,2),"m/s"
print"Acceleration is",round(a,2),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
t=0.4 #s #Time
r=1 #m #Amplitude
T=2 #s #Period of oscillations
#Calculations
#frequency
f=2*pi*T**-1 #rad/s
#Velocity
v=round(f,3)*r*sin(round(f,3)*t) #m/s
#Accleration
a=f**2*r*cos(f*t) #m/s**2
#Value for acceleration in textbook is incorrect
#Result
print"Velocity is",round(v,2),"m/s"
print"Acceleration is",round(a,2),"m/s**2"
import math
#Declaration Of Variables
N=100 #r.p.m #Speed of crank
#Calculations
#Angular velocity
f=2*pi*N*60**-1 #rad/s
#Stroke of piston
n=1.8 #cm
#Ampiltude
r=n*2**-1 #m
#Displacement of piston from centre
x=0.6 #m
#Let f*t=y
#Displacement
y=arccos(x*r**-1)*(180*pi**-1)
#Velocity of piston
v=-f*r*sin(y*180**-1*pi)
#Acceleration of piston
a=-f**2*r*cos(y*180**-1*pi) #m/s**2
#Result
print"Velocity is",round(v,2),"m/s"
print"Acceleration is",round(a,2),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
#Velocities of Body
v1=8 #m/s
v2=3 #m/s
#Distance of Body
x1=1.5 #m #When v1=8 #m/s
x2=2.5 #m #When v2=3 #m/s
#Calculations
#For 1st velocity
#v1=-f*((r**2-x1**2))**2
#After Substituting values and further simplifying we get
#8=-f*((r**2-1.5**2))**2 ..........................................1
#For 2nd velocity
#v2=-f*((r**2-x2**2))**2
#After Substituting values and further simplifying we get
#3=-f*((r**2-2.5**2))**2 ..........................................2
#Dividing equations 1 and 2 and further simplifying we get
#Amplitude
r=(42.19*6.111**-1)**0.5 #m
#Sub value of r in equation 2 we get
f=v2*(((r**2-x2**2))**0.5)**-1 #rad/s
#Period
T=2*pi*f**-1 #s
#Result
print"Amplitude of Body is",round(r,2),"m"
print"Period of Body is",round(T,2),"s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
#Velocities of Body
v1=12 #m/s
v2=3 #m/s
#Distance of Body
x1=0.05 #m #When v1=8 #m/s
x2=0.1 #m #When v2=3 #m/s
x=0.075 #m
#Calculations
#For 1st velocity
#v1=-f*((r**2-x1**2))**2
#After Substituting values and further simplifying we get
#12=-f*((r**2-0.05**2))**2 ..........................................1
#For 2nd velocity
#v2=-f*((r**2-x2**2))**2
#After Substituting values and further simplifying we get
#3=-f*((r**2-0.1**2))**2 ..........................................2
#Dividing equations 1 and 2 and further simplifying we get
#Amplitude
r=(0.1575*15**-1)**0.5 #m
#Sub value of r in equation 2 we get
f=v2*(((r**2-x2**2))**0.5)**-1 #rad/s
#Frequency
n=f*(2*pi)**-1 #cycles/s
#Acceleration
a=f**2*x
#Result
print"Frequency of motion is",round(f,2),"rad/s"
print"Amplitude of motion is",round(r,4),"m"
print"Acceleration when the displacement is 75 mm is",round(a,2),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
r=4.5 #m #amplitude
T=3.5 #s #Period
x1=3.5 #m #Distance of 1st point from centre
x2=1.5 #m #Distsnce of 2nd point from centre
#Calculations
#Angular velocity
f=2*pi*T**-1 #rad/s
#For 1st point
#x1=r*cos(f*t1)
#After substituting and further simplifying
t1=0.6796*1.795**-1
#For second point
#x2=r*cos(f*t2)
#After substituting and further simplifying
t2=1.231*1.795**-1
#Time required by body in passing between two points
t=t2-t1 #s
#Result
print"Time required by body in passing between two points is",round(t,2),"s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
#Velocities of Body
v1=6 #m/s
v2=3 #m/s
#Distance of Body
x1=0.125 #m #When v1=6 #m/s
x2=0.200 #m #When v2=3 #m/s
W=0.2 #kg #Weight of cross head
g=9.81 #Acceleration due to gravity
#Calculations
#For 1st velocity
#v1=-f*((r**2-x1**2))**2
#After Substituting values and further simplifying we get
#6=-f*((r**2-0.125**2))**2 ..........................................1
#For 2nd velocity
#v2=-f*((r**2-x2**2))**2
#After Substituting values and further simplifying we get
#3=-f*((r**2-0.200**2))**2 ..........................................2
#Dividing equations 1 and 2 and further simplifying we get
#Amplitude
r=(0.1444*3**-1)**0.5 #m
#Sub value of r in equation 2 we get
f=v2*(((round(r,4)**2-x2**2))**0.5)**-1 #rad/s
#Period
T=2*pi*f**-1 #s
#Max Velocity
V_max=f*r #m/s
#mass of cross head
m=W*g**-1 #N
#Max acceleration
a_max=round(f,2)**2*round(r,4) #m/s**2
#Max Force
F_max=m*a_max
#Result
print"Amplitude of vibration is",round(r,2),"m"
print"Max Velocity is",round(V_max,2),"m/s"
print"period of Vibration is",round(T,2),"s"
print"MAx Force in direction of motion",round(F_max,2),"Kg*f"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
#Distance of Body
x1=0.07 #m #When v1=0.6*V_max #m/s
x2=0.05 #m #When v2 #m/s
T=7.5 #s #Time to perform oscillation
#Calculations
#Equation of velocity
#v=-f*((r**2-x**2)**0.5) ..................1
#Velocity
#v=0.6*V_max ........2
#x=x1 ................3
#Frequency
f=2*pi*T**-1 #rad/s
#MAx Velocity
#V_max=-f*r ............4
#Sub all values in equation 1 and further simplifying we get
r=(0.0049*0.64**-1)**0.5
#Velocity
v=f*((r**2-x2**2)**0.5)
#Max Acceleration
a_max=f**2*r
#Result
print"Amplitude of motion is",round(r,4),"m"
print"Velocity of particle is",round(v,2),"m/s"
print"MAx Acceleration is",round(a_max,4),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
W=50 #N #Weight attached
n=4 #No. of oscillation
T=0.25 #s #Period of oscillation
#Calculations
#Static Extension
P=(T*(2*pi)**-1)**2*9.81*100 #cm
#Stiffness of spring
k=W*round(P,2)**-1 #N/cm
#Result
print"Stiffness of spring is",round(k,2),"N/cm"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
C=150 #N/m #Stiffness
T=1.5 #s #PEriod time
#Calculations
#Static Extension
P=(T*(2*pi)**-1)**2*9.81
#Weight Attached
W=C*P #N
#Result
print"Weight attached to spring",round(W,2),"N"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
#Frequency
n1=12 #cycles/s #when Weight W1=W
n2=10 #cycles/s #when Weight W2=(W+20)
g=9.81 #m/s**2 #Acceleration due to gravity
#Calculations
#frequency equation
#f=1*(2*pi)**-1*((k*g)*W**-1)**0.5
#For First case f=12
#12=1*(2*pi)**-1*((k*g)*W**-1)**0.5 ...............1
#For Second case f=10
#10=1*(2*pi)**-1*((k*g)*W**-1)**0.5 .............2
#Dividing equation 1 by 2 we get
#12*10**-1=((W+20)*W**-1)**0.5
#Squaring above equation and further simplifying we get
W=2000*44**-1
#Sub value of W in equation 1 we get
k=(n1*2*pi)**2*W*g**-1*10**-3 #KN/m
#Result
print"Weight of spring is",round(W,2),"N"
print"Stiffness of the spring is",round(k,2),"KN/m"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
M=50 #kg #Mass of block
g=9.81 #Acceleration due to gravity
C1=4000 #N/m #Stiffness of 1st spring
C2=6000 #N/m #Stiffness of 2nd spring
r=0.04 #m #MAx amplitude
#Calculations
#Static Extension of 1st spring
x1=M*g*C1**-1 #m
#Static Extension of 2nd spring
x2=M*g*C2**-1 #m
#Total Extension
x=x1+x2 #m
#Period of vibration
T=2*pi*(x*g**-1)**0.5 #s
#Angular velocity
f=2*pi*T**-1 #rad/s
#MAx velocity
V_max=f*r #m/s
#Max Acceleration
A_max=f**2*r #m/s**2
#2nd case
#Let
#W1=Weight supported by first spring
#W2=Weight suppoerted by second spring
#W=W1+W2 #Total Weight ......................1
#Extension of first spring
#X1=W1*C1**-1 ...........................2
#Extension of second spring
#X2=W2*C2**-1 .........................3
#As Extension of 1st spring is equal to 2nd spring
#W1*C1**-1=W2*C2**-1
#sub value in equation 1 and further simplifying we get
W2=50*g*3*5**-1 #N
#Static extension of block
X3=W2*C2**-1 #m
#Period of vibration
T2=2*pi*(X3*g**-1)**0.5 #s
#Angular velocity
f2=2*pi*T2**-1 #rad/s
#MAx velocity
V_max2=f2*r #m/s
#Acceleration
A_max2=f2**2*r #m/s**2
#result
print"Period of vibrations",round(T,4),"s"
print"MAx velocity",round(V_max,2),"m/s"
print"Max Acceleration" ,round(A_max,2),"m/s**2"
#When Block is suppoetred with spring
print"Period of vibrations",round(T2,2),"s"
print"MAx velocity",round(V_max2,2),"m/s"
print"Max Acceleration" ,round(A_max2,2),"m/s**2"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
x=0.3 #mm #Extension of spring
W1=20 #N #Weight
W2=700 #N #Weight supported
e=1.05 #cm #Static Extension
r=0.90 #cm #Amplitude
g=980 #m/s**2 #Acceleration due to gravity
x3=0.4 #cm #Displacement of weight from equilibrium position
#Calculations
#Stiffness of spring
C=W1*x**-1 #N/mm
#Extension of spring
x2=W2*C**-1 #cm
#Period of vibration
T=2*pi*((e*g**-1)**0.5) #s
#Frequency
n=1*T**-1 #vib/s
#Angular velocioty
f=(g*e**-1)**0.5 #rad/s
#Velocity
v=-f*((r**2-x3**2)**0.5)
#Result
print"Frequency of vibration is",round(n,2),"vib/s"
print"Period of vibration is",round(T,2),"s"
print"Velocity of weight is",round(v,2),"m/s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
W_o=24 #tf #Weight of empty wagon
W1=32 #tf #Weight of goods
W=W_o+W1 #Total Weight
e1=8 #cm #Total Compression of spring
g=981 #Acceleration due to gravity
r=10 #cm #Amplitude
x=4 #cm #displacement
#Calculations
#Stiffness of spring
c=W*e1**-1 #tf/cm
#Compression of spring due to weight of wagon
e_o=W_o*c**-1 #cm
#When Wagon is empty
T_o=2*pi*((e_o*g**-1)**0.5)
#When Wagon is Loaded
T1=2*pi*((e1*g**-1)**0.5)
#Angular velocity
f=2*pi*T_o**-1 #rad/s
#Velocity
v=f*((r**2-x**2)**0.5)*10**-2
#Result
print"Natural period of Vibrations is:When wagon is empty",round(T_o,2),"s"
print" :When wagon is loaded",round(T1,2),"s"
print"Velocity when displacement is",round(v,2),"m/s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
T=2 #s #time
g2=981 #Acceleration due to gravity
g=980 #Acceleration due to gravity
#Calculations
#Length of seconds pendulum with g=980
L1=(T*(2*pi)**-1)**2*g
#Length of seconds pendulum with g=981
L2=(T*(2*pi)**-1)**2*g2
#Result
print"Length of seconds pendulum with g=980 is",round(L1,2),"cm"
print"Length of seconds pendulum with g=981 is",round(L2,3),"cm"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
l=0.6 #m #Length of string
W=80 #g
g=9.81
#Calculations
#Time
T=2*pi*((l*g**-1)**0.5) #s
#Result
print"Time period of pendulum is",round(T,2),"s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
l=99.93 #cm #LEngth of pendulum
dn=-5 #s #Number of beats clock loses
n=39.155
#Calculations
#Number of seconds in days
dl=-dn*2*l*n**-1
#Result
print"Length of pendulum for correct time is",round(dl,5),"cm"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
T=2 #s #Time
g=981 #cm/s**2
#Calculations
#Length of pendulum
L=(T*(2*pi)**-1)**2*g #cm
#Part-2
#Decrease in gravity
dg=g-981 #cm/s**2
#Number of beats in day
n=24*60*60
# number of beats clock will lose
dn=n*(2*g)**-1 #s
#Result
print"Length of Pendulum",round(L,2),"cm"
print"Number of beats clock will lose is",round(dn,2),"s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
d=100 #mm #Diameter of shaft
L=1000 #mm #Length of shaft
W=5000 #N #Weight attached
C=8.16*10**4 #N/mm**2 #Modulus of rigidity
g=9.81 #m/s**2
E=2*10**5 #N/mm**2 #Modulus of Elasticity
k=250 #mm #Radius of gyration
#Calculations
#Stress
F=W*(pi*4**-1*d**2)**-1 #N/mm**2
#static deflection
dell=F*L*E**-1*10**-3 #m
#Frequency of longitudinal vibrations
f=1*(2*pi)**-1*((g*dell**-1))**0.5
#Part-2
#Torsional stiffness
q=C*pi*32**-1*d**4*L**-1
#M.I
I=W*(g*1000)**-1*k**2
#Frequency of torsional vibrations
f2=1*(2*pi)**-1*((q*I**-1))**0.5
#Result
print"Frequencies for free longitudinal vibrations is",round(f,2),"m"
print"Frequencies for free torsional vibrations is",round(f2,2),"cycles/s"
import math
from math import sin, cos, radians, pi
import numpy as np
#Declaration Of Variables
d=5 #mm #Diameter of shaft
L=1000 #mm #Length of shaft
W=20 #N #Weight of rotor
D=200 #mm #Diameter of rotor
C=0.85*10**5 #N/mm**2 #Modulus of rigidity
g=9.81*1000 #mm/s**2
#Calculations
#Radius of rotor
R=D*2**-1 #mm
#Polar Modulus
J=pi*32**-1*d**4 #mm**4
#Torsional Stiffness
q=C*J*L**-1 #N*mm
#M.I
I=W*g**-1*R**2*2**-1 #N*mm-s**2
#Frequency of torsional vibrations
f=1*(2*pi)**-1*((q*I**-1))**0.5
#Result
print"Torsional Vibrations of the system is",round(f,2),"cycles/s"