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

(or proceed to section 3.2)

Strategy to follow if a study has already been started

In principle the 'recommended strategy' described in section 3.2 of the Guide should be followed at the beginning of a study, but it has to be acknowledged that most of our own students (and perhaps some of our more professional users) do not read this before they start, so here we describe a strategy to follow when a study is already underway.

You will therefore be reading this section if you have set up the simulation in what appears to be a sensible way but you are not getting the accuracy and/or speed that you expect.

You have seen the accuracies achieved in the test and example files, and so know that the program is capable of solving your problem.

You are using the lowest possible inaccuracies.

You are using the largest possible number of segments.

And yet YOU ARE STILL NOT GETTING THE RESULTS THAT YOU WANT!

Or you have seen the short computing times achieved in the test and example files, and so know that the program should be capable of solving your problem more quickly, BUT THE COMPUTING TIME IS TOO LONG!

WHAT TO DO?

You are in a hurry, and you want the most accurate possible results with the minimum computing time and of course the minimum of effort!.

You are in good company! Many users of the program have found themselves in this position (even the author of the program on some occasions!). But you can escape from this difficulty, without much extra work, and can get an accurate result with a good error estimate.

In principle you should read section 3.2 and start again, but you have already invested a lot of time in trying to solve the problem.

Here is a strategy that will help you:

(1) Identify some critical final parameter, such as the potential at some point or an end coordinate of a ray.

(2) Make a note of the present value of this final parameter.

(3) Choose an input parameter that probably has a relatively small effect on the final result and that can be changed to REDUCE THE ACCURACY. Examples of input parameters that are often suitable are

(a) the number of subdivisions of a non-critical electrode,

(b) the number of subdivisions in the azimuthalazim direction (that is, around the axis) for a set of cylinders in a 3-dimensional system,

(c) the ray inaccuracy,

(d) the maximum step length or time, or

(e) the number of rays

(4) Run the program again for 2 or 3 values of this initial parameter, changing it in large steps while keeping all the other input parameters unchanged, and plot a graph of the final parameter versus the initial parameter. One point on this graph is of course the result that you started with. If the initial parameter is an integer N then it is usually best to plot against 1/N or (1/N) squared. If the initial parameter is the number of segments then try to change it by factors of 4, or if that is not possible, factors of 2. Extrapolate, if possible, to a perfect accuracy for this input parameter, for example to 1/N = 0. Make a note of the difference between the extrapolated value of the final parameter and the value that you started with. You might feel at this stage that the input parameter can be permanently changed to give a faster running time, without significantly affecting the final accuracy.

(5) Repeat this procedure for other initial input parameters, including those that you think will have a relatively large effect. You might find that some of these can be relaxed to give a faster running time, while others need to be improved to achieve the required accuracy.

You will probably conclude that you

(1) need more segments in critical regions,

(2) can considerably reduce the numbers of segments elsewhere,

(3) can use a larger ray inaccuracy,

(4) can use longer step lengths or times (sometimes much longer), and

(5) can use fewer rays.

Equally importantly you will probably now have

(a) an estimate of the result extrapolated to a perfect accuracy, and

(b) an estimate of the error in the extrapolated result.

WHAT MORE COULD YOU WANT!

But perhaps the simulation is of a different nature, for example involving space-charge or cathodes. Again the relevant test and example files give reassurance that difficult simulations can be solved with good accuracy, so in this case look carefully at the footnotes of those files.