EX 5: Laplace's Equation

Py 200 Announcements

Programming Project

Project due March 31.

Write a program to solve Laplace's equation on a grid. Use the relaxation method discussed in class. Assume a square grid of 25 by 25 with the boundary surfaces at zero potential.

Problem: Simplest form

Hard code a capacitor near the center of the grid with potentials of + and - 100 V. Solve the problem using the relaxation method. Plot the new potential after every matrix update.

Problem: Representation of data

Add options that allows the user to view the data either as a contour plot or a three dimensional surface plot.

Problem: Data Input

Add an input mode where the user can draw a conductor on the screen using a mouse. A slider at the bottom of the screen can be used to set the potential for what is being drawn. Use the progam LIFE.PAS as an example of how to use the mouse for data input.

Problem: Documentation

Add documentatiomn and an About box to the main menu.

Problem: Calculation Method (Not for everyone)

Look up the method of over relaxation to speed up the calculation.

Problem: Transformation of Data (Not for everyone)

The potential that is calculated through Laplace's equation is not the whole story. It is possible to obtain the field from this potential by looking at the gradient. Calculate the gradient at every interior point and draw a vector on the screen to represent this gradient.

Do one change at a time and make sure it works before you go on to the next change. Start early.