Chapter 7: Waves and Oscillations

Example 7.1, Page 7.22

In [2]:
from math import pi, sin, sqrt

# Given 
E = 1.024e-3 # total energy of particle in J
T = 2 * pi # time period of S.H.M. in sec
x = 0.08 * sqrt(2) # distance of partile in meter
t = pi / 4 # time in second

#Calculations
A = x / sin((2 * pi * t) / T)
M = (E * T**2) / (2 * pi**2 * A**2)

#Result
print "Amplitude = %.2f meter\nMass of particle = %.f g"%(A,M/1e-3)
Amplitude = 0.16 meter
Mass of particle = 80 g

Example 7.2, Page 7.22

In [3]:
from math import pi

# Given 
A = 0.05 # amplitude in meter
T = 10 # time period of S.H.M. in sec

#Calculations
v = (A * 2 * pi) / T

#Result
print "Maximum amplitude of velocity = %.4f meter/sec"%v
Maximum amplitude of velocity = 0.0314 meter/sec

Example 7.3, Page 7.23

In [6]:
from math import pi, sqrt

# Given 
E = 9 # total energy of particle in J
U = 5 # potential energy in J
A = 1 # amplitude in meter
m = 2. # mass of harmonic oscillator in kg

#Calculations
kE = E - U# calculation for kinetic energy
k = (2 * kE) / A**2# calculation for force constant
T = (2 * pi) * sqrt(m / k)# calculation for time period

#Result
print "Force constant = %.f J/m\nTime period = %.2f sec"%(k,T)
Force constant = 8 J/m
Time period = 3.14 sec

Example 7.4, Page 7.23

In [7]:
from math import asin, sin, pi

# Given 
A = 0.06 # amplitude in meter
T = 6 # time period of S.H.M. in sec
x = 0.03 # position of particle in meter

#Calculations
delta = asin(1) # by the formula x=Asin(wt+delta) and (at t = 0,x=A) 
t = x / (A * sin(((2 * pi) / T) + delta))

#Result
print "Time taken by the particle = %.f sec"%t
Time taken by the particle = 1 sec

Example 7.5, Page 7.24

In [9]:
from math import pi

# Given 
A = 0.05# amplitude in meter
T = 10 * pi # time period of s.h.m. in sec

#Calculations
v = A * (2 * pi / T)
a = A * (2 * pi / T)**2

#Result
print "Maximum velocity = %.e meter/sec\nacceleration = %.e m/sec^2"%(v,a)
Maximum velocity = 1e-02 meter/sec
acceleration = 2e-03 m/sec^2

Example 7.6, Page 7.24

In [10]:
from math import pi

# Given 
A = 0.06# amplitude in meter
T = 10 * pi # time period of s.h.m. in sec

#Calculation
v = A * (2 * pi / T)

#Result
print "Maximum velocity = %.1e meter/sec"%v
Maximum velocity = 1.2e-02 meter/sec

Example 7.7, Page 7.24

In [11]:
from math import sqrt, pi

# Given 
k = 16 # stiffness constant of spring n/m
m = 1 # mass of particle in kg

#Calculations
n = sqrt(k / m) / (2 * pi)

#Result
print "natural frequency = %.2f Hz"%n
natural frequency = 0.64 Hz

Example 7.8, Page 7.25

In [12]:
from math import sqrt, pi

# Given 
l = 1 # length of pendulum in meter
m = 2 # mass of particle in kg
g = 9.8 # acceleration due to gravity in m/sec^2

#Calculation
T = 2 * pi * sqrt(l / g)

#Result
print "The time period of pendulum = %.f sec"%T
The time period of pendulum = 2 sec

Example 7.9, Page 7.25

In [13]:
from math import sqrt, pi

# Given 
m = 100. # mass of particle in gm

#Calculation
n = (1 / (2 * pi)) * sqrt(10 / m) # by using given formula 

#Result
print "Frequency  = %.2f Hz"%n
Frequency  = 0.05 Hz

Example 7.10, Page 7.25

In [14]:
from math import sqrt, pi

# Given 
f = 3 # acceleration of pendulum in m/sec^2
l = 1 # length of pendulum in meter
g = 9.8 # acceleration due to gravity in m/sec^2

#calculatiom
T = 2 * pi * sqrt(l / (g + f))

#Result
print "Time period of pendulum = %.2f sec"%T
Time period of pendulum = 1.76 sec

Example 7.11, Page 7.26

In [15]:
from math import sqrt, pi

# Given 
x = 0.3 # stretch in spring in meter
m1 = 6 # mass of first body in kg
m2 = 1 # mass of second body in kg
g = 9.8 #  gravitational acceleration of earth in m/sec^2

#Calculations
k = (m1 * g) / x
T = (2 * pi) * sqrt(m2 / k)

#Result
print "Time period of motion = %.2f sec "%T
Time period of motion = 0.45 sec 

Example 7.12, Page 7.26

In [16]:
from math import sqrt, pi

# Given 
x = 0.1 # compression in spring in m
F = 10 # restoring force in N
m = 4 # mass of body in kg
g = 9.8 # acceleration due to gravity in m/sec^2

#Calculations
k = F / x
F_ = m * g
x_ = F_ / k
T = (2 * pi) * sqrt(m / k)

#Result
print "Time period of motion = %.2f sec \nCompression of the spring due to the weight of the body = %.3f m "%(T,x_)
Time period of motion = 1.26 sec 
Compression of the spring due to the weight of the body = 0.392 m 

Example 7.13, Page 7.26

In [22]:
from math import exp

# Given 
t = 50. # relaxation time in sec
r = 1 / exp(1) # falls in amplitude and energy

#Calculations
s = 1 / (2 * t)
T = 1 / s # by using formula A=A_exp(-st) and using r=A/A_

#Result
print "Time = %.f sec"%T
Time = 100 sec

Example 7.14, Page 7.27

In [17]:
from math import pi, exp

# Given 
n = 260 # frequency in Hz
Q = 2000 # quality factor
r = 1 / (exp(1)**2) # decrease in amplitude 

#Calculations
tou = Q / (2 * pi * n)
t = 2 * tou # by using formula A=A_exp(-st) and using r=A/A_

#Result
print "Time = %.3f sec"%t
Time = 2.449 sec