A spring-mass system is subjected to a harmonic force whose frequency is close to the natural frequency of the system. If the forcing frequency is 39.8 [Hz] and the natural frequency is 40 [Hz], determine the period of beating.
The forcing frequency is 39.8 [Hz] which will be defined as: $$\omega = 2\pi39.8$$ The natural frequency is 40 [Hz] which will be defined as: $$ \omega_n = 2\pi40$$ The period of beating will be calcualted using formula: $$\tau_d = \frac{2\pi}{(\omega_n - \omega)}$$ $$ \tau_d = \frac{2\pi}{2\pi(40 - 39.8)} = 5 [\mathrm{s}]$$
To solve this example in Python first we will need to import the numpy library.
The forcing frequency is 39.8 [Hz] which will be defined as: $$\omega = 2\pi39.8$$ The natural frequency is 40 [Hz] which will be defined as: $$ \omega_n = 2\pi40$$ The period of beating will be calcualted using formula: $$\tau_d = \frac{2\pi}{(\omega_n - \omega)}$$ $$ \tau_d = \frac{2\pi}{2\pi(40 - 39.8)} = 5 [\mathrm{s}]$$
Solution in Python
To solve this example in Python first we will need to import the numpy library.
import numpy as npThis library is required for \(\pi\) number. The math library can also be used. The first step is to define the forcing frequency and the natural frequency.
omega = 39.8The period of beating can now be easily calculated:
omega_n = 40
tau_d = (2*np.pi)/(2*np.pi*(omega_n - omega))The output of the previous code is:
print("tau_d = {}".format(tau_d))
taud=4.9999If we want the result to be rounded we will use the Python built-in round function in taud formula.
tau_d = round((2*np.pi)/(2*np.pi*(omega_n - omega)),1)The output is given below.
print("tau_d = {}".format(tau_d))
tau_d = 5