# Editing Numbers with a Gaussian distribution

**Warning:** You are not logged in. Your IP address will be publicly visible if you make any edits. If you **log in** or **create an account**, your edits will be attributed to your username, along with other benefits.

The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision | Your text | ||

Line 1: | Line 1: | ||

{{Source}} | {{Source}} | ||

− | [[ | + | [[Random number]] generators usually provide numbers with a uniform (flat) |

− | distribution. | + | distribution. Sometimes it is desirable to generate numbers with some |

− | other distributions. | + | other distributions. The Gaussian (normal) distribution is of paramount imporance. |

==Fortran 90 implementation== | ==Fortran 90 implementation== | ||

− | This Fortran 90 | + | This Fortran 90 implementation is adapted from Ref. 1, based on an algorithm from the Numerical Recipes collection, Ref. 2. The function '''ran()''' calls a [[Random_numbers | randon number generator]]: |

<small><pre> | <small><pre> | ||

! Returns random numbers distributed following a Gaussian with | ! Returns random numbers distributed following a Gaussian with | ||

Line 35: | Line 35: | ||

==References== | ==References== | ||

# Daan Frenkel and Berend Smit "Understanding Molecular Simulation: From Algorithms to Applications" p. 411 Academic Press (1996) | # Daan Frenkel and Berend Smit "Understanding Molecular Simulation: From Algorithms to Applications" p. 411 Academic Press (1996) | ||

− | # [http://www.nr.com Numerical Recipes | + | # [http://www.nr.com Numerical Recipes] |

[[category: random numbers]] | [[category: random numbers]] | ||

[[category: computer simulation techniques]] | [[category: computer simulation techniques]] |