Description Usage Arguments Details Value See Also Examples
Beam Shape Coefficient for Circularly polarized Bessel Beam
1 | vswf.bbp(gama, kz, xo, yo, zo, lmax, M, s, p, code = "C")
|
gama |
The transversal component of the wave vector γ. |
kz |
The longitudinal component of the wave vector k_z. |
xo |
The position x at which the expansion is performed. |
yo |
The position y at which the expansion is performed. |
zo |
The position z at which the expansion is performed. |
lmax |
The maximum value of l in the expansion. |
M |
Order of the Bessel Beam. |
s |
Chirality of the Bessel Beam (S=\pm 1). |
p |
Polarity of the Bessel beam (S=\pm 1). |
Calculate the Beam Shape Coefficients for the partial wave expansion in Vector Spherical Wave Functions.
The Beam Shape Coefficients for a Circularly polarized Bessel Beam.
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 | lambda=.5e-6 # Propagating wavelength
a<-8*lambda # Size x of the waveguide (Rectangular Wave Guide)
b<-8*lambda # Size y of the waveguide (Rectangular Wave Guide)
l<-6*lambda # Size z of the waveguide (Rectangular Wave Guide)
M<-5 # x wavefield mode
N<-4 # y wavefield mode
S<--1 # Chirality
P<- 1 # Mode (+/- 1)
# 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
TM<-ifelse(P==-1,TRUE,FALSE)
#-------------------------------------------------------------------------------
# Geometry of the calculations
#-------------------------------------------------------------------------------
NPX<-4*50+1
NPY<-4*60+1
NPZ<-4*20+1
dx<-2*a/(NPX-1)
dy<-2*b/(NPY-1)
dz<-2*l/(NPZ-1)
x<-seq(-a,a,by=dx)
y<-seq(-b,b,by=dy)
z<-0
#-------------------------------------------------------------------------------
lmax<- 80 # 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)
#-------------------------------------------------------------------------------
# ARBITRARY: We select two points, the is for the origin of the expansion,
# the second is for the test, that must have be move to the new
# system of coordinates x'=x-xo
xo<-yo<-zo<-0
x<-sample(x,1)
y<-sample(y,1)
#-------------------------------------------------------------------------------
# BSC CALCULATIONS
#-------------------------------------------------------------------------------
BBP<-vwfd.bbp(P,M,S,gama,kz,x+xo,y+yo,z+zo) # WAVE FIELD DEFINITION
BSC<-vswf.bbp(gama,kz,xo,yo,zo,lmax,M,S,P) # BEAM SHAPE COEFFICIENTS
PWE<-vswf.pwe(k,x,y,z,lmax,BSC$GTE,BSC$GTM) # PARTIAL WAVE EXPANSION
#-------------------------------------------------------------------------------
# VALUES
#-------------------------------------------------------------------------------
cat("Distance x from origin in wavelength (from ",-a/lambda,"to ",a/lambda,"):",x/lambda,"\n")
cat("Distance y from origin in wavelength (from ",-b/lambda,"to ",b/lambda,"):",y/lambda,"\n")
df<-data.frame(
PWE=c(PWE$Em,PWE$Ez,PWE$Ep,PWE$Hm,PWE$Hz,PWE$Hp),
BBP=c(BBP$Em,BBP$Ez,BBP$Ep,BBP$Hm,BBP$Hz,BBP$Hp),
row.names=c("Em","Ez","Ep","Hm","Hz","Hp")
)
df$DIF<-df$PWE-df$BBP
print(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.