Section 3.2 of the User's Guide for CPO2D and CPO3D

(or proceed to section 3.3)

Recommended strategy

The first part of the recommended strategy:

For a completely new simulation start by setting all the relevant parameters to give a high inaccuracy (that is, a low accuracy), as far as you can judge.

These parameters will include:

(1) the total number of segments into which the electrodes are subdivided, and might also include:

(2) the fractional inaccuracy of the ray tracing,

(3) the mesh spacing, if the 'mesh' method is being used, and

(4) the maximum step length or time for the ray tracing.

Further parameters will be involved for space-charge and cathode simulations.

The values of these 'accuracy parameters' should be such that the computing time is short, preferably less than a minute.

The user might feel apprehensive in seeing the simulation modelled crudely in a small number of segments and with a low accuracy of calculation (although nobody else need see this model!) More importantly, the user does not know at the beginning of a new simulation where high accuracy will be most needed -for example which electrodes should have the smallest subdivisions.

The second part of the recommended strategy:

Select some 'target parameter' and note how it changes when each relevant 'accuracy parameter' is changed in turn by a factor of about 2 to 5.

The 'target parameter' might be a potential or field or final ray coordinate. The 'accuracy parameters' might include

(1) the total number of segments, which can be increased in steps by a factor of about 2, or

(2) an inaccuracy level, which can be decreased in steps by a factor of about 5.

Another accuracy parameter might be the relative numbers of segments on different electrodes.

Here is an example, taken from the first 'benchmark' test for CPO2D, the spherical deflection analyzer. In this example the computing time is very short because the simulation is simple. We also know the correct answers in advance, but less us pretend that it represents a more complicated simulation and that we do not know the correct result, and let us pretend also that the computing times are some orders of magnitude longer, so that we have to be careful about using too many segments or very low inaccuracy levels.

As the 'target parameter' we take the radial distance s of the median ray from the centre after a rotation of 180. The 'accuracy parameters' are:

n1 the number of segments for the inner sphere,

n2 the number of segments for the outer sphere,

dlm the maximum step length, and

acc_ray the ray inaccuracy.

We can start with n1 and n2 proportional to the radii of the spheres (as recommended elsewhere) and for the other parameters we start with values that give a short computing time (in this example extremely short). We then improve each of the parameters in turn, choosing a series of values and looking all the time at the behaviour of the target parameter s. This shows the value to which s seems to be converging, and gives a feel for the importance (or unimportance) of the various parameters. We are then in a position to choose a new set of parameters that give a longer computing time (but not too long) and repeat the procedure. The way in which s converges to an asymptotic value gives a feel for the magnitude of the error in the final value of s.

As well as establishing the result and its estimated error we also know from this procedure that the accuracy has been achieved with the minimum computing time. In fact for the present simulation, the spherical deflection analyzer, the computing time is very short (and if we had been seriously interested in this particular simulation we would obviously have started with more segments and a greater accuracy), but the time for most practical simulations would usually be significantly longer and so it would be important to start with a small number of segments and low accuracy.

We would now be in a position to start with some confidence on a 'production run' -that is, a more comprehensive study, using for example a large number of different initial ray conditions and applied potentials. The time spent on following the optimisation procedure will probably be only a small fraction of the total time of the production runs -and so will be time well spent.

We strongly advocate this procedure, or some similar procedure to suit the particular simulation in hand. It might seem unnecessary to the new user, but it gives a good understanding of the sensitivity of the final result to the various accuracy parameters. Equally importantly, it saves time by avoiding the long computing times -sometimes orders of magnitude too long- that can occur when too many segments are used or when the step length or time is too small or when the other parameters are much too small for the inaccuracy of the final result. For example, how many new users would have expected that an overall inaccuracy of 0.03% can be obtained with only 64 segments?

For detailed, complicated geometries the user might fell uncomfortable in deliberately using a small number of segments (and uncomfortable also in using a low ray accuracy), but this is usually a way of quickly and reliably exploring a simulation before the final accurate results are produced. So we advocate that low accuracies should be used for as long as possible when solving a complicated new simulation. The basic qualitative properties of the system are usually given quite well, even when the electrodes are only crudely modelled (for example with 3D cylinders that have a hexagonal section). For the final results the accuracy parameters are traditionally chosen so that the run lasts overnight, but it is a mistake to use this accuracy for the exploratory runs.

The third part of the strategy:

Use the techniques described in the next section to extrapolate the number of segments to infinity and to extrapolate the various other inaccuracy parameters to zero.

This part of a solution does not take much extra time. Better final results are usually obtained and the errors in these results are established quantitatively.

There is some overlap between the above material and that in the note on optimising the accuracy, which you might also like to read.

(proceed to next section)