Wave guide modes

Preparation

<<Graphics`PlotField`
<<Graphics`Graphics`
<<Calculus`VectorAnalysis`
<<NumericalMath`BesselZeros`

Clear[ϵ,r]

CylindricalToXYZ[vec_]:=Module[{c,s},
If[
Length[vec]==3,c=Cos[vec[[2]]];s=Sin[vec[[2]]];
vec[[1]]{c,s,0}+vec[[3]]{0,0,1},
If[
Length[vec]==2&&Length[vec[[1]]]==3&&Length[vec[[2]]]==3,c=Cos[vec[[1,2]]];s=Sin[vec[[1,2]]];
{CylindricalToXYZ[vec[[1]]],vec[[2,1]]{c,s,0}+vec[[2,2]]{-s,c,0}+vec[[2,3]]{0,0,1}},
Print["*** Error in CylindricalToXYZ: input has wrong dimensions"]
]
]
]

Visualization for Rectangular Wave Guides

Field, Pointing Vector, Field Energy

Off[General::"spell1"]
Off[General::"spell"]

kE[n_,m_]:=(Sqrt[(((((n π)/a)))^2)+(((((m π)/b)))^2)])

Clear[vEe]
vEe[n_,m_,x_,y_,z_,t_]:=(ω/((kE[n,m])^2))Bz{((m π)/b) Cos[((n π)/a)x]Sin[((m π)/b)y]Sin[k z - ω t],-((n π)/a) Sin[((n π)/a)x]Cos[((m π)/b)y]Sin[k z - ω t],0}
Clear[vBe]
vBe[n_,m_,x_,y_,z_,t_]:=(k/((kE[n,m])^2))Bz{((n π)/a) Sin[((n π)/a)x]Cos[((m π)/b)y]Sin[k z - ω t],((m π)/b)Cos[((n π)/a)x]Sin[((m π)/b)y]Sin[k z - ω t],(((kE[n,m])^2)/k)Cos[((n π)/a)x]Cos[((m π)/b)y]Cos[k z - ω t]}
Clear[vEm]
vEm[n_,m_,x_,y_,z_,t_]:=(k/((kE[n,m])^2))Ez{-((n π)/a) Cos[((n π)/a)x]Sin[((m π)/b)y]Sin[k z - ω t],-((m π)/b) Sin[((n π)/a)x]Cos[((m π)/b)y]Sin[k z - ω t],(((kE[n,m])^2)/k)Sin[((n π)/a)x]Sin[((m π)/b)y]Cos[k z - ω t]}
Clear[vBm]
vBm[n_,m_,x_,y_,z_,t_]:=(ω/((c^2)((kE[n,m])^2)))Ez{((m π)/b) Sin[((n π)/a)x]Cos[((m π)/b)y]Sin[k z - ω t],-((n π)/a)Cos[((n π)/a)x]Sin[((m π)/b)y]Sin[k z - ω t],0}

Clear[vEes]
vEes[n_,m_,x_,y_,z_,t_]:=vEe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t](((kE[n,m])^2)/(Bz π ω))b/.{b->ϵ a}
Clear[vBes]
vBes[n_,m_,x_,y_,z_,t_]:=vBe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t](((kE[n,m])^2)/(Bz π k))b/.{b->ϵ a}
Clear[vEms]
vEms[n_,m_,x_,y_,z_,t_]:=vEm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t](((kE[n,m])^2)/(Ez π k))b/.{b->ϵ a}
Clear[vBms]
vBms[n_,m_,x_,y_,z_,t_]:=vBm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t](((c^2)((kE[n,m])^2))/(Ez π ω))b/.{b->ϵ a}

vSes[n_,m_,x_,y_,z_,t_]:=Cross[vEes[n,m,x,y,z,t],vBes[n,m,x,y,z,t]]4 a k ϵ

vSms[n_,m_,x_,y_,z_,t_]:=Cross[vEms[n,m,x,y,z,t],vBms[n,m,x,y,z,t]]4 a k ϵ

Simplify[Simplify[((((kE[n,m])^4)(b^4))/((Bz^2)(π^2)(c^2)))(vEe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t].vEe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t]+(c^2)vBe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t].vBe[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t])]/.{(ω^2)->((k^2)+((kE[n,m])^2))(c^2)}/.{b->ϵ a}]

