Maple code for a mass-spring system
m: mass, r: damping constant, k: spring constant, x1,x2: positions of the spring x0 = x(0), xp0 =D(x)(0): initial conditions, f: driving force, n: number of frames.