1) As written in the task the L and H should be greater than 20h and impedance should be 50 ohms. Please help to adjust these parameters so that after changing the L and H I still get 50 ohms.
2) In the codes, in the last, I am not able to understand the Tolerance testing Part.
Codes:
%Clearing variables in memory and Matlab command screen close all; clear all; clc; %Problem data L = 10; H = 4.5; h = 0.5; w = 0.6; epsilon_0 = 8.854*10^-12; epsilon_r = 3.05*epsilon_0; %Dimensions of the simulation grid in x (xdim) and y (ydim) directions xdim=50; ydim=50; dx = L/xdim; dy = H/ydim; N_strip1x = floor((L-h)/2/dx); % number of node along x axis of the left strip N_strip2x = floor(N_strip1x + h/dx); % number of node along x axis of the left strip N_strip1y = floor((H-w)/2/dy); N_strip2y = floor(N_strip1y + w/dy); r = cos(pi/(xdim/L))+cos(pi/(H/ydim)); alpha = 1; %Initializing initial Potential matrix & boundary conditions for V_init V=zeros(xdim,ydim); V(N_strip1x,N_strip1y:N_strip2y) = 1; V(N_strip2x,N_strip1y:N_strip2y) = 1; %Initializing maximum number of iterations max_iterations = 500; Z0 = zeros(1,max_iterations); figure, for i = 1:max_iterations clc display(['iteration n° ',num2str(i),'/',num2str(max_iterations)]) V_old = V; for x = 2:xdim-1 for y = 2:ydim-1 % evaluate on the same line of the strips if x == N_strip1x && y > N_strip2y && y N_strip2y && y N_strip1x V(x,y)=epsilon_r*V_old(x,y)+alpha*(((epsilon_r*V_old(x-1,y)+epsilon_r*V_old(x+1,y)+epsilon_r*V_old(x,y-1)+epsilon_r*V_old(x,y+1))/4)-epsilon_r*V_old(x,y)); V(x,y) = (1/epsilon_r) * V(x,y); end %evaluate outside the strips if x > N_strip2x || x N_strip2y && y N_strip2y && y N_strip1x V(x,y)=epsilon_r*V_old(x,y)+omega(o)*(((epsilon_r*V_old(x-1,y)+epsilon_r*V_old(x+1,y)+epsilon_r*V_old(x,y-1)+epsilon_r*V_old(x,y+1))/4)-epsilon_r*V_old(x,y)); V(x,y) = (1/epsilon_r) * V(x,y); end %evaluate outside the strips if x > N_strip2x || x 0 break end end n_iterations(1,o) = i; end figure, plot(omega,n_iterations); xlim([0.9 1.02]); xlabel('Omega') ylabel('Number of iteration') title('Plot of number of iteration versus omega')