# Strange Behavior in Spring Computer Model

To learn more about oscillatory motion which I am learning about in my high school physics class, I have created a computer model of a damped spring where the damping force is proportional to velocity. The graph of position vs time appears as expected, a sine wave with amplitude decaying over the course of time.

I was interested in seeing the curve encompassing the peaks of the graph (the green line in this image). To do so, I created a new column in Excel which calculated the total energy of the system using the values of position and velocity the computer program outputted, then expressed that energy as a displacement from equilibrium using x = sqrt(2E/k).

When I graphed the results, I expected to see a smooth curve. However, I instead saw strange curves in between each peak: .

I am somewhat unsure about the origin of these. Should the "total energy" curve (the red one; although this isn't truly the energy) flatten out at each point at which the velocity equals zero in the real world? Or was my assumption that damping force is proportional to velocity a faulty one? If the latter is true, what would be a more accurate method of representing the damping force?

-

In your model, with damping proportional to velocity, there can be no damping - and therefore no loss of energy - when the particle is at rest. That is the origin of the oscillations you see. This is correct and it is an expected feature of the (very reasonable) model you're exploring.

The green curve you're expecting, i.e.

is not the total energy but rather the envelope of the position: if the displacement goes as $$x(t)=e^{-\gamma t}\cos(\omega t),$$ the green line is the function $e^{-\gamma t}$. As you have observed, this is not proportional to the decay in total energy, though it will approach it in the adiabatic limit $\gamma/\omega\ll1$, as you can see by calculating the analytic expression for the total energy.

-

I have found something that may explain why you got an envelope that was unexpected. I greatly enlarged the intercetion of the point where the curve iad envelope intersect. It is not at the peak (which would make it horziontal, like your 'wobbley' envelope) But the envelope 'mashes the sineusoid into distortion, shifting the true peak toward it's increasing velue. I am haveing great success in repaieing this, which I suspect may be linked to your 'wobbly' envelope. my repair method is to plot 'valid' sine's at 1/2 periods--you must choose your 1/2 periods in the proper place--where the envelope has least influsence per half wavelength. This seems to work great--If you are interested I will post it for you (I will finish this week). I will also post the graph of the difference of tour 'wobbly' envelope (please post your equation) to my ccorreccted smooth one, which I believe will be equivalent but not of the same mathematical form! Thanks, --dale

-
This isn't really an answer, it's a statement that you have a (probably non-physical) hack fix to OPs problem. –  Kyle Kanos Jun 22 at 12:59