10.02.2013 Views

longitudinal dispersion in nonuniform isotropic porous media

longitudinal dispersion in nonuniform isotropic porous media

longitudinal dispersion in nonuniform isotropic porous media

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

173<br />

times this number. It is possible to <strong>in</strong>crease the sequence length<br />

dramatically at the expense of us<strong>in</strong>g two l<strong>in</strong>ear congruential sequences<br />

simultaneously, which approximately doubles the computation time spent<br />

on generat<strong>in</strong>g random numbers. If the two generators have sequence<br />

lengths which are prime relative to each other (no common factors), the<br />

sequence length of the comb<strong>in</strong>ed generators can be made to produce a<br />

sequence length equal to the product of the two orig<strong>in</strong>al sequence<br />

lengths. The algorithm shown below was first proposed by MacLaren and<br />

Marsaglia, and is discussed <strong>in</strong> Knuth (1969).<br />

Algorithm:<br />

IN+l = AlIN + Bl<br />

I N+1<br />

A2 I N + B2<br />

Generate 100 values from, say, the J sequence and store <strong>in</strong><br />

(A.2)<br />

(A.3)<br />

an array called L(k). Use the I sequence to generate a random<br />

<strong>in</strong>teger value of k, i.e.,<br />

where I 1S the maximum <strong>in</strong>teger that can be represented<br />

max<br />

on the computer. The real random number, R, is<br />

R = L(k)/J max<br />

where J max would typically be equal to Imax.<br />

Use the J sequence to replace the value used, i.e.,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!