Processing math: 100%

HEV-Example 2 - Determine the period of beating for spring-mass system

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
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π(4039.8)=5[s]

Solution in Python

To solve this example in Python first we will need to import the numpy library.
import numpy as np
This 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.8
omega_n = 40
The period of beating can now be easily calculated:
tau_d = (2*np.pi)/(2*np.pi*(omega_n - omega))
print("tau_d = {}".format(tau_d))
The output of the previous code is:
taud=4.9999 
If 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)
print("tau_d = {}".format(tau_d))
The output is given below.
tau_d = 5

Nema komentara:

Objavi komentar