method of moments solution forchargedline and …€¦ · ece 618 - project3 method of moments...

14
ECE 618 - Project 3 METHOD OF MOMENTS SOLUTION FOR CHARGED LINE AND PLATE IMMERSED IN A DIELECTRIC May 7, 2014 Andrew H. Velzen Purdue University Professor Dan Jiao

Upload: others

Post on 07-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

ECE 618 - Project 3

METHOD OF MOMENTS SOLUTION

FOR CHARGED LINE AND PLATE

IMMERSED IN A DIELECTRIC

May 7, 2014

Andrew H. Velzen

Purdue University

Professor Dan Jiao

Page 2: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

1 Problem Statement

The two problems which I seek to solve are as follows: “Simulate the capacitanceper unit length of a metallic strip of width W immersed in a dielectric regionof relative permittivity εr,” and “Simulate the capacitance of a metallic squareplate of side length L immersed in a dielectric region of relative permittivityεr,” with various given values for W, L, and εr. I employed the Method ofMoments (MoM) to produce the solutions. I also went further, by generalizingthe solution to any values of W, L, and εr. I used MATLAB to implement thesolution.

2 Approach

How I went about solving the problem/presenting the solution in a user-friendlyway, is as follows. I first wrote the MoM solution for the metallic strip case, andplotted the results of the charge distribution for the requested conditions givenin the problem statement and assured that they looked reasonable. Followingthat, I wrote the MoM solution for the metallic square plate case. Again, Iplotted and verified the requested results. I also calculated the capacitancein each case, as requested in the problem. Lastly, I developed a GraphicalUser Interface (GUI), using the Graphical User Interface Design Environment(GUIDE) for MATLAB, to display any numeric and graphical solution elegantly.

3 Solution Implementation

3.1 MoM Solution for Metallic Strip

I will begin by discussing the MoM solution for the metallic strip. I wrotea modular function to solve this problem, the code for which can be seen inAppendix B, Subsection 1. The function takes in the width of the strip, as wellas the relative permittivity of the dielectric, and returns an array containingthe charge density, in C

m , as well as the capacitance of the strip. I first defineall the variables that will be used during the execution of the function. A smallnote on the step size in X. I decided to discretize it into 100 steps because itseemed to provide a reasonable balance between computation time, and solutionresolution. I then instantiate the Z matrix and the potential array that will beused to generate the charge density array. The potential array, {V0}, is all 1’sbecause we are going to assume the voltage on the strip is 1V everywhere tosolve the problem. The Z matrix and potential array correspond to the solutionof [Z]{α} = {V0}, as discussed in class. Next, I populate the Z matrix withthe appropriate values, as derived in class. The value of Zmn when m = n is−∆2πε [ln(

∆2 )−1] and − ln |xm−xn|∆

2πε when m 6= n, where ∆ is the step size, in X, andε is the dielectric permittivity. From there, I use MATLAB’s built in matrixinversion to calculate {α} = [Z]−1{V0}. After that, I found the total chargeon the strip by integrating the {α} array (taking the charge density value at

2

Page 3: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

each index, and multiplying by the step size, in X). Lastly, before returning therequisite values from the function, I calculate the capacitance by dividing thetotal charge by the test voltage applied to the strip.

3.2 MoM Solution for Metallic Square Plate

Now I will discuss the MoM solution for the metallic square plate. Again, Iwrote a modular function to solve this problem, the code for which can beseen in Appendix B, Subsection 2. The function takes in the side length of thesquare, as well as the relative permittivity of the dielectric, and returns a matrixcontaining the charge density, in C

m2 , as well as the capacitance of the square.As with the strip, I first define all the variables that will be used during theexecution of the function. Different from the strip, though, is the step size Ichose to use. I discretize the domain into 25 steps in X, and 25 in Y. When Itried 100 for each side, there was a noticeable lag with the computation, so Iopted for 25 instead. I also saw no reason to choose different step sizes for Xand Y, given that the problem was symmetric, but, in theory, one could easilydo it. I next create the Z matrix and potential array, and populated them withzeros and ones, respectively. I then iterate through the Z matrix, finding thecorresponding X and Y coordinates at the center of the grid square at eachlocation. After finding those coordinates, I then populate the Z matrix with the

