Plot electric and magnetic field lines in a waveguide

5k views Asked by At

I was reading a pdf about electromagnetic propagation in different waveguides, and I was wondering how these kind of plots as shown in the picture can be visualized in MATLAB.

enter image description here

I have the solutions of Ex,Ey,Hx and Hz for a rectangular waveguide, and I am trying to plot the field lines for TE11 mode. I have tried to use meshgrid and streamslice but couldn't make it at all.

1

There are 1 answers

0
nagordon On
% vector Field 2D
[X, Y, Z] = meshgrid(-10:1:10,-10:1:10,-10:1:10);
syms x y z 
V2(1) = -5*x;
V2(2) = x*y;
V2(3) = 0;
V1sub = subs(V2(1),[x,y,z],{X,Y,Z});
V2sub = subs(V2(2),[x,y,z],{X,Y,Z});
quiver(X,Y,V1sub,V2sub,2)
title('Vector field of V1')