User routine source_newgen.f

Dear FLUKA experts,
How do I best implement a spectrum like this in the source user routine: (dN/dE=N/E e^(-E/10MeV)
Thank you,

Dear Alejandra,

you can find a brief summary on how to sample from an arbitrary function on slides 22-24 from here:

Alternatively, you can pre-calculate the spectrum, and use the spectrum sampling function of the user routine.


1 Like