METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND ECE 618 - Project3 METHOD OF MOMENTS SOLUTION...

download METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND ECE 618 - Project3 METHOD OF MOMENTS SOLUTION FORCHARGEDLINE

of 14

  • date post

    07-Jul-2020
  • Category

    Documents

  • view

    1
  • download

    0

Embed Size (px)

Transcript of METHOD OF MOMENTS SOLUTION FORCHARGEDLINE AND ECE 618 - Project3 METHOD OF MOMENTS SOLUTION...

  • 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

  • 1 Problem Statement

    The two problems which I seek to solve are as follows: “Simulate the capacitance per unit length of a metallic strip of width W immersed in a dielectric region of relative permittivity εr,” and “Simulate the capacitance of a metallic square plate 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 of Moments (MoM) to produce the solutions. I also went further, by generalizing the solution to any values of W, L, and εr. I used MATLAB to implement the solution.

    2 Approach

    How I went about solving the problem/presenting the solution in a user-friendly way, is as follows. I first wrote the MoM solution for the metallic strip case, and plotted the results of the charge distribution for the requested conditions given in the problem statement and assured that they looked reasonable. Following that, I wrote the MoM solution for the metallic square plate case. Again, I plotted and verified the requested results. I also calculated the capacitance in each case, as requested in the problem. Lastly, I developed a Graphical User 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 wrote a modular function to solve this problem, the code for which can be seen in Appendix B, Subsection 1. The function takes in the width of the strip, as well as the relative permittivity of the dielectric, and returns an array containing the charge density, in Cm , as well as the capacitance of the strip. I first define all the variables that will be used during the execution of the function. A small note on the step size in X. I decided to discretize it into 100 steps because it seemed to provide a reasonable balance between computation time, and solution resolution. I then instantiate the Z matrix and the potential array that will be used to generate the charge density array. The potential array, {V0}, is all 1’s because we are going to assume the voltage on the strip is 1V everywhere to solve the problem. The Z matrix and potential array correspond to the solution of [Z]{α} = {V0}, as discussed in class. Next, I populate the Z matrix with the 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 matrix inversion to calculate {α} = [Z]−1{V0}. After that, I found the total charge on the strip by integrating the {α} array (taking the charge density value at

    2

  • each index, and multiplying by the step size, in X). Lastly, before returning the requisite values from the function, I calculate the capacitance by dividing the total 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, I wrote a modular function to solve this problem, the code for which can be seen in Appendix B, Subsection 2. The function takes in the side length of the square, as well as the relative permittivity of the dielectric, and returns a matrix containing the charge density, in Cm2 , as well as the capacitance of the square. As with the strip, I first define all the variables that will be used during the execution of the function. Different from the strip, though, is the step size I chose to use. I discretize the domain into 25 steps in X, and 25 in Y. When I tried 100 for each side, there was a noticeable lag with the computation, so I opted for 25 instead. I also saw no reason to choose different step sizes for X and Y, given that the problem was symmetric, but, in theory, one could easily do it. I next create the Z matrix and potential array, and populated them with zeros and ones, respectively. I then iterate through the Z matrix, finding the corresponding X and Y coordinates at the center of the grid square at each location. After finding those coordinates, I then populate the Z matrix with the

    following values for Zmn: ln(1+

    √ 2)∆

    πε when m = n and 14πε

    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 of the m and n indices, respectively, ε is the permittivity of the dielectric, and Sn is ∆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 area step size, which is Sn). Again, as with before, I calculate the capacitance of the structure 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 create a charge density matrix, which makes the result much easier to plot than an array does. All that must be done is correlate the indices in the [α] matrix to those in the {α} array, and then set the values of the [α] matrix to match those of 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 the functions with the appropriate values and to plot the results, which can be seen in Appendix B, Subsection 3. I first create two variables that describe how many solutions there will be of each type (metallic strip and metallic square). These will be used for indexing purposes later. I then create two arrays, one for the widths of the strips/squares, and one for the εr of the dielectrics surrounding the strips/squares. I put into these arrays all of the combinations of W and εr

    3

  • we want to solve, from the given problem statement. I then create two cells which will hold the charge distribution solutions of each type that are returned from the two previously described functions. After that, I run two loops that send all of the combinations of W and εr to the appropriate functions, get the solutions back, and put those solutions into their appropriate places in the charge distribution solution cells as well as a capacitance array for storing the capacitance values. All that remains is to plot the charge distributions. This is the job of the two remaining for loops. These for loops display the charge distributions on separate figures, one for the strip solutions and one for the square solutions, as well as make them more legible by adding appropriate axis labels, titles, capacitance values, and changing things such as color and font size.

    3.4 GUI Creation

    The last coding part of the project was the addition of a GUI to make the solution more amenable to any requisite values of W and εr for both the strip and square. The figure file was created using GUIDE, and the code that was associated with the figure file can be seen in Appendix B, Subsection 4. All of the code basically just sets up the GUI or is a blank function that currently does not do anything, up until the “Simulate Button Callback” function. What this function does first is poll the editable boxes for the user requested values of W and εr. It then sends these values to the appropriate function, either the metallic strip or metallic square, depending on which radio button the user selected. After that function sends back the charge distribution and capacitance, the program plots the charge distribution on the axes that are in the GUI, including in the title such information as the requested permittivity and width (rounded to look nicer on the title), as well as capacitance. Any time the simulate button is pressed by the user, this whole sequence will be executed again, allowing the user 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 in Appendix A, Figures 1 and 2, as well as a few images of the GUI, Figures 3 and 4. The charge distributions in Figures 1 and 2 looks as one would expect. Given that a constant voltage is applied, one would expect the majority of the charge to be on the edges of strip and around the perimeter of the square, because of electrostatic repulsion. We can also see that, in both cases, the capacitance decreases with decreasing geometric size. This is again expected, given that the smaller a strip or square is, the less charge per unit voltage it should be able to sustain. Also, we can see that with increased dielectric permittivity, we get increased capacitance. We can see that this should also be the expected outcome, by simply comparing this result to the well known analytical result for a parallel plate capacitor, which is C = εAd , where C is capacitance, ε is the

    4

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

    5 Conclusions

    I have thus provided a satisfactory solution to the stated problems, as well as enabled users of the GUI to solve any number of other metallic strip and metallic square problems with various dimensions