Download Separation Analysis with OpenModelica

Transcript
6.4 Monte Carlo and random numbers
51
Figure 6.1. This figure illustrates an example of estimating the area of a circle with use
of a Monte Carlo method.
3. Randomly cover the surface of the square with dots, see Figure 6.1
4. Count all the dots, then count the ones inside the circle, the area of the circle
is then estimated as
Acircle (estimated)
=
Asquare ×
dotsinside
dotsall
(6.1)
By increasing the number of dots, the accuracy of the estimation will increase.
When
using Monte Carlo methods the accuracy of the estimation increases as
√
number of experiments.
6.4
Monte Carlo and random numbers
Monte Carlo simulation methods do not generally require truly random numbers
to be useful. Many of the most useful techniques use pseudo-random sequences,
described later on in this section, which makes it easy to test and re-run simulations. The only quality usually necessary to make good simulations is that
the pseudo-random sequence appear randomly enough. What this means depends
on the application, but typically the sequence should pass some statistical tests.
Testing that the numbers are uniformly distributed, normal distributed or follow
another desired distribution is the simplest and most common ones.
6.4.1
Pseudo-random numbers
A pseudo-random number is a number that appears random but is not truley random. Pseudo-random sequences typically have statistical randomness while being
generated by an entirely deterministic causal process. Such a process is easier to
produce than a genuine random one and it can be used again and again to produce exactly the same numbers. This is useful when testing software. There is