xmpl3d47, 47th 'example' data file for CPO3D
The file was written when the memory and speed of PC's was much more limited than at present, so the available number of segments was small and the requested inaccuracies were fairly high to give a quick demonstration.
A simple lens, with an axial magnetic field Bz given by the Glaser formula:
Bz = B0/(1 + (z/w)**2)
with B0 = 0.01 Tesla, w = 10mm.
The focal length is then given by
f = w/sin(pi/sqrt(1+K))
K = e*(w*B0)**2/(8*m*V)
and where eV is the electron energy, taken here as 1000eV. Therefore
f = 34.153mm.
The '2D grid' option is used here for the magnetic field. The grid of field components is held in the file tempres.dat, reproduced below.
This file has been generated by using a modification of the program given as appendix 2 of cpo3d.dat. The axial field is calculated using the above formula and then the program is used to generate the off-axis components.
Other methods could also be used -for example a user-produced program for the field.
A cylinder is used to indicate the position of the centre of the field.
It can be seen from the ray plots that aberrations are present in this example, but that the inner rays cross the axis at approximately the expected position. But this is only an approximate calculation and the focal point is not in a field-free region.
The data file tempres.dat, that holds the field components and is called by the program, is reproduced at the end of the data file.