xmpl3d73, using CPO to solve for a magnetic field.

As explained in detail, the CPO programs can be used to solve Laplace's equation for a magnetostatic field, if the magnetic permeability can be assumed to be very large (and if there is no saturation in the magnetic material).

Here is an example of the procedure that can be used when the magnetic field has axial symmetry.

(1) A CPO2D data file is set up.  An example is given below (called temp2.dat) in which the electrodes are thick-walled cylinders separated by a gap of 0.5mm.

(2) A potential difference of 0.00125664 is applied across the gap.  This gap effectively simulates the gap between two pole faces.

(3) At the end of the run the option \contours\electric field\grid is accessed and the following values are entered:

rmin =  0, rmax = 0.2, number of points = 5,

zmin = -5, zmax = 5,   number of points = 201.

The spacing between the points is then 0.05 in both the r and z directions.

(4) After closing the ray output file tmpa.dat is opened and the grid data at the end of it, on the last 1005 lines, is copied into a new file \cpo3d\tempmag.dat

(5) The following 3 lines are added to the beginning of tempmag.dat:

0.  0.2   rmin, rmax

-5. 5.    zmin, zmax

1005 .05  number of points, spacing

The file tempmag.dat then has the required form for creating the magnetic field between the pole faces.

(6) A CPO3D data file is set up -in fact the present file.  It has the same geometry as the CPO2D file temp2.dat.  It calls tempmag.dat.  It calls for a user-supplied 2D incomplete grid of values  -therefore the magnetic field will be assumed to be zero for any points outside the present range (ie for r > 0.2 or z < -5 or z > 5).  Finally it multiplies the magnetic field by the scale factor 1.

(7) It can be seen from contour plots that the magnetic field has the same form as the electric field.  You can therefore use this magnetic field as the field of a magnetic lens (or for any other purpose).  You will probably want to set the electric field to zero.

The CPO2D data file (temp2.dat) used in step (1):

CPO2D data file used in first step of setting up xmpl3d75.dat

cylindrical symmetry   -cylindrical or planar symmetry?

tmp.dat name of hidden output file, for processed data

tmpa.dat  name of main output file, for ray data

n  n/p/m/a for nearlyzero/partial/most/all printing level

-1   voltage reflection symmetries in z=0 plane

2     number of different voltages

0.0001   allowed consistency error

straight electrode           1st electrode

0 -6 r and z of first end

2 -6 r and z of second end

1 1  numbers of 2 applied voltages (can be same)

35 1  number of subdivisions, type of subdivision

straight electrode           2nd electrode

touching the previous electrode

2 -0.25 r and z of second end

1 1  numbers of 2 applied voltages (can be same)

100 -2  number of subdivisions, type of subdivision

straight electrode

touching the previous electrode

1 -0.25 r and z of second end

1 1  numbers of 2 applied voltages (can be same)

368 1  number of subdivisions, type of subdivision

straight electrode

touching the previous electrode

1 -6 r and z of second end

1 1  numbers of 2 applied voltages (can be same)

200 2  number of subdivisions, type of subdivision

no more electrode information

0     1  0.5  x   final nmbr segments, nmbr steps, weight, disable overlap test

1e-07             charge inaccuracy, zero tot Q, improve matrix, space-chrg

constant applied voltages

-0.000628           1st electrode

0                   2nd electrode

n          focal properties? (y/n)

n n    no more potentials and fields along a line

no ray information

The data file tempmag.dat that is read by xmpl3d75.dat.  It has been produced by adding 3 lines before the last 1005 lines of the ray output file produced by the CPO2D data file.  Please see this in the footnotes to the data file.