13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

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.

27.4 NUMERICAL INTEGRATIONy = f(x)y = cx = ax = bxFigure 27.5 A simple rectangular figure enclosing the area (shown shaded)which is equal to ∫ bf(x) dx.a<strong>and</strong> the x-axis in the range a ≤ x ≤ b. It may not be possible to do thisanalytically, but if, as shown in figure 27.5, we can enclose the curve in a simplefigure whose area can be found trivially then the ratio of the required (shaded)area to that of the bounding figure, c(b − a), is the same as the probability that ar<strong>and</strong>omly selected point inside the boundary will lie below the line.In order to accommodate cases in which f(x) can be negative in part of thex-range, we treat a slightly more general case. Suppose that, <strong>for</strong> a ≤ x ≤ b, f(x)is bounded <strong>and</strong> known to lie in the range A ≤ f(x) ≤ B; then the trans<strong>for</strong>mationz = x − ab − awill reduce the integral ∫ baf(x) dx to the <strong>for</strong>mA(b − a)+(B − A)(b − a)∫ 10h(z) dz, (27.52)whereh(z) = 1 [f ((b − a)z + a) − A] .B − AIn this <strong>for</strong>m z lies in the range 0 ≤ z ≤ 1<strong>and</strong>h(z) lies in the range 0 ≤ h(z) ≤ 1,i.e. both are suitable <strong>for</strong> simulation using the st<strong>and</strong>ard r<strong>and</strong>om-number generator.It should be noted that, <strong>for</strong> an efficient estimation, the bounds A <strong>and</strong> B shouldbe drawn as tightly as possible –preferably, but not necessarily, they should beequal to the minimum <strong>and</strong> maximum values of f in the range. The reason <strong>for</strong>this is that r<strong>and</strong>om numbers corresponding to values which f(x) cannot reachadd nothing to the estimation but do increase its variance.It only remains to estimate the final integral on the RHS of equation (27.52).This we do by selecting pairs of r<strong>and</strong>om numbers, ξ 1 <strong>and</strong> ξ 2 , <strong>and</strong> testing whether1015

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

Saved successfully!

Ooh no, something went wrong!