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.

PhiArg[a, b, c,d],1,opts] +<br />

OscInt[RectTransNeg[a,-b,-c,d,w,k],<br />

PhiArg[a,-b,-c,d],1,opts])<br />

) RectConst[w,k]<br />

];<br />

GaussTransTemp[fpos_, fneg_, x_, t_, w_, k_, n_, opts___Rule] :=<br />

Module[{a,b,c,d,o1,o2,<br />

wp = Work<strong>in</strong>gP<strong>re</strong>cision/.{opts}/.Options[OscInt]},<br />

a = -t;<br />

b = N[Pi k/Sqrt[w],wp+2];<br />

c = x;<br />

d = N[-Pi k,wp+2];<br />

o1 = QuadOffset[a, b+c,d];<br />

o2 = QuadOffset[a,-b-c,d];<br />

(OscInt[fpos[a, b, c,d,w,k,n],<br />

QuadZero[a, b +c,d,o1],1,FunctionType->ZeroList,opts] +<br />

OscInt[fneg[a,-b,-c,d,w,k,n],<br />

QuadZero[a,-b -c,d,o2],1,FunctionType->ZeroList,opts]<br />

) GaussConst[w,k,n]<br />

];<br />

GaussTransTruncTemp[fpos_, fneg_, x_, t_, w_, k_, n_, opts___Rule] :=<br />

Module[{wp = Work<strong>in</strong>gP<strong>re</strong>cision/.{opts}/.Options[OscInt],<br />

ag = AccuracyGoal/. {opts}/.Options[OscInt],<br />

pg = P<strong>re</strong>cisionGoal/. {opts}/.Options[OscInt],<br />

mi = M<strong>in</strong>Recursion/. {opts}/.Options[OscInt],<br />

ma = MaxRecursion/. {opts}/.Options[OscInt],<br />

limpos, limneg},<br />

{limneg,limpos} = GaussTruncLims[w,k,n,wp];<br />

(If[limpos DoubleExponential,<br />

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

AccuracyGoal->ag,<br />

P<strong>re</strong>cisionGoal->pg,<br />

M<strong>in</strong>Recursion->mi,<br />

MaxRecursion->ma]] +<br />

If[limneg >= -1, 0,<br />

NIntegrate[fneg[-t,-Pi k/Sqrt[w],-x,-Pi k,w,k,n][xi],<br />

{xi,1,-limneg},<br />

Method->DoubleExponential,<br />

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

AccuracyGoal->ag,<br />

P<strong>re</strong>cisionGoal->pg,<br />

M<strong>in</strong>Recursion->mi,<br />

MaxRecursion->ma]]<br />

) GaussConst[w,k,n]<br />

];<br />

GaussEvanTruncTemp[f_, w_, k_, n_, opts___Rule] :=<br />

Module[{limpos,limneg,<br />

wp = Work<strong>in</strong>gP<strong>re</strong>cision/.{opts}/.Options[OscInt],<br />

ag = AccuracyGoal/. {opts}/.Options[OscInt],<br />

pg = P<strong>re</strong>cisionGoal/. {opts}/.Options[OscInt],<br />

mi = M<strong>in</strong>Recursion/. {opts}/.Options[OscInt],<br />

ma = MaxRecursion/. {opts}/.Options[OscInt]},<br />

{limneg,limpos} = GaussTruncLims[w,k,n,wp];<br />

limneg = Max[limneg,-1];<br />

limpos = M<strong>in</strong>[limpos,1];<br />

NIntegrate[f[xi],{xi,limneg,limpos},<br />

Method->DoubleExponential,<br />

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

AccuracyGoal->ag,<br />

P<strong>re</strong>cisionGoal->pg,<br />

M<strong>in</strong>Recursion->mi,<br />

MaxRecursion->ma] GaussConst[w,k,n]<br />

];<br />

(*-- Driver functions for the computation of the wave <strong>in</strong>tegrals --*)<br />

PhiTrans[x_, t_, w_, k_, n_?Positive, opts___Rule] :=<br />

Module[{sh = Shape/. {opts}/.Options[Phi],<br />

pt = PPo<strong>in</strong>ts/.{opts}/.Options[Phi]},<br />

Switch[sh,<br />

Rect,<br />

Switch[pt,<br />

Approximate, RectTransTemp[RectTransPos,RectTransNeg,x,t,w,k,opts],<br />

Zeros, RectTransExact[x,t,w,k,opts],<br />

_, Message[Phi::<strong>in</strong>validpart,pt]],<br />

Tria,<br />

Switch[pt,<br />

226<br />

A Mathematica packages

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

Saved successfully!

Ooh no, something went wrong!