Interactive simulation of mechanical oscillation