following values for Zmn:ln(1+

√2)∆

πεwhen m = n and 1

4πεSn√

(xm−xn)2+(ym−yn)2

when m 6= n, where ∆ is the discretization in X or Y, xm and xn are the X-locations of the m and n indices, respectively, ym and yn are the Y-locations ofthe m and n indices, respectively, ε is the permittivity of the dielectric, and Snis ∆2. Now, as with the strip, I calculate the charge density array by taking[Z]−1{V0}. I then calculate the total charge, again by integrating the {α} array(taking the charge density value at each index, and multiplying by the areastep size, which is Sn). Again, as with before, I calculate the capacitance of thestructure by dividing the total charge by the test voltage applied to the square.The last thing I do, before returning everything from the function, is to createa charge density matrix, which makes the result much easier to plot than anarray does. All that must be done is correlate the indices in the [α] matrix tothose in the {α} array, and then set the values of the [α] matrix to match thoseof the {α} array at equivalent indices.

3.3 Main MATLAB Function Code

Next I will present the short section of code I wrote to actually execute thefunctions with the appropriate values and to plot the results, which can be seenin Appendix B, Subsection 3. I first create two variables that describe how manysolutions there will be of each type (metallic strip and metallic square). Thesewill be used for indexing purposes later. I then create two arrays, one for thewidths of the strips/squares, and one for the εr of the dielectrics surroundingthe strips/squares. I put into these arrays all of the combinations of W and εr

3

Page 4: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

we want to solve, from the given problem statement. I then create two cellswhich will hold the charge distribution solutions of each type that are returnedfrom the two previously described functions. After that, I run two loops thatsend all of the combinations of W and εr to the appropriate functions, getthe solutions back, and put those solutions into their appropriate places in thecharge distribution solution cells as well as a capacitance array for storing thecapacitance values. All that remains is to plot the charge distributions. Thisis the job of the two remaining for loops. These for loops display the chargedistributions on separate figures, one for the strip solutions and one for thesquare solutions, as well as make them more legible by adding appropriate axislabels, titles, capacitance values, and changing things such as color and fontsize.

3.4 GUI Creation

The last coding part of the project was the addition of a GUI to make thesolution more amenable to any requisite values of W and εr for both the stripand square. The figure file was created using GUIDE, and the code that wasassociated with the figure file can be seen in Appendix B, Subsection 4. All ofthe code basically just sets up the GUI or is a blank function that currently doesnot do anything, up until the “Simulate Button Callback” function. What thisfunction does first is poll the editable boxes for the user requested values of Wand εr. It then sends these values to the appropriate function, either the metallicstrip or metallic square, depending on which radio button the user selected.After that function sends back the charge distribution and capacitance, theprogram plots the charge distribution on the axes that are in the GUI, includingin the title such information as the requested permittivity and width (roundedto look nicer on the title), as well as capacitance. Any time the simulate buttonis pressed by the user, this whole sequence will be executed again, allowing theuser to see as many results as they wish before closing the program.

4 Results

The results from the execution of the main MATLAB function can be seen inAppendix A, Figures 1 and 2, as well as a few images of the GUI, Figures 3 and4. The charge distributions in Figures 1 and 2 looks as one would expect. Giventhat a constant voltage is applied, one would expect the majority of the chargeto be on the edges of strip and around the perimeter of the square, becauseof electrostatic repulsion. We can also see that, in both cases, the capacitancedecreases with decreasing geometric size. This is again expected, given thatthe smaller a strip or square is, the less charge per unit voltage it should beable to sustain. Also, we can see that with increased dielectric permittivity, weget increased capacitance. We can see that this should also be the expectedoutcome, by simply comparing this result to the well known analytical resultfor a parallel plate capacitor, which is C = εA

d , where C is capacitance, ε is the

4

Page 5: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

permittivity of the dielectric medium in between the plates, A is the area of theplates, and d is the separation between the plates. As with our example, thecapacitance increases with increasing dielectric permittivity.

