Test2d03, 3rd 'benchmark test' data file for CPO2D
Parabolic motion in uniform field
In this test a uniform electric field is set up between two circular discs. Examples of calculated potentials and fields are given. Two rays are traced, both of which should be parabolic. The coordinates of the first ray are recorded when it crosses a 'test plane' and again when it hits an electrode. At the test plane z should maximise at 0.5 and the energy should be 0.5 eV. In fact the calculated maximum z is 0.49995 and the energy is 0.4999. The errors are consistent with the requested ray inaccuracy of 0.05%. The second ray shows how the program deals with reflections, reducing the step lengths when the ray is near the reflection point.
The number of segments used in the present example is small enough for the example to be run with the ‘demo’ version of CPO2D. Higher accuracy could of course be obtained with more segments, using the standard or full versions of CPO2D.
The following data were obtained 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 uniform electric field is set up between 2 discs at either end of a cylinder. The left-hand disc is at z = -1 with V = 1, while the right-hand disc is at z = 1 with V = -1. The potential of the enclosing cylinder varies linearly from V = 1 at z = -1 to V = -1 at z = 1. The z = 0 plane is taken as a plane of negative reflection symmetry for the voltages, and a total of 40 segments are used (before the reflection in the z = 0 plane). The requested inaccuracy of the boundary charges is 0.0001 and the time to compute them is very short.
The first information that appears on the screen consists of potentials and fields along the lines specified in the data file. The potentials and fields are correct to within the requested inaccuracy of 0.1%, except for the fields at the faces of the electrodes (which are indefinite). The potentials and fields in the region of the corners have larger errors, for the reasons explained in the note potentials, fields and contours near to boundaries. As explained in there, these errors are easily reduced either by making the segments near the corners shorter or by adding extra short lengths of electrodes that touch the corners and lie outside the square, but in practice this would be necessary only if (exceptionally) electrons travel in this region.
The first ray is that of an electron which starts with a kinetic energy of 1 eV at x = -0.5, z = 0. It starts at 45 degrees to the x and z axes. The path of the electron should be the parabola z = 0.5 - 0.5*(x-0.5)**2. Therefore at the test plane x = 0.5, z should maximise at 0.5 and the energy should be 0.5 eV.
In fact the calculated maximum z (see the end of the output file tmp3a.dat) is 0.49995 and the energy is 0.4999. The errors are therefore approximately 0.01% and 0.02% respectively, and so are consistent with the requested ray inaccuracy of 0.05%. The number N of segments (40 in the present example) also affects the accuracy of the final value of z. We find empirically that for the present simulation the fractional error of z is of the order of 0.1/N**2 (giving an error of the order of 0.01% for N = 40).
The direct method is used here. Using the mesh method gives approximately the same accuracy in a shorter time, with a mesh spacing as high as 0.4, but this is not a realistic comparison for this example because the field is uniform.
A second ray is started with a kinetic energy of 1.0025 eV at x=0.0, z=-0.5, with direction cosines proportional to 0.05, 1.0. It lies close to the z direction and is reflected almost normally at z = 0.5. It should cross the plane z = -0.5 (the second test plane) at 0.2. In fact it crosses at 0.20004.
The reason for adding this ray is to show how the program deals with reflected rays. Inspecting the output file, it can be seen that the step lengths are reduced (as far as 0.1*dlmax in this example) when the ray is near the reflection point, to give a more accurate result and also to give a smoother plot.