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.

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

Remark (Cumulative sums) Us<strong>in</strong>g the function FoldList is a very elegant and fast<br />

way to compute cumulative sums of a given list. FoldList[Plus,x,fa,b,cg] <strong>re</strong>turns<br />

fx,x+a,x+a+b,x+a+b+cg [140]. Normally, x will be set to zero. If the lead<strong>in</strong>g zero element<br />

of the <strong>re</strong>sult might disturb subsequent calculations, it can be omitted with Drop[list,1].<br />

The numerically found limit of this sequence is exact with<strong>in</strong> the mach<strong>in</strong>e p<strong>re</strong>cision of 16 digits.<br />

Now we <strong>in</strong>advertently skip every other zero <strong>in</strong> the calculation of the series and <strong>in</strong>tegrate<br />

over full <strong>in</strong>stead of half periods. Consequently the series no longer alternates, which has a<br />

catastrophic e ect on the determ<strong>in</strong>ation of the limit.<br />

In[3]:= sequ = Table[NIntegrate[S<strong>in</strong>[x]/x,fx,2 i Pi,2 (i+1) Pig],<br />

fi,0,100g];<br />

partial = FoldList[Plus,0,sequ];<br />

1.5675<br />

1.565<br />

1.5625<br />

1.56<br />

1.5575<br />

1.555<br />

1.5525<br />

z2 = ListPlot[partial,PlotStyle->fPo<strong>in</strong>tSize[0.012]g];<br />

20 40 60 80 100<br />

In[4]:= SequenceLimit[partial] - N[Pi/2]<br />

Out[4]= -0.00025589<br />

Remark (Improvement of the <strong>re</strong>sult) The <strong>re</strong>sult may neither be improved by <strong>in</strong>c<strong>re</strong>as<strong>in</strong>g<br />

the p<strong>re</strong>cision of the numerical computations nor by <strong>in</strong>clud<strong>in</strong>g a larger number of<br />

sequence members <strong>in</strong> the extrapolation.<br />

The example may be conside<strong>re</strong>d rather pathological, but we can con rm the di e<strong>re</strong>nces between<br />

half- and full-period <strong>in</strong>tervals also for other logarithmically converg<strong>in</strong>g <strong>in</strong>tegrals like<br />

134

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

Saved successfully!

Ooh no, something went wrong!