# Souce for Simulation of beam in a Cyclotron

Dear FLUKA - experts,

for an activation simulation of a cyclotron I want to include a source inside of it which simulates uniform particle loss around the circumference of said cyclotron.

Is this possible without adding a magnetic field in the simulation?

Lukas

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)

On top of @totto reply, I would like to add the link to the lecture on the source routine from the last Fluka course. There, the new source_newgen.f routine is presented. It makes it easier for the user to prepare their own source. You will find several examples of its use in this forum.

Thank you very much for your replies!