Numerical solution to the forced Duffing oscillator