Simulation of the electron-cyclotron maser instability