Wave Propagation in Linear Media | re-examined
Wave Propagation in Linear Media | re-examined
Wave Propagation in Linear Media | re-examined
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
8.3 Implementation of the quadratu<strong>re</strong> modules<br />
pg = P<strong>re</strong>cisionGoal/. foptsg/.Options[OscInt],<br />
mi = M<strong>in</strong>Recursion/. foptsg/.Options[OscInt],<br />
ma = MaxRecursion/. foptsg/.Options[OscInt]g,<br />
NIntegrate[f[xi],fxi,-1,1g,<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] const<br />
];<br />
The functions discussed so far a<strong>re</strong> <strong>in</strong>ternal only and not visible to the user | <strong>in</strong> contrast<br />
to the driver functions. These a<strong>re</strong> used to provide a consistent user <strong>in</strong>terface that is easy to<br />
control. For the transmitted part of the wave function <strong>in</strong> the tunnel, the module PhiTrans,<br />
for example, looks at the user speci ed values of the options Shape and PPo<strong>in</strong>ts or their<br />
default values, <strong>re</strong>spectively, to call the appropriate quadratu<strong>re</strong> module. Furthermo<strong>re</strong>, warn<strong>in</strong>g<br />
and error messages a<strong>re</strong> generated if an option has an unkown or <strong>in</strong>appropriate value. The<br />
argument n is a geometrical parameter that applies only to the Gaussian waveform. Thus<br />
we must provide an alternative way to call the module whe<strong>re</strong> n is not speci ed. This is the<br />
second rule given for the function name, which is applicable for <strong>re</strong>ctangular and triangular<br />
waves, but issues an error when called with Shape->Gauss. In the other cases, it calls the<br />
ma<strong>in</strong> function with n set to the dummy value one. The message bodies a<strong>re</strong> decla<strong>re</strong>d <strong>in</strong> the<br />
package header.<br />
PhiTrans[x_, t_, w_, k_, n_?Positive, opts___Rule] :=<br />
Module[fsh = Shape/. foptsg/.Options[Phi],<br />
pt = PPo<strong>in</strong>ts/.foptsg/.Options[Phi]g,<br />
Switch[sh,<br />
Rect,<br />
Switch[pt,<br />
Approximate, RectTransTemp[RectTransPos,<br />
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 />
Approximate, TriaTransTemp[TriaTransPos,<br />
TriaTransNeg,x,t,w,k,opts],<br />
Zeros, TriaTransExactTemp[TriaTransPos,<br />
TriaTransNeg,x,t,w,k,opts],<br />
_, Message[Phi::<strong>in</strong>validpart,pt]],<br />
Gauss,<br />
Switch[pt,<br />
Approximate, GaussTransTemp[GaussTransPos,<br />
GaussTransNeg,x,t,w,k,n,opts],<br />
Truncate, GaussTransTruncTemp[GaussTransPos,<br />
203