0% found this document useful (0 votes)
14 views4 pages

Lineas

The document contains code to generate electromagnetic field plots for different modes by varying parameters like m, n, and z. It contains 4 sections that generate the plots for different modes by changing these parameters and plotting the real parts of the x and y components of the fields.

Uploaded by

andre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Lineas

The document contains code to generate electromagnetic field plots for different modes by varying parameters like m, n, and z. It contains 4 sections that generate the plots for different modes by changing these parameters and plotting the real parts of the x and y components of the fields.

Uploaded by

andre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

%Primera Parte

m = 1;

n = 0;
a = 2;
b = 1;
x1 = 0:a/50:a;
y1 = 0:b/50:b;
betha = 1;
z = 3;
k = 1;
kc = 1;
[x,y] = meshgrid(x1,y1);
Ex = real(1j*cos((x.*m*pi)./a).*sin((y.*n*pi)./b).*exp(-1j*betha*z));
Ey = real(-1j*sin((x.*m*pi)./a).*cos((y.*n*pi)./b).*exp(-1j*betha*z));
%Figure
quiver(x,y,Ex,Ey)
axis([0 2 0 1])

%%Segunda Parte
m = 1;
n = 0;
a = 2;
b = 1;
x1 = 0:a/50:a;
y1 = 0:b/50:b;
betha = 1;
z = 3;
k = 1;
kc = 1;
[x,y] = meshgrid(x1,y1);
Hx = real(sin((x.*m*pi)./a).*cos((y.*n*pi)./b).*exp(-1j*betha*z));
Hy = real(cos((x.*m*pi)./a).*sin((y.*n*pi)./b).*exp(-1j*betha*z));
%figure
quiver(x,y,Hx,Hy)
axis([0 2 0 1])

%%Tercera parte
m = 2;
n = 1;
a = 2;
b = 1;
x1 = 0:a/50:a;
y1 = 0:b/50:b;
betha = 1;
z = 3;
k = 1;
kc = 1;
[x,y] = meshgrid(x1,y1);
Ex = real(1j*cos((x.*m*pi)./a).*sin((y.*n*pi)./b).*exp(-1j*betha*z));
Ey = real(-1j*sin((x.*m*pi)./a).*cos((y.*n*pi)./b).*exp(-1j*betha*z));
%figure
quiver(x,y,Ex,Ey)
axis([0 2 0 1])

%%Cuarta Parte
m = 2;
n = 1;
a = 2;
b = 1;
x1 = 0:a/50:a;
y1 = 0:b/50:b;
betha = 1;
z = 3;
k = 1;
kc = 1;
[x,y] = meshgrid(x1,y1);
Hx = real(sin((x.*m*pi)./a).*cos((y.*n*pi)./b).*exp(-1j*betha*z));
Hy = real(cos((x.*m*pi)./a).*sin((y.*n*pi)./b).*exp(-1j*betha*z));
%figure
quiver(x,y,Hx,Hy)
axis([0 2 0 1])

You might also like