sUes[n_,m_,x_,y_,z_,t_]:=((Cos[n x ϵ])^2) ((π^2) ((((m^2)+(n^2) (ϵ^2)))^2) ((Cos[m y])^2) ((Cos[t-z])^2)+(m^2) ((m^2) (π^2)+(2 (a^2) (k^2)+(n^2) (π^2)) (ϵ^2)) ((Sin[m y])^2) ((Sin[t-z])^2))+(n^2) (ϵ^2) ((m^2) (π^2)+(2 (a^2) (k^2)+(n^2) (π^2)) (ϵ^2)) ((Cos[m y])^2) ((Sin[t-z])^2) ((Sin[n x ϵ])^2)

Simplify[Simplify[((((kE[n,m])^4)(b^4))/((Ez^2)(π^2)))(vEm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t].vEm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t]+(c^2)vBm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t].vBm[n,m,(b/π)x,(b/π)y,(1/k)z,(1/ω)t])]/.{(ω^2)->((k^2)+((kE[n,m])^2))(c^2)}/.{b->ϵ a}]

sUms[n_,m_,x_,y_,z_,t_]:=(π^2) ((((m^2)+(n^2) (ϵ^2)))^2) ((Cos[t-z])^2) ((Sin[m y])^2) ((Sin[n x ϵ])^2)+((m^2) (π^2)+(2 (a^2) (k^2)+(n^2) (π^2)) (ϵ^2)) ((Sin[t-z])^2) ((n^2) (ϵ^2) ((Cos[n x ϵ])^2) ((Sin[m y])^2)+(m^2) ((Cos[m y])^2) ((Sin[n x ϵ])^2))

On[General::"spell1"]
On[General::"spell"]

TE modes

ϵ=1.3;i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
PlotVectorField[Take[vEes[2,2,x,y,(π/2),t],2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Ex/Ey for TE mode 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Take[vBes[2,2,x,y,(π/2),t],2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Bx/By for TE modes 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Drop[vBes[2,2,x,(π/2),z,t],{2}]/.{k->2(π/a)},{x,0,(Pi/ϵ)},{z,0,2π},ScaleFactor->0.4,AspectRatio->ϵ,Frame->True,PlotLabel->"Bx/Bz for central y in TE mode 2,2",PlotRange->{{0,(π/ϵ)},{0,2π}}],
ImageSize->{900,300 ϵ}
],
{t,(π/20),2π-(π/20),(π/10)}]

Export["C:\MyFiles\modeTE22.gif",Table[pic[i],{i,20}],"GIF"]
Export["C:\MyFiles\modeTE22.avi",Table[pic[i],{i,20}],"AVI"]

TM modes

ϵ=1.3;i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
PlotVectorField[Take[vEms[2,2,x,y,(π/2),t],2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Ex/Ey for TM mode 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Take[vBms[2,2,x,y,(π/2),t],2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Bx/By for TM mode 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Take[vEms[2,2,(π/(2ϵ)),y,z,t],-2]/.{k->2(π/a)},{z,0,2π},{y,0,Pi},ScaleFactor->0.4,AspectRatio->(1/2),Frame->True,PlotLabel->"Ey/Ez for central x in TM mode 2,2",PlotRange->{{0,2π},{0,π}}],ImageSize->{900,300 ϵ}
],
{t,(π/20),2π-(π/20),(π/10)}]

Export["C:\MyFiles\modeTM22.gif",Table[pic[i],{i,20}],"GIF"]
Export["C:\MyFiles\modeTM22.avi",Table[pic[i],{i,20}],"AVI"]

Pointing Vector

ϵ=1.3;i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
PlotVectorField[Take[vSes[2,2,x,y,(π/4),t]/.{k->2(π/a)},2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[2t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Sx/Sy for TE mode 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Take[vSms[2,2,x,y,(π/4),t]/.{k->2(π/a)},2],{x,0,(Pi/ϵ)},{y,0,Pi},ScaleFactor->0.3Abs[Cos[2t]],AspectRatio->ϵ,Frame->True,PlotLabel->"Sx/Sy for TM mode 2,2",PlotRange->{{0,(π/ϵ)},{0,π}}],
PlotVectorField[Drop[vSes[2,2,x,(π/2),z,t],{2}]/.{k->2(π/a)},{x,0,(Pi/ϵ)},{z,0,2π},ScaleFactor->0.4,AspectRatio->ϵ,Frame->True,PlotLabel->"Sx/Sz for central y in TE mode 2,2",PlotRange->{{0,(π/ϵ)},{0,2π}}],ImageSize->{900,300 ϵ}
],
{t,(π/30),π-(π/30),(π/10)}]

