A spring - mass system is a mechanical oscillator. If no damping is included and the system is excited at resonance frequency infinite amplitudes will result. The resonant frequency is given by omega_res = sqrt(c / m) with:
c ... spring stiffness m ... mass
To make sure that the system is initially at rest the initial conditions s(start=-0.5) and v(start=0) for the sliding masses are set. If damping is added the amplitudes are bounded.