The function implements a harmonic oscillator with a period slightly less than 2