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.

8.4 Test of the package<br />

0.4<br />

0.2<br />

-0.2<br />

-0.4<br />

5 10 15 20<br />

As for the di e<strong>re</strong>nt implementations of the evaluation of the <strong>in</strong>de nite <strong>in</strong>tegrals, we compa<strong>re</strong><br />

the <strong>re</strong>sults they yield as well as their comput<strong>in</strong>g time. Not surpris<strong>in</strong>gly, we nd that it takes<br />

longer to use the zeros as partition po<strong>in</strong>ts and that for Gaussian waves the truncation of the<br />

<strong>in</strong>tegrals is much faster.<br />

Example 8.4.7<br />

In[7]:= x = 1;<br />

t = 4;<br />

w = 0.1;<br />

k = 2;<br />

Tim<strong>in</strong>g[N[Phi[x,t,w,k,Shape->Tria]]]<br />

Out[7]= f21.696 Second, 0.0717104 - 0.0469158 Ig<br />

In[8]:= Tim<strong>in</strong>g[N[Phi[x,t,w,k,Shape->Tria,PPo<strong>in</strong>ts->Zeros]]]<br />

Out[8]= f29.056 Second, 0.0717104 - 0.0469158 Ig<br />

In[9]:= Tim<strong>in</strong>g[N[Phi[x,t,w,k,Shape->Rect]]]<br />

Out[9]= f18.785 Second, 0.0188638 - 0.264976 Ig<br />

In[10]:= Tim<strong>in</strong>g[N[Phi[x,t,w,k,Shape->Rect,PPo<strong>in</strong>ts->Zeros]]]<br />

Out[10]= f22.903 Second, 0.0188638 - 0.264976 Ig<br />

In[11]:= n = 6;<br />

Tim<strong>in</strong>g[N[Phi[x,t,w,k,n,Shape->Gauss]]]<br />

209

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

Saved successfully!

Ooh no, something went wrong!