# A Classical Simple Harmonic Oscillator

Posted by doug
summary:
A spring with no losses due to friction will oscillate forever.
description:
The motion happens to occur along one axis only. The animation has the look we expect of springs, stretching out when going fastest, compressing at the endpoints. Just what everyone expects to see. Try to predict what the velocity animation looks like (my guess was wrong).
command:
q_graph -out sho-x -dir sho -box 10 -command 't_function -mqs 2 -mqs 1 -t_function polynomial -t_function one -x_function cos -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero 1 2 1 2 1 3 0 0 0 1 0 0 -shift "-11 5 0 0" -pi 8 -n_steps 1600' -color yellow
equation:

$(t, x, y, z) = (t, cos (2 t + 3), 0, 0)$

numbers: