basic harmonic oscillator code