# Differential Equation for a Horizontal Spring with Friction

I stumped with this math/physics question and I would appreciate if help can be given. Consider a horizontal spring attached to a block of mass m. Let the spring constant be k. On the surface of the spring there is friction whose coefficient is u. The spring is pulled a distance A from its equilibrium point. I derived a differential equation for this following system:

$$F = ma$$ $$-kx + umg = m \frac{d^2 x}{dt^2}$$ $$\frac{d^2 x}{dt^2} + \frac{k}{m}x = ug, x(0) =A, x'(0)= 0$$

Since there is friction in the system, I would expect the spring to come to a halt after a certain time. However, the solution to this differential equation is

$$x(t) = (A- \frac{umg}{k})cos \sqrt{\frac{k}{m}} t +\frac{umg}{k}$$

The graph of this function, however, is purely sinusoidal and it does not tend to 0 as time approaches infinity. Is there something wrong with my differential equation? Thank you!

• g is the acceleration due to gravity. umg is the magnitude of the force of friction. Commented Aug 4, 2019 at 6:41
• Sorry, the force in my answer was bad; I missed out the dot and possibly a negative sign (it's up to the sign of $u$). Sorry! Commented Aug 4, 2019 at 12:26

The problem is that your frictional force is not correct: The direction of the friction is opposite to the direction of the motion, i.e. $$F_{fr}=-\operatorname{sgn}(\dot{x})umg$$ (When $$x=0$$ is the equilibrium)
Your $$F_0=umg$$ force is just a constant force, it's like if you were to put it in constant gravitational field (that's why it only effects the equilibrium).
• Hi, I am not sure I understand your formula for the frictional force. Why do you include the sign of the position? I would have thought that the sign of the velocity is better fitting, using $-sgn(\dot{x}) umg$, since the force is opposite the velocity, and the sign of the velocity gives the direction of motion.
• @EhWha You are absolutely right, my words and equation does not match, because I missed out the dot. The sign might be negative as well if $u$ is positive; I will fix that too. Thank you! Commented Aug 4, 2019 at 12:25