[fluka-discuss]: Re: Question about user routine for gauss distribution

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Tue, 9 Feb 2021 21:36:29 +0000

Hi,

See answers below
________________________________

>>I have two quesitons to consult you:

>>1) what is the value range of the gaussian-distributed random numbers: FLNRRN(RGAUSS)

Technically the range is "+/-infinite' although the probability to get |numbers| above 10 is very small, which you can compute from the usual gauss function tables. Please see the attached figure for 10000 tests.
(You might be interested to check the Box-Muller transform, to obtain gaussian distributed numbers from uniform distributions)


>2) If ó=1cm and I try to plot fluence of electron beam spot with gauss distribution from 2 ó to 3 ó, how to write X, Y position in source file. I try to write the >following commands, but it doesn't work correctly;
>I expect that an annular circle of gauss distribution should be plotted from 2 ó to 3 ó, but the following commands show me a circle. I have no idea how to do.

>sigma=1
>XFLK(NPFLKA) = sigma*FLNRRN(RGAUSS)
>YFLK(NPFLKA) = sigma*FLNRRN(RGAUSS)
>ZFLK(NPFLKA) = ZBEAM

First off, you should write 'sigma=1.0D+00', or 'sigma=ONEONE'.
If your beam has a circular gaussian profile, I would go somewhere like:
radius = sigma*FLNRRN(RGAUSS)
angle = TWOPIP * FLRNDM()
XFLK(NPFLKA) = radius * sin(angle)
YFLK(NPFLKA) = radius * cos(angle)
...

-M

Thank you very much.





__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

gaussian.png
(image/png attachment: gaussian.png)

Received on Wed Feb 10 2021 - 00:35:58 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 10 2021 - 00:36:04 CET