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. 

> mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...
mass_spring := proc (m, r, k, x1, x2, x0, xp0, tk, f, n) local mass, deq, init, sol, xk, xu, plt1, plt2, plt, pltxk, rect, base, spring, spring1, rod, sylinder, piston, fluid, dashpot; with(plots); wi...