clear all close all % Problem domain, in meters. X = 2; Y = 1; D = 0.025; % Problem domain, in cells. NX = X/D; NY = Y/D; V_last = zeros(NY+1,NX+1); V_next = zeros(NY+1,NX+1); % Write boundary conditions into V_last. V_last(1,:) = -1; V_last(end,:) = 1; V_last(:,1) = linspace(-1,1, NY+1); V_last(:,end) = linspace(-1,1, NY+1); V_last(1:18,39:41) = -1; V_last(24:41,39:41) = 1; ITERATIONS = 800; for i=1:ITERATIONS for iy=2:NY for ix=2:NX V_next(iy,ix) = 1/4* ( V_last(iy-1,ix) + V_last(iy+1,ix) + V_last(iy,ix-1) + V_last(iy,ix+1) ); end end % Write boundary conditions into V_next. V_next(1,:) = -1; V_next(end,:) = 1; V_next(:,1) = linspace(-1,1, NY+1); V_next(:,end) = linspace(-1,1, NY+1); V_next(1:18,39:41) = -1; V_next(24:41,39:41) = 1; % Iterate. V_last = V_next; end x_axis = linspace(0,X, NX + 1); y_axis = linspace(0,Y, NY + 1); [x,y] = meshgrid(x_axis, y_axis); [Ex,Ey] = gradient(-V_last,D,D); contour(x,y,V_last,20); hold on quiver(x,y,Ex,Ey); hold off axis equal; xlabel ('x, meters'); ylabel ('y, meters'); title ('ECE 311 - HW7, Problem 2'); set(gcf,'Color',[1 1 1]); disp ('Conceptual Question: Dielectric breakdown occurs because the electric'); disp ('field is so large that it can strip electrons even from non-conducting'); disp ('atoms. The most likely place for this to occur is where E is the largest,'); disp ('in the small gap between the conducting fins. Real devices which deliberately'); disp ('create sparks (like spark plugs) are shaped similarly. Two conductors at '); disp ('different potentials are bent into close proximity, to the spark will occur'); disp ('in the same place in a predictable manner.');