Continue to Site

# problem creating constractive and destractive interference electromagnetic plot

Status
Not open for further replies.

#### yefj

Hello , i want to create the plot of E_i and E_r shown bellow , i should get square blocks ,which comes from constructive and distructive interference of the two modes.

I have written the mathematical expressions and implemented them in matlab (code is attached) but i get in the plot only one wave pattern, no two wave behavior(constructive and distructive interference squares)

Code:
clc
clear all
f=6;
lambda=300/6;
x=linspace(-0.5*lambda,0.5*lambda,1000);
y=linspace(-0.5*lambda,0.5*lambda,1000);
[xx,yy]=meshgrid(x,y);
k=2*pi/lambda;
E_i=1;
eta=377;
D_x=1.064*lambda;
k_y=sqrt(k^2-k_x.^2);

figure;
imagesc(x/lambda,y/lambda,abs(E_t))
xlabel('x [\lambda]')
ylabel('y [\lambda]')
colorbar;

you may be misinterpreting the data
generally the pattern of constructive and destructive is constructive, destructive, constructive destructive, etc
it is generally easy if one only considers fully constructive (bright) and fully destructive (dark)
what is in between, is in between

if the dark lines between the blue is fully destructive, and the bright yellow between the oranges is fully constructive,
the span of colors between, blue, green, orange, yellow is one view of a path from fully destructive to fully constructive
then the span from yellow, orange, green and blue is the corresponding path from fully constructive to fully destructive

the colorbar seems to confirm this

why do you expect a grid pattern?

when i try to plot the real part of the field i get the square pattern i expect
imagesc(x/lambda,y/lambda,real(E_t))
What is the logic of plotting the real part of a field in order to analize things?
why plotting abs is not correct?

what do you get when you plot the imaginary part?

Status
Not open for further replies.