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: ω=2π39.8
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: ω=2π39.8
The natural frequency is 40 [Hz] which will be defined as:
ωn=2π40
The period of beating will be calcualted using formula:
τd=2π(ωn−ω)
τd=2π2π(40−39.8)=5[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 π 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
Nema komentara:
Objavi komentar