Monte Carlo Experimental Design: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 73: | Line 73: | ||
|Yes | |Yes | ||
|<math> | |<math> | ||
\hat{x} = \frac{ \log{x} - \log{1.5 \times 10^{-2}} }{ \log{1.5 \times 10^2} - \log{1.5 \times 10^{-2}} } | \hat{x} = \frac{ \log{x} - \log{\left(1.5 \times 10^{-2} \right)} }{ \log{\left(1.5 \times 10^2\right)} - \log{\left(1.5 \times 10^{-2} \right)} } | ||
</math> | </math> | ||
Revision as of 03:12, 26 June 2011
Overview
Monte Carlo sampling is essentially a brute-force technique in which random samples are taken until confidence that the entire space has been sampled is satisfactory.
Random numbers are used to create sampling points in each direction.
Think of Monte Carlo ray-tracing: you send out a whole bunch of rays, each in random directions, and from the result you determine the radiative flux. Mathematically, you're performing an integration by randomly sampling the function you want to integrate, then adding up all of the random samples:
$ \int f(x) dx \approx \frac{1}{N} \sum_{i} f( x_i ) $
Explanation
Transforming Variables
For a distribution that is a function of $ m $ variables $ x_1, \dots, x_m $:
Each variable has its own range, $ \alpha_i \leq x_i \leq \beta_i $
This range must be converted to $ [0,1] $
$ \hat{x}_i = \frac{ x_i - \alpha_i }{ \beta_i - \alpha_i } $
so that $ x_i \in \left[ 0, 1 \right] \forall i = 1 \dots m $
Selecting Samples
An $ m $-element vector of random numbers is generated to correspond with a single sample.
A number of sample points are selected, and the $ \hat{x}_i $ and corresponding $ x_i $ are stored
the function is evaluated at each input variable value $ x_i $
all random input vectors and corresponding output vectors are stored/saved
Example
For details about the problem, see Example Problem for Experimental Design
Input variables and their ranges are as follow:
| Input variable (I) | Uncertainty (U) | Log variable? | Transform |
|---|---|---|---|
| Sampling location $ x_i $ | $ \begin{array}{rcl} 0.5 \pm 0.02 & & m \\ 1.5 \pm 0.02 & & m \\ 2.5 \pm 0.02 & & m \end{array} $ | No | N/A |
| Mass flowrate $ \dot{m} = \dot{m}_1 = \dot{m}_2 $ | $ 1.5 \pm 0.5 $ kg/s | No | $ \hat{x} = \frac{ x - 1.0 }{ 2.0 - 1.0 } $ |
| Reaction rate $ k = k(T) $ | $ 1.5 \times 10^{0 \pm 2} $ | Yes | $ \hat{x} = \frac{ \log{x} - \log{\left(1.5 \times 10^{-2} \right)} }{ \log{\left(1.5 \times 10^2\right)} - \log{\left(1.5 \times 10^{-2} \right)} } $ |
| Mixing length $ L_{mix} $ | $ 0.3 - 3.0 $ | Yes | $ \hat{x} = \frac{ \log{x} - \log{0.3} }{ \log{3.0} - \log{0.3} } $ |