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

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

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

7.3.3 PartitionOffs<br />

7 Mathematica implementation of a quadratu<strong>re</strong> function<br />

The aim of the function PartitionOffs is to nd an <strong>in</strong>dex o set for the subsequent computation<br />

of the partition po<strong>in</strong>ts such that we can assume that the po<strong>in</strong>t with <strong>in</strong>dex zero is the<br />

smallest possible one | ir<strong>re</strong>spective of the lower <strong>in</strong>tegration limit or any particular shape of<br />

the argument function (x). The function call is<br />

PartitionOffs[zerof, a, opts],<br />

with zerof as function de n<strong>in</strong>g either the argument (x) oranenumerat<strong>in</strong>g function for the<br />

partition po<strong>in</strong>ts x (n). The parameter a is not necessarily the lower <strong>in</strong>tegration limit but<br />

can also be any arbitrarily chosen abscissa po<strong>in</strong>t meant asalower bound for the sequence of<br />

partition po<strong>in</strong>ts. The options a<strong>re</strong> the same as for OscInt.<br />

How the function is evaluated chie y depends on the option FunctionType that speci es how<br />

zerof is to be <strong>in</strong>terp<strong>re</strong>ted. We shall rst discuss the case whe<strong>re</strong> FunctionType->ZeroList,<br />

which means that zerof di<strong>re</strong>ctly <strong>re</strong>turns the subdivision po<strong>in</strong>ts x (n); n 0. This function<br />

has to be de ned follow<strong>in</strong>g one important rule: the rst po<strong>in</strong>t it <strong>re</strong>turns must be larger than<br />

the position of any ext<strong>re</strong>mum of (x) or its derivatives, so both (x) and its derivatives<br />

must be monotonic for x x (0). Then we must simply nd the smallest <strong>in</strong>dex o 0<br />

whe<strong>re</strong> x (o) a. This operation is performed by the follow<strong>in</strong>g statement, whe<strong>re</strong> the equation<br />

x (na) =ais solved numerically and the <strong>re</strong>sult is set to o = dnae. For this purpose, zerof[n]<br />

must be able to accept <strong>in</strong>put parameters of type <strong>re</strong>al although the value it <strong>re</strong>turns makes sense<br />

only for <strong>in</strong>teger <strong>in</strong>put values. The option MaxIterations is set to the value of the OscInt<br />

option MaxRecursion, AccuracyGoal <strong>in</strong> this particular case equals to PartitionAccuracy.<br />

If[N[zerof[0]] < N[a],<br />

Ceil<strong>in</strong>g[x/.F<strong>in</strong>dRoot[zerof[x] == a,fx,0,1g,<br />

Work<strong>in</strong>gP<strong>re</strong>cision->wp,<br />

AccuracyGoal->pa,<br />

MaxIterations->ma]],<br />

0]<br />

Remark (Implementation) To determ<strong>in</strong>e whether x (0)

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

Saved successfully!

Ooh no, something went wrong!