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.5 Test of the quadratu<strong>re</strong> rout<strong>in</strong>e<br />

Out[27]= -15<br />

-8.471 10<br />

The next test functions we<strong>re</strong> taken from Sidi [128].<br />

Example 7.5.10<br />

Z 1<br />

0<br />

s<strong>in</strong> x<br />

x<br />

s<strong>in</strong>h x<br />

10<br />

s<strong>in</strong>h 2x dx = arctan tan<br />

10<br />

1<br />

4<br />

tanh 10<br />

4<br />

In[28]:= f[x_] := S<strong>in</strong>[x]/x S<strong>in</strong>h[1/10 x]/S<strong>in</strong>h[2/10 x];<br />

OscInt[f,#&,0] - N[ArcTan[Tan[1/4 Pi] Tanh[10 Pi/4]]]<br />

Out[28]= -13<br />

-2.72449 10<br />

Inc<strong>re</strong>as<strong>in</strong>g both Work<strong>in</strong>gP<strong>re</strong>cision and NSumExtraTerms,we obta<strong>in</strong> a <strong>re</strong>sult with mo<strong>re</strong> cor<strong>re</strong>ct digits.<br />

Although Sidi gives the exact value of the <strong>in</strong>tegral as 0.785398012695720765, the last two digits di er<br />

<strong>in</strong> the <strong>re</strong>sult found by Mathematica as well as <strong>in</strong> the numerical evaluation of the analytical solution.<br />

In[29]:= OscInt[f,#&,0,Work<strong>in</strong>gP<strong>re</strong>cision->34,NSumExtraTerms->30]<br />

Out[29]= 0.78539801269572077061037<br />

In[30]:= N[ArcTan[Tan[1/4 Pi] Tanh[10 Pi/4]],20]<br />

Out[30]= 0.78539801269572077061<br />

Example 7.5.11<br />

Z 1<br />

In[31]:= f[x_] := S<strong>in</strong>[Pi/2 x^2];<br />

OscInt[f,Pi/2 #^2&,0] - 0.5<br />

Out[31]= -14<br />

-2.08167 10<br />

0<br />

s<strong>in</strong> x2<br />

2<br />

185<br />

dx = 1<br />

2

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

Saved successfully!

Ooh no, something went wrong!