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 7<br />

Mathematica implementation of a<br />

quadratu<strong>re</strong> function<br />

Les mathematiciens n'etudient pas des objets, mais des <strong>re</strong>lations ent<strong>re</strong> les<br />

objets; il leur est donc <strong>in</strong>di e<strong>re</strong>nt de <strong>re</strong>mplacer ces objets par d'aut<strong>re</strong>s,<br />

pourvu que les <strong>re</strong>lations ne changent pas. La matie<strong>re</strong> ne leur importe pas,<br />

la forme seule les <strong>in</strong>te<strong>re</strong>sse. Henry Po<strong>in</strong>ca<strong>re</strong>, quoted <strong>in</strong> [1]<br />

Based on the nd<strong>in</strong>gs of the p<strong>re</strong>vious sections, this chapter describes how an automatic<br />

quadratu<strong>re</strong> rout<strong>in</strong>e for an extrapolation strategy can be implemented <strong>in</strong> Mathematica. We<br />

beg<strong>in</strong> the discussion from a user's po<strong>in</strong>t of view with the options that control the operation of<br />

the function. The <strong>in</strong>ternal structu<strong>re</strong> of the function is another topic of <strong>in</strong>te<strong>re</strong>st, and nally we<br />

shall po<strong>in</strong>t out some implementation details. The enti<strong>re</strong> source code of the package is listed<br />

<strong>in</strong> the appendix. In the last section of the chapter we shall apply the function to examples<br />

known from the literatu<strong>re</strong> to verify the cor<strong>re</strong>ct operation.<br />

7.1 User <strong>in</strong>terface of the function OscInt<br />

The top level function of the package has the same name as the whole package, OscInt. Its<br />

basic syntax is<br />

OscInt[f<strong>in</strong>t, fzero, a, opts],<br />

and its purpose is to nd the numerical value of the <strong>in</strong>tegral<br />

I =<br />

Z 1<br />

a<br />

(x) u( (x)) dx ; (7.1)<br />

whe<strong>re</strong> u( ) is e j , e ,j or any l<strong>in</strong>ear comb<strong>in</strong>ation of both, <strong>in</strong> particular s<strong>in</strong>( ) and cos( ). The<br />

<strong>in</strong>dividual <strong>in</strong>put parameters of OscInt have the follow<strong>in</strong>g mean<strong>in</strong>gs:<br />

161

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

Saved successfully!

Ooh no, something went wrong!