Homework Help: Electrodes on a Grid in Fortran 77

1. Oct 31, 2008

hetaeros

1. Question Statement:
Create a 40 mm by 40 mm two-dimensional grid centered on point (0,0) (grid size 1mm by 1mm so the grid is 41 points by 41 points). On this grid, put four circular electrodes, one centered on each corner, each with radius 15 mm. Fix the electrodes on the upper left and bottom right corners to +10 Volts and the electrodes on the upper right and lower left corners to -10 Volts. Find the potential at all other points on the grid. Create a file with the resulting potentials for the grid points and plot the resulting potential distribution on a two-dimensional color plot or contour plot.

2. Equations Used:
Here, I assumed that since they were of uniform charge, the electrodes would radiate their charge in all directions uniformly and superposition would be applicable. Thus, the electric potential at a point (x,y) would be:

$$\phi$$=k(Q1/r1+Q2/r2+Q3/r3+Q4/r4)

where r is defined as a scalar distance such that r=$$\sqrt{x^{2}+y^{2}}$$-$$\sqrt{electrode center}$$-15 (due to radius).

I'm a little uncomfortable with this equation, since I'm treating the electrode like a point charge, so if I'm wrong in asserting so, please let me know!

3. Attempt:
Given my poor understanding of how grids work in Fortran, this is as far as I can get. I can call a real array with dimensions 41x41, but I have no idea how to index them like a Cartesian grid, centered at (0,0)--which I can only assume is (20,20). Does this require a DO-Loop, setting the first element as (-20,20)?

The second question I have is the heuristics behind my solution. Is the expression I use for the electric potential a valid one? Or would it be easier to create another array for the electric field and then use Poisson's equation? (A proposed method of doing this: create the grid array, use the grid array to create the electrode array, then the field array, then the potential array) Would that be too inefficient?

Are there any symmetries that can help make this problem simpler? (a diagonal cut from one vertex to the opposite across looks promising, except, once again, not knowing how grids work in Fortran, I would have trouble finding a way to use this to my advantage.