Euler–Maruyama for a noisy harmonic oscillator
Numerical methods Stochastic dynamics
How to add noise to an oscillator with the Euler–Maruyama scheme, why the noise term scales with the square root of the time step, and a check against an exact result for the mean energy.