Simulations of Coherent Synchrotron Radiation Effects in Electron Machines