# Harmonic Oscillator - Mass With Initial Velocity

1. Feb 22, 2012

### Eugbug

For a harmonic oscillator with mass M, spring of stiffness k and displacement the force equation is:

-kx = Md2x/dt2

How do you handle the situation and work out a solution for x(t) when the mass has an initial velocity. E.g. a mass dropped onto the spring?

2. Feb 22, 2012

### genericusrnme

It's a pretty simple second order differential equation with sins and coss as it's solutions, you then just solve for x'(0) = initial velocity

3. Feb 22, 2012

### Philip Wood

The first thing you do is to solve the DE in the general case, that is without specific initial conditions. You find
x = A cos $\omega$t + B sin $\omega$t

in which $\omega$ = $\frac{force per unit x}{mass}$

and A and B are arbitrary constants. It is these whose values accommodate the initial conditions. So, suppose you knew that at t = 0, x = 0 and $\frac{dx}{dt}$ = v$_{0}$.

Substituting x = 0, t = 0 into the general solution gives

x = B sin $\omega$t. [A = 0.]

So $\frac{dx}{dt}$ = B $\omega$ cos $\omega$t

Now imposing $\frac{dx}{dt}$ = v$_{0}$ when t = 0

v$_{0}$ = B $\omega$ so B =$\frac{v}{\omega}$

Putting in this value for B, we finally have

x = $\frac{v}{\omega}$ sin $\omega$t.

4. Feb 22, 2012