Magnetic fields in CPO2D.

 

There is an option to include magnetic fields in the 2D programs CPO2D and CPO2DS.  These fields are symmetric about the axis.  For more general magnetic fields the CPO3D program must be used.

 

Examples are given in test2d28, helical motion in a uniform magnetic field, and test2d29, magnetic Glaser lens.

 

 

The magnetic field can be synthesised (for axial symmetry only) by adding together components selected from a menu. The maximum number of selections is 'maxvolts'.

 

The fields in the menu are:

uniform magnetic field

circular current hoop

solenoid

User-supplied 2D grid of points, complete grid array

User-supplied 2D grid of points, incomplete grid array

 

The user-supplied complete grid arrays are essentially redundant, but can be useful when a different format of input data is preferred.

 

In the case of the user-supplied incomplete grids there is an option for assuming that the magnetic field is zero at missing grid points.

 

Information that the user is asked to give:

 

Uniform field:

strength (in Teslas)

direction along the z axis

 

Circular current hoop:

the current(amp) and radius(mm)

the position on the z axis

 

Solenoid:

The user is asked to specify:

the current(amp), the radius(mm) of the first end, the radius of the second end, the number of discrete hoops

the z coordinates of the 2 ends

Notes on the solenoid option:

The solenoid can be conical, and each hoop carries the same current.

79.58 amp per metre gives 1 tesla in an infinitely long solenoid.

To distribute N hoops the length is divided into N-1 equal parts and the hoops are placed at the ends of these parts.

The current is clockwise in the direction from the first end to the second end

 

2D grid of points in the rz plane, user-supplied, complete grid array:

The user is asked to specify:

name of file that holds the data

The data in the user-supplied file must have the format:

1st line: 2 integers giving the numbers of grid points in the radial and z directions.

2nd line: the z coordinate of the origin of the grid (the r coordinate at the origin is 0), and the grid spacing (which is the same in both directions).

Following lines: sets of values of br,bz for each grid point, each set on a new line, with r changing slowest, z fastest.

Last line (optional): scaling factor for all components.

(Data in this format can be obtained by using the option for outputting fields in a grid).

 

2D grid of points in xz plane, for axially symmetric magnetic fields, user-supplied, incomplete grid array:

The user is asked to specify:

name of file that holds the data

The data in the user-supplied file must have the format:

First 2 lines: 2 numbers to specify the minimum and maximum values of r and z.

Next line: the total number of grid points and the grid spacing.

Following lines: sets of values of r, z, br and bz for each grid point, each set on a new line. The lines can be in any order, and lines can be repeated.

The magnetic field is assumed to be zero at missing grid points.

 

 

See also notes on non-meridional motion.