5 Conclusions

I have thus provided a satisfactory solution to the stated problems, as well asenabled users of the GUI to solve any number of other metallic strip and metallicsquare problems with various dimensions and dielectric permittivities. Overall,I was quite pleased with how this project turned out. I arrived at the solutionsI was hoping to, and provide, what I believe to be, a very intuitive, fast, anduser-friendly GUI associated with my project. If I were to do it again, one thingI may change is to allow a user of my program to calculate the capacitance ofany given 2D geometry, so that it is more flexible. This, however, would not be asimple extension of my project, because I would have had to rewrite the metallicstrip/metallic square functions to be more generalized. I might also add moreplot options to the GUI so that the user can display more of what they desireto see, such as the electric field distribution in the dielectric. Furthermore, I’dprobably allow the user to set the discretization step, so if they wanted a higherresolution within the plot at the cost of computation time, they could selectthat. I learned a lot about the MoM during the course of this project and aboutthe creation of GUIs in MATLAB. This project certainly served its purpose andhelped develop my understanding of numerical electromagnetics.

5

Page 6: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

6 Appendix A

Figure 1

Figure 2

6

Page 7: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

Figure 3

Figure 4

7

Page 8: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

7 Appendix B

7.1 Metallic Strip Function Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Project 3 - Metallic Strip Function

% ECE 618 - Numerical Electromagnetics

% Professor Dan Jiao

% Purdue University

%

% Andrew Velzen

% 4-21-2014

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [Alpha_Vector Capacitance] = metallic_strip(width, epsilon_r)

%Define Variables

W = width; %Width of Metallic Strip (in m)

eps_r = epsilon_r; %Relative Permittivity of Dielectric Region

del_x = W/100; %Discretization Step Size in ’X’ (in m)

arr_length = W/del_x; %Length of the 2 arrays

eps_0 = 8.854*(10^(-12));

eps = eps_r*eps_0;

x_m = 0; %x-location of index m, for use later

x_n = 0; %x-location of index n, for use later

Capacitance = 0;

Total_Charge = 0;

Voltage = 1;

%Define Necessary Matrices

Z_Matrix = zeros(int64(arr_length),int64(arr_length));

Potential_Vector = ones(int64(arr_length),1); %If you use a voltage other than 1, this needs to be changed

%For convenience, we will assume the left end of the wire to be at x=0;

for m = 1:arr_length

for n =1:arr_length

x_m = (m-1+.5)*del_x;

x_n = (n-1+.5)*del_x;

if m==n

Z_Matrix(m,n) = (-del_x/(2*pi*eps))*(log(del_x/2)-1);

else

Z_Matrix(m,n) = (-del_x/(2*pi*eps))*log(abs(x_m-x_n));

end

end

end

Alpha_Vector = Z_Matrix\Potential_Vector;

%Integrating up total charge on strip

for n = 1:int64(arr_length)

Total_Charge = Total_Charge + Alpha_Vector(n)*del_x;

end

Capacitance = Total_Charge/Voltage;

disp(’The Capacitance of this metallic strip, in F/m, is: ’);

cap = num2str(Capacitance);

disp(cap);

end

8

Page 9: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

7.2 Metallic Square Function Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Project 3 - Metallic Square Function

% ECE 618 - Numerical Electromagnetics

% Professor Dan Jiao

% Purdue University

%

% Andrew Velzen

% 4-21-2014

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [Alpha_Matrix Capacitance] = metallic_square(side_length, epsilon_r)

%Define Variables

W = side_length; %Width of Metallic Square (in m)

eps_r = epsilon_r; %Relative Permittivity of Dielectric Region

del_x = W/25; %Discretization Step Size (in m)

arr_length = (W/del_x)^2; %Length of the 2 arrays

eps_0 = 8.854*(10^(-12));

eps = eps_r*eps_0;

x_m = 0; %x-location of index m, for use later

x_n = 0; %x-location of index n, for use later

Capacitance = 0;

Total_Charge = 0;

Voltage = 1;

%Define Necessary Matrices

Z_Matrix = zeros(int64(arr_length),int64(arr_length));

