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.

7.3 Implementation of OscInt and <strong>re</strong>lated functions<br />

],<br />

koffs = N[Floor[zerof[offs]/Pi],2 wp];<br />

Re[Table[x/.F<strong>in</strong>dRoot[zerof[x] == (-k+koffs-cfoffs) Pi,<br />

fx,offs,offs+1g],<br />

fk,i<strong>re</strong>l,i<strong>re</strong>l+n-1g]]<br />

Remark (F<strong>in</strong>d<strong>in</strong>g the limit) The test for a de nite limit of (x) was implemented<br />

di<strong>re</strong>ctly with the built-<strong>in</strong> function Limit. This works well enough for any k<strong>in</strong>d of polynomial<br />

and rational functions, but usually gives problems with trancendental functions,<br />

which, however, a<strong>re</strong> not supposed to be part of (x) anyhow. The outcome of Limit is<br />

then converted to a mach<strong>in</strong>e number and exam<strong>in</strong>ed whether it is a number or not to lter<br />

out the value Inf<strong>in</strong>ity.<br />

Whether (x) is <strong>in</strong>c<strong>re</strong>as<strong>in</strong>g or dec<strong>re</strong>as<strong>in</strong>g can be identi ed with the sign of 0 (x) for x>o.<br />

Accord<strong>in</strong>gly, the table of subdivision po<strong>in</strong>ts is computed with F<strong>in</strong>dRoot, which is aga<strong>in</strong><br />

straightforward because the <strong>re</strong>spective equations have only one solution above the start<strong>in</strong>g<br />

po<strong>in</strong>ts o and o +1. Although these solutions must be <strong>re</strong>al-valued, the<strong>re</strong> a<strong>re</strong> often spurious<br />

imag<strong>in</strong>ary parts left, which a<strong>re</strong> elim<strong>in</strong>ated by tak<strong>in</strong>g only the <strong>re</strong>al part of the <strong>re</strong>sult<strong>in</strong>g<br />

table.<br />

7.3.5 PartInt<br />

This function actually computes the <strong>in</strong>tegral R 1<br />

f(x) dx based on a set of n subdivision po<strong>in</strong>ts<br />

a<br />

fx0;x1;::: ;xn,1g; xi a by means of extrapolation. Its syntax is<br />

PartInt[f, zerotab, a, opts],<br />

whe<strong>re</strong> f is the <strong>in</strong>tegrand function (de ned either as pu<strong>re</strong> function or like f[x]), zerotab<br />

is the list of partition po<strong>in</strong>ts, and a is the lower <strong>in</strong>tegration limit. The essential part of the<br />

function body is listed below without most of the option assignments. The rst statement isa<br />

test that should always fail under normal conditions, because the functions that generate the<br />

subdivision po<strong>in</strong>ts al<strong>re</strong>ady make su<strong>re</strong> that the rst po<strong>in</strong>t x0 a. If this condition, however, is<br />

not satis ed, then all members g<strong>re</strong>ater than a a<strong>re</strong> lte<strong>re</strong>d out for further use, and a warn<strong>in</strong>g<br />

message is issued to <strong>in</strong>form the user that only fewer sequence members than <strong>in</strong>tended will be<br />

computed.<br />

Remark (Select<strong>in</strong>g members of lists) The lter<strong>in</strong>g of the partition po<strong>in</strong>ts is accomplished<br />

with the function Select[list, crit], which tests each element of a list with a<br />

given criterion and picks out those for which the test yields True.<br />

The value of the <strong>in</strong>tegral consists of two parts. The rst is the de nite <strong>in</strong>tegral R x0<br />

f(x) dx<br />

a<br />

(if, of course, x0 6= a) that is computed with the double exponential rule accord<strong>in</strong>g to the<br />

<strong>re</strong>sults of chapter 6.3. The second contribution is the extrapolation <strong>re</strong>sult that is obta<strong>in</strong>ed<br />

<strong>in</strong> the well-known manner by comput<strong>in</strong>g a sequence of partial <strong>in</strong>tegrals R xi+1<br />

f(x) dx and<br />

xi<br />

nd<strong>in</strong>g the numerical limit of this series. If the rst partition po<strong>in</strong>t equals Inf<strong>in</strong>ity, then<br />

this extrapolation is skipped. This featu<strong>re</strong> is imperative <strong>in</strong> order to <strong>in</strong>clude all special cases<br />

of parameter-dependent <strong>in</strong>tegrands that lose their <strong>in</strong> nite oscillations under certa<strong>in</strong> circumstances.<br />

171

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

Saved successfully!

Ooh no, something went wrong!