| jupyter |
|
|---|
import numpy as np
import matplotlib.pyplot as pltplt.rcParams['figure.dpi'] = 100Here, we will plot the frequency of a harmonic oscillator as a function of the spring constant.
From our equations, we know that:
Let's plot it!
k = np.linspace(0,10,100)
m = 1
omega = np.sqrt(k/m)
plt.plot(k,omega)
plt.xlabel("Spring constant (N/m)")
plt.ylabel("Angular frequency $\omega$ (rad/s)")