Potential_Vector = ones(int64(arr_length),1); %If you use a voltage other than 1, this needs to be changed

%For convenience, we will assume the left end of the wire to be at x=0;

for m = 1:arr_length

for n = 1:arr_length

x_m = (mod((m-1),sqrt(arr_length))+.5)*del_x;

y_m = (floor((m-1)/sqrt(arr_length))+.5)*del_x;

x_n = (mod((n-1),sqrt(arr_length))+.5)*del_x;

y_n = (floor((n-1)/sqrt(arr_length))+.5)*del_x;

if m==n

Z_Matrix(m,n) = log(1+sqrt(2))*del_x/(pi*eps);

else

Z_Matrix(m,n) = (1/(4*pi*eps))*(del_x*del_x)/sqrt((x_m-x_n)^2+(y_m-y_n)^2);

end

end

end

Alpha_Vector = Z_Matrix\Potential_Vector;

%Integrating up total charge on strip

for n = 1:int64(arr_length)

Total_Charge = Total_Charge + Alpha_Vector(n)*del_x*del_x;

end

Capacitance = Total_Charge/Voltage;

disp(’The Capacitance of this metallic square, in F, is: ’);

cap = num2str(Capacitance);

disp(cap);

9

Page 10: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

% Make Alpha Vector into a Matrix, rather than a vector

Alpha_Matrix = zeros(sqrt(arr_length),sqrt(arr_length));

for m = 1:sqrt(arr_length)

for n = 1:sqrt(arr_length)

Alpha_Matrix(m,n) = Alpha_Vector((m-1)*sqrt(arr_length)+n);

end

end

end

10

Page 11: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

7.3 Main MATLAB Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Project 3 - Main Code

% ECE 618 - Numerical Electromagnetics

% Professor Dan Jiao

% Purdue University

%

% Andrew Velzen

% 4/23/2014

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Creating the solutions requested in project description

Num_Solutions_Strip = 6; % Number of strip solutions requested

Num_Solutions_Square = 4; % Number of square solutions requested

Num_Solutions = Num_Solutions_Strip + Num_Solutions_Square;

width = zeros(Num_Solutions);

% Widths for strip solutions

width(1) = .01;

width(2) = .001;

width(3) = .000001;

width(4) = .01;

width(5) = .001;

width(6) = .000001;

% Widths for square solutions

width(7) = .01;

width(8) = .001;

width(9) = .01;

width(10) = .001;

eps_r = zeros(Num_Solutions);

% Epsilon_r’s for strip solutions

eps_r(1) = 1;

eps_r(2) = 1;

eps_r(3) = 1;

eps_r(4) = 4;

eps_r(5) = 4;

eps_r(6) = 4;

% Epsilon_r’s for square solutions

eps_r(7) = 1;

eps_r(8) = 1;

eps_r(9) = 4;

eps_r(10) = 4;

Strip_Charge_Distribution = cell(Num_Solutions_Strip,100);

Square_Charge_Distribution = cell(Num_Solutions_Square,10,10);

% Solutions for the strip

for i = 1:Num_Solutions_Strip

[Strip_Charge_Distribution{i}, Cap(i)] = metallic_strip(width(i),eps_r(i));

end

% Solutions for the square

for i = 1:Num_Solutions_Square

