In this project we will use Matlab to visualize the EM fields within a waveguide
ID: 2083620 • Letter: I
Question
In this project we will use Matlab to visualize the EM fields within a waveguide. Considera rectangul hollow metal waveguide as shown in the figure below. Let a 32 cm, b 1 cm and let the length of the waveguide along z-axis be 4cm. RF signal of frequency 40 GHz is being transmitted through the waveguide. Plot the following fields at time t- 0 assuming the arbitrary constant A 1. Hz of TE11 mode in the xy-plane. Ey of TE31 mode in the xz plane. Below an example is shown, provide the axis labels and the field component in your figures. Hz, B 760.5712 0.5 0.02 0.0 0.01 0.01 0 0 z (cm) x (cm)Explanation / Answer
bcs = 2*cos(pi*dy);
% boundary scalar
r1b = sin(pi*xv + ph);
r2b = r1b * bcs; grid= zeros(n*cyc,n);
% preallocate grid(1,:) = r1; grid(2,:) = r2;
% set row 1 and 2 (initial conds) % loop for remainder of rows for y = 3:n*cyc % calculate next row (0 back) r0b = a*( [r1b(2:n), 0] + [0, r1b(1:n-1)] ) + (1-a)*[0,r1b(2:n-1),0] - r2b;
% propagate left and right boundary condition r0b(1) = r1b(1)*bcs - r2b(1); r0b(n) = r1b(n)*bcs - r2b(n);
% advance one row grid(y,:) = r0b; r2b = r1b; r1b = r0b;
end;
% calculate next row, including boundary conditions grid(y,:) = a * ( ... [0, grid(y-1,3:n), 0] ... shift left + [0, grid(y-1,1:n-2), 0] ... shift right ) ... + [ ... bcs * grid(y-1,1), ... left boundary (1-a) * grid(y-1,2:n-1), ... one row back*(1-a) bcs * grid(y-1,n) ... right boundary ] ... - grid(y-2,:); % all minus 2 back
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.