Abstract
The rfsimulator code was developed for the study of the Spallation Neutron Source (SNS) dual-harmonic ring RF control. It uses time-domain solvers to compute beam-cavity interactions and FFT methods to simulate the time responses of the linear RF system. The important elements of the system considered in the model include beam loading, dynamic cavity detuning, circuit bandwidth, loop delay, proportional-integral controller for feedback and adaptive feed forward, stochastic noise, width-in-turn loop parameter change, beam current fluctuation, and bunch leakage. As the beam power increases, beam loss in the ring goes up and thus precise control of the bunching RF phase and amplitude is required to limit beam loss. The code will help in the development of a functional RF control and in achieving the goal of minimizing beam loss in the accumulator ring.