Choosing the step length or time.

The rays are traced in steps. To help in controlling the accuracy and computing time the user is asked to specify the lengths or times (that is, durations) of the steps. Small steps can give higher accuracy but also give longer computing times and vice-versa.

The first choice that the user makes is to control either the lengths of the steps (in mm) or their times (in ms). The usual choice is to control the step lengths. When the applied voltages are time-dependent it might be advisable to control the step times.

The user is then asked to specify the maximum step length or time, and the number of interpolated points.

Important: the 'step length' is not a differentiation or integration length for solving the equations of motion.

The library routine that solves the equations of motion puts a large number of evaluation points (see below) inside each step. Therefore if the step lengths or times are short the total number of evaluation points can become extremely large. The evaluation points, which are outside the control of the user, should not be confused with the interpolated points, which serve a different purpose and are specified by the user.

The 'step lengths or times' should therefore NOT BE MADE VERY SHORT -this would not improve the accuracy of the final result but it would make the computing time very long. On the other hand the step lengths or times should not be so long that there is a danger that important regions might be jumped over (see below). Typically the 'maximum step length' is of the order of (total ray length)/20.

This note has information on:

Maximum step length or time

Choice of maximum step length or time

Automatic changes to step lengths

(a) At a mirror or a region of strong acceleration or retardation

(b) At cathodes

(c) Generally

There is an advanced option for having a variable maximum step length.  This can be used for example when it is important to start a trajectory with a small ‘initial step length’.

The 'maximum step length or time' is the maximum length of any step.

The user should take some care in specifying it. In the Bulirsch-Stoer method used to trace rays the length of a given step is subdivided as many times as is necessary to achieve the requested inaccuracy (which will be entered in the next line, see the note on ray tracing accuracy). However, with a long step the Bulirsch-Stoer method might misjudge the situation -it might deduce from the first subdivisions that the electrostatic field is smooth and well behaved along the whole length of the step, perhaps overlooking a part of the field that it has not sampled but in which the field changes sharply.

The first step is often in a particularly important region in which the conditions change quickly. The program therefore automatically reduces the maximum step length there, by a factor of 4. If the user wants a different initial step length then the option to vary the step lengths is available. One reason for limiting the length of the step (and the next few steps) is to avoid the possibility of the program jumping over the region. When a convex cathode is being studied the initial step length is determined by the program, but a 'dummy' value needs to be entered.

In regions where the magnetic field dominates the option for ‘nearly helical motion’ can be used.

Choice of maximum step length or time:

The 'maximum step length or time' entered here often influences the final overall accuracy, and so should be CHOSEN CAREFULLY by exploring different values of it, in combination with different values of the ray fractional inaccuracy that will be entered on the next line. An actual step length or time might occasionally be larger than the stipulated maximum step length or time if the particle is accelerating strongly.

WARNINGS:

If your choice of 'maximum step length or time' is too large, then some unwanted effects can occur:

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

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

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

(4) If rays are reflected sharply the tracings might be inaccurate. If your choice of 'initial step length or time' is too large, then the first part of the ray might appear on the screen as a linear portion.

Automatic changes to step lengths or times:

(a) At a mirror or a region of strong acceleration or retardation

When a ray is reflected by a retarding field the program reduces the step length or time in the region of the reflection point, but the step length or time is not usually reduced below one tenth of the 'maximum step length or time'. An example is given in test2d03. The same type of reduction is applied in any regions of strong acceleration or retardation. The amount of the reduction depends on the requested inaccuracy.

(b) At cathodes

When a convex cathode is being studied the initial step length is determined by the program, but a 'dummy' value needs to be entered.

For a flat or concave cathode the initial step length is used for the first 3 steps, and for the next 2 steps the maximum is limited to the geometric mean of the initial and maximum lengths.

(c) Generally

The program does not allow the step length to increase, from one step to the next, by more than a factor of approximately 2.

For further information see: