vswf.cwg: Beam Shape Coefficients for Cylindrical Wave Guides.

Description Usage Arguments Details Value See Also Examples

Description

Beam Shape Coefficients for Cylindrical Wave Guides.

Usage

1
vswf.cwg(gama, kz, x, y, z, lmax, M, TM = TRUE, s = 1, code = "C")

Arguments

gama

Transversal component 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.

s

Chirality of the wave guide (S=\pm 1).

m

Order of the wave guide.

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.cwg, 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#-------------------------------------------------------------------------------
# Zeros of Bessel Functions
#-------------------------------------------------------------------------------
#Nth zero (lines) of the Mth Bessel functions (column)
ZJ <-matrix(c( 2.4048, 3.8317, 5.1356, 6.3802, 7.5883, 8.7715,
               5.5201, 7.0156, 8.4172, 9.7610,11.0647,12.3386,
               8.6537,10.1735,11.6198,13.0152,14.3725,15.7002,
               11.7915,13.3237,14.7960,16.2235,17.6160,18.9801,
               14.9309,16.4706,17.9598,19.4094,20.8269,22.2178),
            ncol=6,byrow=TRUE)
#-------------------------------------------------------------------------------
# Zeros of derivatives of Bessel Functions
#-------------------------------------------------------------------------------
#Nth zero (lines) of the derivative of Mth Bessel functions (column)
ZdJ<-matrix(c( 3.8317, 1.8412, 3.0542, 4.2012, 5.3175, 6.4156,
               7.0156, 5.3314, 6.7061, 8.0152, 9.2824,10.5199,
               10.1735, 8.5363, 9.9695,11.3459,12.6819,13.9872,
               13.3237,11.7060,13.1704,14.5858,15.9641,17.3128,
               16.4706,14.8636,16.3475,17.7887,19.1960,20.5755),
            ncol=6,byrow=TRUE)
#-------------------------------------------------------------------------------
# Wave Guide Parameters
#-------------------------------------------------------------------------------
# Basic Parameters
lambda=.5e-6            # Propagating wavelength
k=2*pi/lambda           # Propagating wavenumber
S=-1                    # Chirality of the beam
M<-5  # 0<=M<=5         # Order of the (derivative of the) Bessel function
N<-4  # 1<=N<=5         # Order of the zero of the derivative/Bessel function
TM<-TRUE                # Mode: TM (Bessel function), TE (derivative)
R<-5*lambda             # Radius of the waveguide
#-------------------------------------------------------------------------------
# MODES: M <- M+1 because J_0(x) ocupies column 1
# TE - ZdJ (derivative)
# TM - ZJ  (Bessel function)
#-------------------------------------------------------------------------------
if(TM){
   g<-ZJ[N,M+1]/R
   MODE<--1
   MODE.PWE<-4
}else{
   g<-ZdJ[N,M+1]/R
   MODE<-1
   MODE.PWE<-3
}
kz<-sqrt(k^2-g^2)
#-------------------------------------------------------------------------------
# Geometry of the calculations
#-------------------------------------------------------------------------------
NPX<-4*50+1
NPY<-4*60+1
NPZ<-4*20+1
dx<-2*R/(NPX-1)
dy<-2*R/(NPY-1)
dz<-2*R/(NPZ-1)
x<-seq(-R,R,by=dx)
y<-seq(-R,R,by=dy)
z<-seq(-R,R,by=dz)
#-------------------------------------------------------------------------------
lmax<- 40  # Number of partial waves to sum (for some l we have 2l+1 values of m)
#-------------------------------------------------------------------------------
# POSITION AT WHICH THE EXPANSION WILL BE PERFORMED  (REFERENCE SYSTEM)
#-------------------------------------------------------------------------------
xo<-yo<-zo<-0
#-------------------------------------------------------------------------------
# CHANGE THE REFERENCE SYSTEM TO THE NEW POSITIONS
#-------------------------------------------------------------------------------
x<-x-xo
y<-y-yo
z<-0
x<-sample(x,1)
y<-sample(y,1)
#-------------------------------------------------------------------------------
# BSC CALCULATIONS
#-------------------------------------------------------------------------------
CWG<-vwfd.cwg(TE=!TM,M,S,g,kz,x+xo,y+yo,z+zo)
BSC<-vswf.cwg(g,kz,xo,yo,zo,lmax,M,TM,s=S)
PWE<-vswf.pwe(k,x,y,z,lmax,BSC$GTE,BSC$GTM)
#-------------------------------------------------------------------------------
# VALUES
#-------------------------------------------------------------------------------
cat("Distance x from origin in wavelength (from ",-R/(2*lambda),"to ",R/(2*lambda),"):",x/lambda,"\n")
cat("Distance y from origin in wavelength (from ",-R/(2*lambda),"to ",R/(2*lambda),"):",y/lambda,"\n")
df<-data.frame(
   PWE=c(PWE$Em,PWE$Ez,PWE$Ep,PWE$Hm,PWE$Hz,PWE$Hp),
   CWG=c(CWG$Em,CWG$Ez,CWG$Ep,CWG$Hm,CWG$Hz,CWG$Hp),
   row.names=c("Em","Ez","Ep","Hm","Hz","Hp")
   )
df$DIF<-df$PWE-df$CWG
print(df)

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