Chapter 4 of User's Guide for CPO2D and CPO3D

 

(or proceed to chapter 5)

 

Troubleshooting

 

The CPO programs have a comprehensive set of 'traps' and tests, so that informative messages almost always appear when something goes wrong. But if an uninformative box appears, with a message such as 'Salford run time error', refer to the note on 'crashing'.

 

Problems are often clarified by using the 'all' option for the printing levels, which causes a comprehensive set of warnings and advice to appears on the screen and in the output data file.

Some problems can be solved by deleting the processed data file.

 

First, in version 8, which allows up to 8000 segments to be used, the programs can create very large files to store the inverse matrix for space-charge iterations. These files have the ending ‘.yyy’. They must be deleted regularly.

 

The main headings below are:

The calculated potential or field distributions seem to be wrong.

The ray tracings seem to be too inaccurate.

The ray tracings seem to be too slow.

Ray tracing problems when space-charge is in use.

Focus iterations are not converging to a sensible result.

A cathode calculation is not converging or seems to be wrong.

The calculations have become slow, or there are long delays when options such as zoom are operated.

3D view opens slowly.

The geometry has been changed.

  

 

The calculated potential or field distributions seem to be wrong:

 

The cause could be: 

(1) An electrode has not been subdivided appropriately, perhaps at a free end, or the 3D segments are too long and thin (see the note on choosing shapes of 3D triangles and rectangles).

(2) Two electrodes at different potentials touch each other, which would cause the charges near the touching point to be very large and the results would then be inaccurate (usually very inaccurate).

(3) Two electrodes at different potentials are near to each other, which would again cause the charges in this region to be very large, but which can often be avoided by bridging the gap with an extra electrode whose potential changes linearly in the z direction.

(4) The 'zero charge' option has been disabled, which can affect the potentials and fields inside a system of electrodes.

(5) On the other hand, if potentials or fields are being sampled outside a system of electrodes then the 'zero charge' option should be disabled, otherwise the outer potential will tend to a non-zero constant and the outer field will be zero or small.

(6) The electrodes in the region of interest have not been divided into a large enough number of segments.

(7) There are enough segments surrounding a critical region but in the same vicinity there are also some large segments that cause a less accurate potential that extends over about twice their size.

(8) There are some electrodes at a high potential (for example an anode at 100kV) but the potentials in a region of low potential (for example near a cathode) are inaccurate. This can happen when the chosen inaccuracy is not small enough, because the errors are of the order of the highest voltage times the chosen inaccuracy. Comment: This does not necessarily affect the ray tracing, because all the potentials in the cathode region are usually wrong by the same amount.

(9) The potentials at the middle points of the segments are not exactly equal to the applied potentials, which appears to disagree with the principle of the Boundary Element Method, as described in chapter 1. This can happen when the inaccuracy chosen for the potentials is not the same as the inaccuracy used by the program for calculating the charges (that is, the minimum inaccuracy, at present 0.000001).

 

 

The ray tracings seem to be too inaccurate:

 

Possible reasons are (in approximate order of frequency of occurrence):

(1) The rays are started at or near an electrode (this must be avoided because the fields there can be less accurate).   If started on an electrode the best place is the middle, as used by some of the beam source options.

(2) The surface charges on the segments have not been calculated accurately enough.

(3) There are too few boundary segments (particularly in regions near to the rays).

(4) There are enough segments surrounding a critical region but in the same vicinity there are also some large segments that cause a less accurate potential that extends over about twice their size.

(5) The system is not enclosed by extra electrodes (important if rays exist in a region outside the main electrodes, in which case the 'zero charge' option must be disabled).

(6) The choice of 'initial step length or time' is too large, which might cause the following unwanted effects to occur:

(a) the first part of the ray might appear on the screen as a linear portion,

(b) the ray might 'jump' over a region in which the field changes quickly, giving an inaccurate tracing.

(7) The choice of 'maximum step length or time' is too large, which might cause the following unwanted effects to occur:

(a) the rays might appear on the screen as non-smooth, made up of piecewise linear portions (even with the interpolation points). If it is important to have smooth plots, reduce the maximum step length or time. Do not decrease the ray inaccuracy, so that the program automatically reduces the step length or time, because this could give a large increase in the tracing time,

(b) the crossing conditions at the test planes might become inaccurate because the interpolations used to find the conditions are over a large distance,

(c) the rays might 'jump' over regions in which the fields change quickly, giving an inaccurate tracing,

(d) if rays are reflected sharply the tracings might be inaccurate.

