Automatic iteration to optimise a focus, introduction


For detailed information see the detailed note on automatic focusing.



The focus is defined as the set of crossing points at the beam section -that is, the coordinates of the rays as they cross the first test plane.


Minimising the size of a focus

The program will adjust the electrode voltages to minimise the size of this focus. The maximum number voltages that can be adjusted is 20. The scale factor of the magnetic field (if this exists) can be included in CPO3D with the voltages to be varied.  Alternatively, the current that falls within a given circle on the test plane can be maximised.


To control when the iteration should stop the user specifies a tolerance level and, for safety, the maximum number of iterations. The tolerance level refers to the fractional change in the quantity being minimised.


The requirements of users vary greatly, and so several different types of focus are available with this program, and several different forms of restraint are also available, see the detailed note on automatic focusing.


The position of the centre of the focus can be specified by the user or it be left free on the test plane (except under some special circumstances).


Some rays might fail to cross the test plane, for various reasons, and so it is necessary for the user to specify the total number of rays that will be considered.


To prevent answers being distorted by rays that are very much out-of-focus, the user can choose to specify a maximum distance and a penalty factor, see the detailed note on automatic focusing.


The user has the option of adding constraints, which can be to the voltages and/or the angles, as follows:

If a voltage constraint is chosen the user specifies

(a) whether the voltage is to be inhibited from going below or above some limit,

(b) the limit, and

(c) a penalty factor for voltages outside the limit.

A given voltage can be specified more than once, if the user wants to impose increasing levels of constraint on the voltage.

If there is an angle constraint the user specifies

(a) the direction cosines (or numbers proportional to them, see additional note below) of the required central direction of the beam at the focus,

(b) the limit in the angle between this direction and the direction of a ray, and

(c) a penalty factor.


If the kinetic energy of a particle needs to be one of the adjustable parameters, the total energy option can be used and the voltage of an electrode near the ray starting position can be varied.

An example is given in xmpl2d07 and xmpl3d06.

The current inside a given circle can also be maximised, see xmpl3d96.


Further information can be found in the detailed note on automatic focusing.