Souce for Simulation of beam in a Cyclotron

Yes that’s possible. You have to write and compile a source routine and I refer you to the manual , the training course slides or discussions on this forum if you have never done that.
Here the steps, assuming that the cyclotron orbit is in the x-y-plane:

  1. Sample an angle phi uniformly from [0, 2 pi]. I assume the angle counts in mathematically positive sense from the x-axis.

  2. If r is the radius of the cyclotron circumference, then your random starting position is
    (x,y) = (r cos phi , r sin phi)

  3. The tangential unit vector that you need for defining the particle direction in the source routine is
    (x’,y’) = (-sin phi, cos phi)

Happy programming, Thomas (@totto)