Computer Project (20%): Numerical Solution to Laplace's Equation

EE 4301: Electromagnetic Engineering

Professor D. L. MacFarlane

Assigned 9/15/03 Due 11/25/03 (last class)

Introduction


In class we derived the wave equation for the scalar potential (voltage field), V:


 


If we have no time variation in our problem then this wave equation reduces (simplifies) to Poisson's Eq,

 

In a charge free region (at points with no charge), this equation becomes unforced (Laplace's Eq.)


Solving this equation subject to boundary conditions and a given geometry gives the static voltage distribution at all points in space. It is a common task to solve Laplace's equation for a given geometry in order to model the performance of some device under development. Often, this solution must be obtained numerically, because an analytic solution may be too cumbersome.

Write a computer program in any language (for examples: C, Pascal, Fortran, Mathcad, Excel, or Matlab) to solve for the voltage at all points inside the 2--D geometry described below. 

Numerical Procedure

The numerical technique for solving this partial differential equation may be found in a variety of books[1], but it is simple enough to be sketched here. First overlay a grid (like graph paper) on top of the geometry. Call the spacing of the grid, "h" (a small number). We want to find the voltage at all the points on the grid. If we know what the voltage is at some point (x,y), then we can estimate what the voltage will be at (x+h,y) by expanding  in a Taylor's series:

 


Similarly,


Adding these two equations, and rearranging, yields,



The second partial derivative in the y direction may be approximated in a similar manner,

 

Recall that Laplace's equation in 2--D is


Substituting the approximations into this equation gives,


This is the equation that needs to be coded. I interprete this equation to say that the voltage at a point is an average of its nearest neighbors.

Start from the known boundary conditions, and update all the points in the grid (a matrix) by applying this formula. One pass through the matrix will not be enough, so continue to iterate through the grid, until there is little change in the calculated voltages. Also, h must be picked small enough so that further reductions in h do not change the numbers finally generated; there must be enough points to adequately sample the voltage distribution.

The Problem:

Find the voltage and Electric field between two electrodes that are the shapes of the letters of your initials. For example, if I were doing this one electrode would be shaped like a “D” and the other like an “M”. I might also do some runs with a third electrode shaped like an “L”.

Your job is to study the electrostatics of the electrodes and numerically find the functional dependences of the design parameters. What are the voltage fields and the electric fields produced for different design choices?

First assume a specific geometry and guess at the voltages on the components. Then code the program to find the voltage distribution everywhere in the region of th electrodes.

After the initial run, see what happens as you change the various voltages and dimensions (size of letters, distance between the letters, etc). Try to structure these runs into a systematic process. How can you organize you trials/thinking into a structured exploration that teaches you how the structure affects the field strengths?

Deliverables

Turn in your code, and your results in a readily understandable manner (pay attention to the presentation of the data ... a set of contour plots would be nice, but is not necessary). Write up an analysis of your results giving your interpretation.

I would like to see various plots of the voltage field and the electric field for different geometrical situations. Also provide summary plots relating key parameters. For example, how does Emax vary with the different runs?

Discuss the error involved in your estimate; how precise are your results. Does precision or accuracy depend on the number of grid points (the size of h)? Can you be sure you have iterated the algorithm enough times?

I purposely picked an unstructured, ambiguous problem to make this more fun for you, to bring out your creativity and curiosity. I cannot stress enough, that I will look very favorably on originality of thought and interpretation.



[1] Try Ramo, Whinnery and van Duzer, Fields and Waves in Communication Electronics section 7.3; or, Press, Flannery, Teukolsky and Vetterling, Numerical Recipes