4.1 Two grounded, semi-infinite, parallel-plane electrodes are separated by a di
ID: 2294043 • Letter: 4
Question
4.1 Two grounded, semi-infinite, parallel-plane electrodes are separated by a distance b. A third electrode is perpendicular to both plates. The potential on the top plate and perpendicular plate is maintained at Uo, and the potential on the bottom plate is zero. Determine the potential distribution in the region enclosed by these electrodes 5. Finite difference method (FDM) 5.1 Repeat the FDM method in the class. Write Matlab programs to calculate the potential distribution. Plot the potential distribution, and discuss your results and observations. (a) Use the iterative method to determine the potential distribution. (b) Use the matrix inversion method to determine the potential distribution.Explanation / Answer
function CMAP = flagcmap(varargin)
% FLAGCMAP Colormap for Different Country's Flags
%
% colormap(flagcmap('USA')); %defaults to 256 colors
% colormap(flagcmap('USA',N)); %uses N colors
%
% This function provides colormaps for the countries of the EM Lab.
%
% Countries in alphabetical order:
% 'Bangladesh'
% 'China'
% 'Goban'
% 'India'
% 'Mexico'
% 'UK'
% 'USA'
% 'UTEP'
% HANDLE NUMBER OF COLORS
if nargin==0
CTY = 'USA';
NCOL = 256;
elseif nargin==1
CTY = varargin{1};
NCOL = 256;
elseif nargin==2
CTY = varargin{1};
NCOL = varargin{2};
else
error('Too many input arguments');
end
% DEFINE COLORS
switch lower(CTY)
case 'bangladesh',
cneg = [0 106 78]/255;
czero = [1 1 1];
cpos = [244 42 65]/255;
case 'china', %yellow, red, green
cneg = [0 104 71]/255;
czero = [255 255 200]/255;
cpos = [170 56 30]/255;
case 'goban',
cneg = [58 117 196]/255;
czero = [252 209 22]/255;
cpos = [0 158 96]/255;
case 'india',
cneg = [19 136 8]/255;
czero = [1 1 1];
cpos = [255 153 51]/255;
case 'mexico',
cneg = [0 104 71]/255;
czero = [1 1 1];
cpos = [206 17 38]/255;
case 'uk',
cneg = [0 36 125]/255;
czero = [1 1 1];
cpos = [207 20 43]/255;
case 'usa',
cneg = [0 40 104]/255;
czero = [1 1 1];
cpos = [191 10 48]/255;
case 'utep',
cneg = [64 73 101]/255;
czero = [1 1 1];
cpos = [255 136 67]/255;
otherwise,
error('Unrecognized country. Sorry!');
end
% CREATE COLORMAP
CMAP = zeros(NCOL,3);
ncm = 1 + floor(NCOL/2);
for nc = 1 : ncm
f = (nc-1)/(ncm - 1);
CMAP(nc,:) = (1-f)*cneg + f*czero;
end
for nc = ncm+1 : NCOL
f = (nc - ncm)/(NCOL - ncm);
CMAP(nc,:) = (1-f)*czero + f*cpos;
end
% polyfill_demo.m
%
% POLYFILL Fill 2D Grid with a Polygon
%
% A = polyfill(xa,ya,P);
%
% xa,ya Grid Axes for the Array A
% P List of vertices for the polygon
% [ x1 x2 ... xN ;
% y1 y2 ... yN ]; N vertices
% A 2D array with polygon filled
%
% Note: The list of points P should progress CCW around the polygon.
% If the points are listed in reverse order, the outside of
% the polygon will be filled.
% INITIALIZE MATLAB
close all;
clc;
clear all;
% GRID
Sx = 1;
Sy = 1;
Nx = 64;
Ny = round(Nx*Sy/Sx);
xa = linspace(0,Sx,Nx);
ya = linspace(0,Sy,Ny);
% CREATE ARBITRARY POLYGON
p1 = [ 0.3 ; 0.1 ];
p2 = [ 0.8 ; 0.2 ];
p3 = [ 0.7 ; 0.9 ];
p4 = [ 0.6 ; 0.4 ];
p5 = [ 0.1 ; 0.8 ];
P = [ p1 p2 p3 p4 p5 p1 ];
% CALL POLYFILL TO FILL POLYGON IN ARRAY A
A = polyfill(xa,ya,P);
% SHOW A
imagesc(xa,ya,A');
axis equal tight;
colorbar;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.