27.12.2012 Views

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

Towards a quadratu<strong>re</strong> rout<strong>in</strong>e<br />

6Towards a quadratu<strong>re</strong> rout<strong>in</strong>e<br />

\Can you do Addition?" the White Queen asked. \What's one and one<br />

and one and one and one and one and one and one and one and one?"<br />

\I don't know," said Alice. \I lost count."<br />

\She can't do Addition," the Red Queen <strong>in</strong>terrupted. \Can you do Subtraction?<br />

Take n<strong>in</strong>e from eight."<br />

\N<strong>in</strong>e from eight I can't, you know," Alice <strong>re</strong>plied very <strong>re</strong>adily: \but| "<br />

\She can't do Subtraction," said the White Queen.<br />

Lewis Carroll, Through the look<strong>in</strong>g glass<br />

With the discourag<strong>in</strong>g <strong>re</strong>sult of the search for an o -the-shelf program to solve our problems,<br />

the<strong>re</strong> is noth<strong>in</strong>g left but to write a dedicated quadratu<strong>re</strong> rout<strong>in</strong>e that suits our needs. This<br />

is, however, not at all a straightforward task, and we have to avoid ca<strong>re</strong>fully a number of<br />

pitfalls associated with the <strong>in</strong> nitely oscillat<strong>in</strong>g <strong>in</strong>tegrals we wish to compute. This chapter is<br />

thus devoted to some practical considerations that emerge <strong>in</strong> the course of the development<br />

of such a quadratu<strong>re</strong> rout<strong>in</strong>e. While it seems obvious that a comb<strong>in</strong>ation of partition<strong>in</strong>g and<br />

extrapolation is best suited to this purpose, the<strong>re</strong> a<strong>re</strong> some detailed questions yet to solve.<br />

The most <strong>in</strong>te<strong>re</strong>st<strong>in</strong>g one is certa<strong>in</strong>ly the choice of the partition itself, and we shall the<strong>re</strong>fo<strong>re</strong><br />

discuss which po<strong>in</strong>ts a<strong>re</strong> most suitable for this subdivision procedu<strong>re</strong> | the zeros, ext<strong>re</strong>ma,<br />

or any other po<strong>in</strong>ts of the <strong>in</strong>tegrand. A rather implementation-speci c question is how the<br />

partial <strong>in</strong>tegrals a<strong>re</strong> to be computed e ciently. We shall also <strong>in</strong>vestigate a strategy how to<br />

control the accuracy of the computation.<br />

Throughout the subsequent sections, we shall p<strong>re</strong>sent many examples programmed <strong>in</strong> Mathematica<br />

to illustrate the various di culties that need to be conside<strong>re</strong>d. To understand these<br />

pieces of code, a certa<strong>in</strong> familiarity with Mathematica or any other functional programm<strong>in</strong>g<br />

language is favourable, but not imperative. S<strong>in</strong>ce most of the used functions a<strong>re</strong> selfexpla<strong>in</strong><strong>in</strong>g,<br />

we shall give further explanations only whe<strong>re</strong> they a<strong>re</strong> deemed necessary.<br />

132

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

Saved successfully!

Ooh no, something went wrong!