Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The restoring force in a simple mass-spring system is F = −kx. Find the equations for Potential and Kinetic energy. Plot them on the same axes for arbitrarily chosen values of k, m, and A, and for t = 0 to T (where T is the period of the spring) and plot their sum. Comment.

U=12kx2K=12kx˙2\begin{aligned} U &= \frac{1}{2}kx^2 \\ K &= \frac{1}{2}k\dot{x}^2 \end{aligned}

And a reminder, for a spring mass system:

x=Acos(ω0t)x˙=Aω0sin(ω0t)\begin{aligned} x &= A\cos{(\omega_0t)} \\ \dot{x} &= -A\omega_0\sin{(\omega_0t)} \end{aligned}
import matplotlib.pyplot as plt              # for ease of use
import numpy as np                           # for the needed math functions

plt.rcParams['figure.figsize'] = 12.5,10     # default plot size