[Square_Charge_Distribution{i}, Cap(i+Num_Solutions_Strip)] = metallic_square(width(i+Num_Solutions_Strip),eps_

11

Page 12: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

end

% Plotting the results

for i = 1:Num_Solutions_Strip

subplot(2,3,i)

plot(Strip_Charge_Distribution{i},’Color’,’magenta’,’LineWidth’,1)

Title_Print = sprintf(’Strip Width %0.4g m, Relative Permittivity %1.1f \n Capacitance = %.5g F/m’,width(i),eps_r(i),

title(Title_Print,’fontsize’,14)

tick_spread = width(i)/100;

x_label_print = sprintf(’Location on Strip (in %.4g m)’, tick_spread);

xlabel(x_label_print,’fontsize’,14);

ylabel(’Charge Density (in Coulombs/m)’,’fontsize’,14);

end

figure;

for i = 1:Num_Solutions_Square

subplot(2,2,i)

surf(Square_Charge_Distribution{i});

Title_Print = sprintf(’Square Width %0.4g m, Relative Permittivity %1.1f \n Capacitance = %.5g F’,width(i+Num_Solution

title(Title_Print,’fontsize’,14)

tick_spread = width(i+Num_Solutions_Strip)/25;

x_label_print = sprintf(’X-Location on Square (in %.4g m)’, tick_spread);

xlabel(x_label_print,’fontsize’,14);

y_label_print = sprintf(’Y-Location on Square (in %.4g m)’, tick_spread);

ylabel(y_label_print,’fontsize’,14);

zlabel(’Charge Density (in Coulombs/m^2)’,’fontsize’,14);

end

12

Page 13: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

7.4 GUI Creation Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Project 3 - GUI Execution Code

% ECE 618 - Numerical Electromagnetics

% Professor Dan Jiao

% Purdue University

%

% Andrew Velzen

% 4/23/2014

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function varargout = Project_3_GUI(varargin)

gui_Singleton = 1;

gui_State = struct(’gui_Name’, mfilename, ...

’gui_Singleton’, gui_Singleton, ...

’gui_OpeningFcn’, @Project_3_GUI_OpeningFcn, ...

’gui_OutputFcn’, @Project_3_GUI_OutputFcn, ...

’gui_LayoutFcn’, [] , ...

’gui_Callback’, []);

if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1});

end

if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

else

gui_mainfcn(gui_State, varargin{:});

end

function Project_3_GUI_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);

function varargout = Project_3_GUI_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;

function eps_r_edit_box_Callback(hObject, eventdata, handles)

function eps_r_edit_box_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))

set(hObject,’BackgroundColor’,’white’);

end

function sidelength_edit_box_Callback(hObject, eventdata, handles)

function sidelength_edit_box_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))

set(hObject,’BackgroundColor’,’white’);

end

function Simulate_Button_Callback(hObject, eventdata, handles)

width = str2num(get(handles.sidelength_edit_box,’String’));

eps_r = str2num(get(handles.eps_r_edit_box,’String’));

Cap = 0;

axes(handles.axes1);

13

Page 14: METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND …€¦ · ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND PLATE IMMERSED IN ADIELECTRIC May 7, 2014 AndrewH.Velzen

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Perform the Metallic Strip Calculation

if (get(handles.Strip_Radio_Button,’Value’)==1)

Strip_Charge_Distribution = cell(1,100);

[Strip_Charge_Distribution{1}, Cap] = metallic_strip(width,eps_r);

% Plot Results

plot(Strip_Charge_Distribution{1},’Color’,’magenta’,’LineWidth’,1)

Title_Print = sprintf(’Strip Width %0.4g m, Relative Permittivity %1.1f \n Capacitance = %.5g F/m’,width,eps_r,

title(Title_Print,’fontsize’,14)

tick_spread = width/100;

x_label_print = sprintf(’Location on Strip (in %.4g m)’, tick_spread);

xlabel(x_label_print,’fontsize’,14);

ylabel(’Charge Density (in Coulombs/m)’,’fontsize’,14);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Otherwise, Perform the Metallic Square Calculation

else

Square_Charge_Distribution = cell(1,10,10);

[Square_Charge_Distribution{1}, Cap] = metallic_square(width,eps_r);

% Plot Results

surf(Square_Charge_Distribution{1});

Title_Print = sprintf(’Square Width %0.4g m, Relative Permittivity %1.1f \n Capacitance = %.5g F’,width,eps_r,Cap);

title(Title_Print,’fontsize’,14)

%tick_spread = width/25;

%x_label_print = sprintf(’X-Location on Square (in %.4g m)’, tick_spread);

%xlabel(x_label_print,’fontsize’,14);

%y_label_print = sprintf(’Y-Location on Square (in %.4g m)’, tick_spread);

%ylabel(y_label_print,’fontsize’,14);

zlabel(’Charge Density (in Coulombs/m^2)’,’fontsize’,14);

end

14