0

I am trying to build a simple program where an object undergoes simple harmonic motion, where a force is initially applied, than undergoes SHM until coming to a stop. My problem is that my program runs forever without the object ever stops,(as if there is no external force acting on the object to slow it down)

How could I add a force to slow it down to its initial equilibrium point?

Here is what I have so far: given a mass, initial force applied, spring constant-K I calculate

amplitude = mass*gravity + Force(applied) / K omega = sqrt(K/mass) initPos = mass*gravity / K

to find postion at time t = initalPosition + amplitude*cos(omega*t)

but this system will never end, it keeps oscillating for ever. How can I add a force to stop the oscillation over a period of time??

sorry for the long post!

thank you

JLL
  • 979
  • Have you studied differential equations? You can include the various forces involved, including damping, in a differential equation, and find solutions either numerically or analytically. – J W Feb 15 '14 at 22:20
  • I have a good knowledge of differential equations, but I dont see how you could apply one to this sort of problem. Do you know any simple examples to illustrate? – JLL Feb 15 '14 at 22:27
  • 1
    See http://en.wikipedia.org/wiki/Damping, for instance. – J W Feb 15 '14 at 22:32

1 Answers1

1

You can multiply by a damping factor, so $x(t)=x(0)+Acos(\omega t)\exp(-bt)$ where you choose $b$ to make it damp as fast as you want.

Ross Millikan
  • 374,822
  • It probably doesn't need mentioning, but $b$ should be greater than $0$ for damping. If $b = 0$, you'll have no damping, and if $b < 0$, the oscillations will grow in amplitude without bound. – J W Feb 15 '14 at 22:26