Question: [ Q 7 Virtual Experiment ] Fun the right values in the code below so you can confirm eq . 8 Eq 8 : (

[Q7Virtual Experiment]
Fun the right values in the code below so you can confirm eq.8
Eq 8: (\omega squared)=\omega subscript 0 superscript 2-(\gamma squared /4)
CODE:
import numpy as np
import matplotlib.pyplot as plt
def forced_oscillation(t, amplitude, frequency, damping_factor, force_amplitude, force_frequency):
natural_frequency = np.sqrt(1- damping_factor**2)
response = amplitude * np.sin(2* np.pi * frequency * t - np.arctan(damping_factor / natural_frequency))
force = force_amplitude * np.sin(2* np.pi * force_frequency * t)
return response + force
# Parameters
amplitude =1.0
frequency =1.0 # Natural frequency in Hertz
damping_factor =0.1
force_amplitude =0.5
force_frequency =1.5
# Time values
t = np.linspace(0,10,1000)
# Calculate forced oscillation
oscillation = forced_oscillation(t, amplitude, frequency, damping_factor, force_amplitude, force_frequency)
# Plot the results
plt.plot(t, oscillation, label='Forced Oscillation')
plt.plot(t, force_amplitude * np.sin(2* np.pi * force_frequency * t), linestyle='--', label='Applied Force')
plt.xlabel('Time')
plt.ylabel('Amplitude')
plt.title('Forced Oscillation Example')
plt.legend()
plt.grid(True)
plt.show()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!