bscf.gpw: Beam Shape Coefficients for Rectangular Wave Guides.

Description Usage Arguments Details Value See Also Examples

Description

Beam Shape Coefficients for Rectangular Wave Guides.

Usage

1
bscf.gpw(M, X, kx, ky, kz, ux, uy, uz, x, y, z, lmax, TM = TRUE)

Arguments

kx

Component x of the wave vector (single value).

ky

Component y of the wave vector (single value).

kz

Component z of the wave vector (single value).

x

Component x of the origin of the expansion (vector).

y

Component y of the origin of the expansion (vector).

z

Component z of the origin of the expansion (vector).

TM

Type of the wave field.

Details

Calculates the Beam Shape Coefficients used to do the Partial Wave Expansion on Vector Spherical Wave Functions.

Value

The Beam Shape Coefficients G^{TE}_{lm} and G^{TM}_{lm}.

See Also

vwfd.rwg, vswf.pwe, vswf.gwg.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
lambda<-.5e-6           # Propagating wavelength
a<-7*lambda             # Size x of the waveguide
b<-5*lambda             # Size y of the waveguide
M<-6                    # x wavefield mode
N<-5                    # y wavefield mode
#-------------------------------------------------------------------------------
# Wave Field Parameters
#-------------------------------------------------------------------------------
k<-2*pi/lambda          # Propagating wavenumber
kx<-M*pi/a              # x component of the wavevector
ky<-N*pi/b              # y component of the wavevector
gama<-sqrt(kx^2+ky^2)   # gama component of the wavevector
kz<-sqrt(k^2-gama^2)    # z component of the wavevector
#-------------------------------------------------------------------------------
# Geometry of the calculations
#-------------------------------------------------------------------------------
NPX=200                  # Number of points in each direction (all equal)
NPY=200                  # Number of points in each direction (all equal)
#-------------------------------------------------------------------------------
# Vectors
#-------------------------------------------------------------------------------
dx<-a/(NPX-1)
dy<-b/(NPY-1)
x<-seq(0,a,dx)          # x vector of positions
y<-seq(0,b,dy)          # y vector of positions
z<-0
#-------------------------------------------------------------------------------
TM<-FALSE
lmax<- 40
#-------------------------------------------------------------------------------
# POSITION AT WHICH THE EXPANSION WILL BE PERFORMED  (REFERENCE SYSTEM)
#-------------------------------------------------------------------------------
# ARBITRARY
xo<-a/2
yo<-b/2
zo<-0
#-------------------------------------------------------------------------------
# CHANGE THE REFERENCE SYSTEM TO THE NEW POSITIONS
#-------------------------------------------------------------------------------
x<-x-xo
y<-y-yo
#-------------------------------------------------------------------------------
# ARBITRARY POINT FOR CALCULATIONS
#-------------------------------------------------------------------------------
x<-sample(x,1)
y<-sample(y,1)
#-------------------------------------------------------------------------------
# BSC CALCULATIONS
#-------------------------------------------------------------------------------
RWG<-vwfd.rwg(TE=!TM,kx,ky,kz,x+xo,y+yo,z+zo)
BSC<-vswf.rwg(kx,ky,kz,xo,yo,zo,lmax,TM)
PWE<-vswf.pwe(k,x,y,z,lmax,BSC$GTE,BSC$GTM)
#-------------------------------------------------------------------------------
# VALUES
#-------------------------------------------------------------------------------
cat("Distance x from origin in wavelength (from ",-a/(2*lambda),"to ",a/(2*lambda),"):",x/lambda,"\n")
cat("Distance y from origin in wavelength (from ",-b/(2*lambda),"to ",b/(2*lambda),"):",y/lambda,"\n")
df<-data.frame(
   PWE=c(PWE$Em,PWE$Ez,PWE$Ep,PWE$Hm,PWE$Hz,PWE$Hp),
   RWG=c(RWG$Em,RWG$Ez,RWG$Ep,RWG$Hm,RWG$Hz,RWG$Hp),
   row.names=c("Em","Ez","Ep","Hm","Hz","Hp")
   )
df$DIF<-df$PWE-df$RWG
print(df)

wendellopes/rvswf documentation built on May 4, 2019, 4:19 a.m.