Export["C:\MyFiles\pointing22.gif",Table[pic[i],{i,10}],"GIF"]
Export["C:\MyFiles\pointing22.avi",Table[pic[i],{i,10}],"AVI"]

Energy Density

ϵ=1.3;
i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
Plot3D[sUes[2,2,x,y,(π/2),t]/.{k->2(π/a)},{x,0,(π/ϵ)},{y,0,π},PlotLabel->"Energy density for TE mode 2,2",PlotRange->{0,2000},BoxRatios->{1,ϵ,0.4}],
Plot3D[sUms[2,2,x,y,(π/2),t]/.{k->2(π/a)},{x,0,(π/ϵ)},{y,0,π},PlotLabel->"Energy density for TM mode 2,2",PlotRange->{0,2000},BoxRatios->{1,ϵ,0.4}],
Plot3D[sUms[2,2,x,(π/2),z,t]/.{k->2(π/a)},{x,0,(π/ϵ)},{z,0,2π},PlotLabel->"Energy density for TM mode 2,2",PlotRange->{0,2000},BoxRatios->{1,2,0.4}],ImageSize->{900,300}
],
{t,(π/30),π-(π/30),(π/10)}]

Export["C:\MyFiles\energy22.gif",Table[pic[i],{i,10}],"GIF"]
Export["C:\MyFiles\energy22.avi",Table[pic[i],{i,10}],"AVI"]

Visualization for Circular Wave Guides

Field, Pointing Vector, Field Energy

Off[General::"spell1"]
Off[General::"spell"]
Off[Part::"pspec"]
Off[General::"stop"]

kM[n_,m_]:=((BesselJZeros[n,m][[m]])/a)
kE[n_,m_]:=((BesselJPrimeZeros[n,m][[m]])/a)

Clear[vEe]
vEe[n_,m_,r_,ϕ_,z_,t_]:=(ω/(kE[n,m]))Bz{-(n/(kE[n,m]r)) BesselJ[n,kE[n,m]r]Cos[n ϕ+k z - ω t], ((BesselJ[n-1,kE[n,m]r]-BesselJ[n+1,kE[n,m]r])/2)Sin[n ϕ+k z - ω t],0}
Clear[vBe]
vBe[n_,m_,r_,ϕ_,z_,t_]:=(k/(kE[n,m]))Bz{-((BesselJ[n-1,kE[n,m]r]-BesselJ[n+1,kE[n,m]r])/2)Sin[n ϕ+k z - ω t],-(n/(kE[n,m]r)) BesselJ[n,kE[n,m]r]Cos[n ϕ+k z - ω t],((kE[n,m])/k)BesselJ[n,kE[n,m]r]Cos[n ϕ+k z - ω t]}
Clear[vEm]
vEm[n_,m_,r_,ϕ_,z_,t_]:=(k/(kM[n,m]))Ez{-((BesselJ[n-1,kM[n,m]r]-BesselJ[n+1,kM[n,m]r])/2)Sin[n ϕ+k z - ω t],-(n/(kM[n,m]r)) BesselJ[n,kM[n,m]r]Cos[n ϕ+k z - ω t],((kM[n,m])/k)BesselJ[n,kM[n,m]r]Cos[n ϕ+k z - ω t]}
Clear[vBm]
vBm[n_,m_,r_,ϕ_,z_,t_]:=(ω/(kM[n,m](c^2)))Ez{(n/(kM[n,m]r)) BesselJ[n,kM[n,m]r]Cos[n ϕ+k z - ω t],- ((BesselJ[n-1,kM[n,m]r]-BesselJ[n+1,kM[n,m]r])/2)Sin[n ϕ+k z - ω t],0}

Clear[vEes]
vEes[n_,m_,r_,ϕ_,z_,t_]:=vEe[n,m,a r,ϕ,(1/k)z,(1/ω)t]((((kE[n,m])^2)a)/(Bz ω))
Clear[vBes]
vBes[n_,m_,r_,ϕ_,z_,t_]:=vBe[n,m,a r,ϕ,(1/k)z,(1/ω)t]((((kE[n,m])^2)a)/(Bz k))
Clear[vEms]
vEms[n_,m_,r_,ϕ_,z_,t_]:=vEm[n,m,a r,ϕ,(1/k)z,(1/ω)t]((((kM[n,m])^2)a)/(Ez k))
Clear[vBms]
vBms[n_,m_,r_,ϕ_,z_,t_]:=vBm[n,m,a r,ϕ,(1/k)z,(1/ω)t]((((kM[n,m])^2)a (c^2))/(Ez ω))

