Define the following variables and constants
x = position of the block
v = x' = velocity of the block
m = mass of the block
R = rest length of the spring
k = spring stiffness
b = damping constant (friction)
A spring generates a force proportional to how far it is stretched (and acting in the opposite direction to the stretch) Fspring = −k × stretch If we adjust the coordinate system so that x = 0 corresponds to the spring being unstretched, then the stretch of the spring is simply equal to x. The spring force becomes Fspring = − k x In addition, there is a damping (friction) force that resists the motion. It is proportional to the velocity. So we add Fdamping = −b v to get the total force F = Fspring + Fdamping = − k x − b v Combining this with Newton's law of motion F = m a, and the definition of acceleration as the second derivative of position a = x'' we have the differential equation: m x'' = −k x − b v