(8) The 'ray fractional inaccuracy' is not small enough.

(9) The rays and the electrodes have different reflection symmetries.

(10) The ray passes near to or goes through an electrode, and the tracing 'jumps' through this critical region because the maximum step length or time is too long.

(11) The mesh method of ray tracing is being used and a ray passes near to or goes through an electrode, in which case the mesh points used to calculate a field might lie on the surface of the electrode (where the field is indeterminate) or might straddle the electrode.



The ray tracings seem to be too slow:

 

If the ray tracings seem to be too slow the usual reason is that the step length or time is too small for the required level of inaccuracy. New users sometimes make it very much too small!. Step lengths or times that are too short which would increase the computing time unnecessarily, without improving the accuracy, because a large number of evaluation points (not to be confused with the number of interpolated points) is used inside each step.  With short step lengths and a large number of evaluation points inside each one, the total number of evaluation points can become extremely large!

 

Other possible reasons are:

(1) The requested ray inaccuracy is too small for the required inaccuracy of the final results. This would increase the computing time at each step, perhaps quite severely if the ray passes near to an electrode. A higher ray accuracy implies a longer computing time.

(2) A large number of rays is being traced but the mesh method is not being used.

(3) The mesh method is being used but:

the mesh spacing is too small for the required level of inaccuracy, or

the first set of rays (before reflections) is not confined to the smallest possible sector (eg if x=0 and z=0 are reflection planes in a planar simulation, confine to the region of positive x and z). Otherwise unnecessary mesh points will be created, slowing down the calculation.

(4) There are too many segments for the required inaccuracy.

(5) The calculations are slower than they used to be (and perhaps there are also long delays when options such as zoom are operated): This is usually caused by the available memory space being inconveniently located. This is easily solved by defragmenting the memory, using a ‘defrag’ icon. Before doing that all unnecessary files should be deleted, such as old data files and their associated processed data, output data and binary data files (the binary files in particular can be very long).

(6) The rays are started at or near an electrode (this must be avoided because the fields there can be less accurate).

 

Advice on a procedure for choosing the appropriate values of the above parameters is given in HELP!.

 

An easy way to reduce the computing time (usually by more than a factor of 2) is to minimise the graphics box on the screen during the time of tracing (or hide it with the edit or information boxes).



Ray tracing problems when space-charge is in use.


The above points still apply, but there are additional ones for rays in space-charge.

 

 

Focus iterations are not converging to a sensible result:

 

Possible reasons are:

 

(1) The 'maximum distance' is inappropriate.

(2) The voltage or angle constraints are inappropriate.

(3) The penalty factors are to large.

 

 

A cathode calculation is not converging or seems to be wrong.

 

For more detailed note see cathode troubleshooting.

 

Possible reasons are:

 

(1) The currents and other parameters oscillate because the damping factor is not large enough.

(2) The cathode is not as specified because the program has changed the number of segments of an electrode.

(3) The rays will not start because either the specified maximum current per unit area is too large or the rays do not cross the first test plane.

(4) The initial conditions seem to be wrong because either the 'ray fractional inaccuracy' is not small enough, or the anode voltage is very large compared with the potential differences near the cathode and the 'zero charge' option has not been disabled, or the cathode depth 'd' is too small.

(5) The behaviour of rays near to the axis is important, but the direct method of ray tracing is being used instead of the mesh method (the mesh method is usually better here).

 

Finally, remember that it is very important to experiment with parameters for cathode iterations.

 

The calculations have become slow, or there are long delays when options such as zoom are operated:

 

This is usually caused by the available memory space being inconveniently located. This is easily solved by defragmenting the memory, using a ‘defrag’ icon. Before doing that all unnecessary files should be deleted, such as old input and output data (the binary output files, such as those ending in .yyy, in particular can be very long).

 

When the number of segments, N, is high the program can take a long time to invert the main matrix (for example approximately 5hrs when N = 8000 with a 32-bit, 2.2 GHz, Vista computer). The time taken to invert a matrix of dimension N*N should go as N^3 (see Numerical Recipes, by W. H. Press et al, Cambridge University Press, 1992) but in practice in the CPO programs the exponent seems to be somewhat higher.

 

 

3D view opens slowly.


See note on 3D display.



The geometry has been changed.


When electrodes are curved an inscribing correction is usually automatically enabled in CPO2D and is initially enabled in CPO3D when it is allowed to be so, since the field accuracy is also always improved for curved electrodes.  This correction increases the sizes of the electrodes slightly.  It can be disabled.



(proceed to chapter 5)