CODE 1: This is after I first adjusted the code. I changed the boundary conditions so that they more accurately reflect the actual problem.

``` PRO relax2
phi = fltarr(11,11)
itype=intarr(11,11) ; initialized to zero (don't calculate).
dphi = 1.
niter =20
string1=''
itype(1:9,1:9) = 1 ; 1 means calculate for this point.
itype(0,*) = 0 ; Start border
itype(*,0) = 0 ; *
itype(*,10) = 0 ; *
itype(10,*) =0 ; End border
itype(3:7,1:2) = 0 ; Lower polepiece.
itype(3:7,8:9) = 0 ; Upper polepiece.
phi(3:7,8:10) = 5.  ; Upper polepiece at 5 StatMagVolts
phi(3:7,0:2) = -5.  ; Lower polepiece at - 5 StatMagVolts
phi(2,10) = 4.375 ; Left boundary varying bet'n 5 and -5V.
phi(1,10) = 3.750
phi(0,10) = 3.125
phi(0,9) = 2.500
phi(0,8) = 1.875
phi(0,7) = 1.250
phi(0,6) = 0.625
phi(0,5) = 0.
phi(0,4) = -0.625
phi(0,3) = -1.250
phi(0,2) = -1.875
phi(0,1) = -2.500
phi(0,0) = -3.125
phi(1,0) = -3.750
phi(2,0) = -4.375
phi(8,10) = 4.375 ; Right boundary varying bet'n 5 and -5V.
phi(9,10) =3.750
phi(10,10) = 3.125
phi(10,9) = 2.500
phi(10,8) = 1.875
phi(10,7) = 1.250
phi(10,6) = 0.625
phi(10,5) = 0.
phi(10,4) = -0.625
phi(10,3) = -1.250
phi(10,2) = -1.875
phi(10,1) = -2.500
phi(10,0) = -3.125
phi(9,0) = -3.750
phi(8,0) = -4.375
FOR iter = 0,niter-1 DO BEGIN
FOR i=0,10 DO BEGIN
FOR j=0,10 DO BEGIN
IF itype(i,j) eq 1 THEN phi(i,j) = \$
(phi(i-1,j) + phi(i+1,j) + \$
phi(i,j-1) + phi(i,j+1))/4.
ENDFOR
ENDFOR
;  IF (iter mod 10) eq 0 THEN BEGIN
;try fill as opposed to follow
IF (iter mod 1) eq 0 THEN BEGIN
contour,phi,/follow, \$
levels=[0.001,findgen(10)+1.]
bycen = phi(5,6)-phi(5,5)
byside = phi(4,6) - phi(4,5);
print,'bycen, byside, non-uniformity = ', \$
bycen,byside, abs(byside-bycen)/bycen