vSes[n_,m_,r_,ϕ_,z_,t_]:=Cross[vEes[n,m,r,ϕ,z,t],vBes[n,m,r,ϕ,z,t]]4 a k
vSms[n_,m_,r_,ϕ_,z_,t_]:=Cross[vEms[n,m,r,ϕ,z,t],vBms[n,m,r,ϕ,z,t]]4 a k

Simplify[Simplify[((4 ((kE[n,m])^4)(a^4))/((Bz^2)(c^2)))(vEe[n,m,a r,ϕ,(1/k)z,(1/ω)t].vEe[n,m,a r,ϕ,(1/k)z,(1/ω)t]+(c^2)vBe[n,m,a r,ϕ,(1/k)z,(1/ω)t].vBe[n,m,a r,ϕ,(1/k)z,(1/ω)t])]/.{(ω^2)->((k^2)+((kE[n,m])^2))(c^2)}]

sUes[n_,m_,r_,ϕ_,z_,t_]:=(1/(r^2))(4 (r^2) ((BesselJ[n,r BesselJPrimeZeros[n,m][[m]]])^2) ((Cos[t-z-n ϕ])^2) ((BesselJPrimeZeros[n,m][[m]])^4)+4 (n^2) ((BesselJ[n,r BesselJPrimeZeros[n,m][[m]]])^2) ((Cos[t-z-n ϕ])^2) (2 (a^2) (k^2)+((BesselJPrimeZeros[n,m][[m]])^2))+(r^2) (((BesselJ[-1+n,r BesselJPrimeZeros[n,m][[m]]]-BesselJ[1+n,r BesselJPrimeZeros[n,m][[m]]]))^2) ((BesselJPrimeZeros[n,m][[m]])^2) (2 (a^2) (k^2)+((BesselJPrimeZeros[n,m][[m]])^2)) ((Sin[t-z-n ϕ])^2))

Simplify[Simplify[((4 ((kM[n,m])^4)(a^4))/(Ez^2))(vEm[n,m,a r,ϕ,(1/k)z,(1/ω)t].vEm[n,m,a r,ϕ,(1/k)z,(1/ω)t]+(c^2)vBm[n,m,a r,ϕ,(1/k)z,(1/ω)t].vBm[n,m,a r,ϕ,(1/k)z,(1/ω)t])]/.{(ω^2)->((k^2)+((kM[n,m])^2))(c^2)}]

sUms[n_,m_,r_,ϕ_,z_,t_]:=(1/(r^2))(4 (r^2) ((BesselJ[n,r BesselJZeros[n,m][[m]]])^2) ((Cos[t-z-n ϕ])^2) ((BesselJZeros[n,m][[m]])^4)+4 (n^2) ((BesselJ[n,r BesselJZeros[n,m][[m]]])^2) ((Cos[t-z-n ϕ])^2) (2 (a^2) (k^2)+((BesselJZeros[n,m][[m]])^2))+(r^2) (((BesselJ[-1+n,r BesselJZeros[n,m][[m]]]-BesselJ[1+n,r BesselJZeros[n,m][[m]]]))^2) ((BesselJZeros[n,m][[m]])^2) (2 (a^2) (k^2)+((BesselJZeros[n,m][[m]])^2)) ((Sin[t-z-n ϕ])^2))

On[General::"spell1"]
On[General::"spell"]
On[Part::"pspec"]
On[General::"stop"]

