Simulation of the dynamic structure factor for two-dimensional classical Heisenberg ferromagnets