TE Modes

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vEes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic1[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),2π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vBes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic2[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),2π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};y=0;
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z},vBes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z,t]/.{k->2.(π/a)}}]],
{x,-1.,1.,(2./npart)}
],
{z,0.,2.π,((2.π)/npart)}
];Clear[y];
vectors=Map[{#[[3]],#[[1]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic3[i]=ListPlotVectorField[vectors,ScaleFactor->0.3,AspectRatio->(1/2)],
{t,(π/20),2π,(π/10)}]

Show[pic1[1],Graphics[Circle[{0,0},1]],AspectRatio->1]

i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
{DisplayTogetherArray[
Show[pic1[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
Show[pic2[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
ImageSize->{600,300}]},
{Show[pic3[i],AspectRatio->(1/2),Frame->True]},
ImageSize->{600,600 }
],
{t,(π/20),2π-(π/20),(π/10)}]

Export["C:\MyFiles\modeTEC22.gif",Table[pic[i],{i,20}],"GIF"]
Export["C:\MyFiles\modeTEC22.avi",Table[pic[i],{i,20}],"AVI"]

TE Modes

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vEms[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic1[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),2π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vBms[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic2[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),2π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};y=0;
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z},vEms[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z,t]/.{k->2.(π/a)}}]],
{x,-1.,1.,(2./npart)}
],
{z,0.,2.π,((2.π)/npart)}
];Clear[y];
vectors=Map[{#[[3]],#[[1]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic3[i]=ListPlotVectorField[vectors,ScaleFactor->0.3,AspectRatio->(1/2)],
{t,(π/20),2π,(π/10)}]

i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
{DisplayTogetherArray[
Show[pic1[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
Show[pic2[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
ImageSize->{600,300}]},
{Show[pic3[i],AspectRatio->(1/2),Frame->True]},
ImageSize->{600,600 }
],
{t,(π/20),2π-(π/20),(π/10)}]

Export["C:\MyFiles\modeTMC22.gif",Table[pic[i],{i,20}],"GIF"]
Export["C:\MyFiles\modeTMC22.avi",Table[pic[i],{i,20}],"AVI"]

Pointing Vector

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vSes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic1[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.)},vSms[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]}]],
{x,-1.,1.,(2./npart)}
],
{y,-1.,1.,(2./npart)}
];
vectors=Map[{#[[1]],#[[2]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic2[i]=ListPlotVectorField[vectors,ScaleFactor->0.2],
{t,(π/20),π,(π/10)}]

npart=15;i=0;
Do[i=i+1;
vectors={};y=0;
Do[
Do[
If[(x^2)+(y^2)≤1,vectors=Append[vectors,{{(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z},vSes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],z,t]/.{k->2.(π/a)}}]],
{x,-1.,1.,(2./npart)}
],
{z,0.,2.π,((2.π)/npart)}
];Clear[y];
vectors=Map[{#[[3]],#[[1]]}&,Map[CylindricalToXYZ[#]&,vectors],{2}];
pic3[i]=ListPlotVectorField[vectors,ScaleFactor->0.3,AspectRatio->(1/2)],
{t,(π/20),π,(π/10)}]

i=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
{DisplayTogetherArray[
Show[pic1[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
Show[pic2[i],Graphics[Circle[{0,0},1]],AspectRatio->1],
ImageSize->{600,300}]},
{Show[pic3[i],AspectRatio->(1/2),Frame->True]},
ImageSize->{600,600 }
],
{t,(π/20),π-(π/20),(π/10)}]

Export["C:\MyFiles\pointingC22.gif",Table[pic[i],{i,10}],"GIF"]
Export["C:\MyFiles\pointingC22.avi",Table[pic[i],{i,10}],"AVI"]

Energy Density

i=0;
y0=0;
Do[i=i+1;
pic[i]=DisplayTogetherArray[
Plot3D[If[(x^2)+(y^2)≤1,sUes[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]/.{k->2.(π/a)},0],{x,-1.,1.},{y,-1.,1.},PlotLabel->"Energy density for TE mode 2,2",PlotRange->{0,4000},BoxRatios->{1,1,0.4}],
Plot3D[If[(x^2)+(y^2)≤1,sUms[2,2,(Sqrt[(x^2)+(y^2)]),ArcTan[x,y],(π/2.),t]/.{k->2.(π/a)},0],{x,-1.,1.},{y,-1.,1.},PlotLabel->"Energy density for TM mode 2,2",PlotRange->{0,8000},BoxRatios->{1,1,0.4}],
Plot3D[If[(x^2)+(y0^2)≤1,sUms[2,2,(Sqrt[(x^2)+(y0^2)]),ArcTan[x,y0],z,t]/.{k->2.(π/a)},0],{x,-1.,1.},{z,0.,2.π},PlotLabel->"Energy density for TM mode 2,2",PlotRange->{0,8000},BoxRatios->{1,2,0.4}],ImageSize->{900,300}
],
{t,(π/30),π-(π/30),(π/10)}];
Clear[y0]

Export["C:\MyFiles\energyC22.gif",Table[pic[i],{i,10}],"GIF"]
Export["C:\MyFiles\energyC22.avi",Table[pic[i],{i,10}],"AVI"]