Specification of the magnetic field, CPO3D.

 

See also general note on magnetic fields and magnetic fields in 2D.

The following headings appear below:

Uniform field

Circular current hoop

Solenoid, type 1, stack of hoops

Solenoid, type 2, helical coil subdivided into straight sections

‘Coiled’ solenoid (type 1)

Straight length of current

Point dipole

Circular arc of current

3D grid of points, user-supplied, complete grid array

3D grid of points, user-supplied, incomplete grid array

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

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

User-supplied field

'Differentiation length' and a 'tolerance level'

 

See also:

Note on using CPO3D to calculate a magnetic field by solving Laplace’s equation

Note on scaling total field

 

Information that the user is asked to give:

 

Uniform field:

strength (in Teslas)

the x,y,z coordinates of the 2 ends of any vector that is in the field direction

 

Circular current hoop:

the current(amp) and radius(mm)

the x,y,z coordinates of the centre and of any other point on the axis, in right-hand corkscrew direction of the current (that is, the current is clockwise in the direction from the first point to the second point specified in this line)

 

Solenoid, type 1, stack of hoops:

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 x,y,z coordinates of the 2 ends of the axis of the solenoid (and the current is clockwise in the direction from the first end to the second end)

Notes on this type of solenoid option:

The solenoid is made up of a stack of equally speced hoops.

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

 

Solenoid, type 2, helical coil subdivided into straight sections:

The user is asked to specify:

the current(amp), the radius(mm) of the first end, the number of turns, the total number of subdivisions into straight lengths, the z values of the 2 ends.

Notes on this type of solenoid option:

The solenoid consists of a helix that is subdivided into straight segments. There must be at least 8 straight segments per coil. The ends of each segment touch the helix and so are effectively ‘inscribed’ in the helix. This type of solenoid should be a more realistic simulation but is less accurate, unless the number of segments per coil is large, in which case the computing time can be long.

 

Coiled’ solenoid (type 1):

The axis of this type of solenoid lies on an arc of a circle.

The user is asked to specify the same data as for a straight solenoid, but with an additional line that gives the coordinates of the centre of the corcle.

An example is given in shap3d32.

 

Straight length of current

The user is asked to specify:

the current(amp)

the x,y,z coordinates of the 2 ends, in the direction of the current

 

Point dipole:

The user is asked to specify:

the strength of dipole(SI units)

the x,y,z coordinates of the dipole and of any other point on the axis

 

Circular arc of current:

The user is asked to specify:

the current(amp), radius(mm), number of subdivisions (max 50) of arc into straight lengths,

the x,y,z coordinates of the centre of the circle

the x,y,z coordinates of the 2 ends of the arc

An example is given in xmpl3d30.

 

3D grid of points, user-supplied, complete grid array:

The user is asked to specify:

name of file that holds the data

a 'differentiation length' and a 'tolerance level' -see note below

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

1st line: 3 integers giving the numbers of grid points in the x, y and z directions.

2nd line: the x,y,z coordinates of the origin of the grid, and the grid spacing (which is the same in all 3 directions).

Following lines: sets of values of bx,by,bz for each grid point, each set on a new line, with x 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).

 

3D grid of points, user-supplied, incomplete grid array:

The user is asked to specify:

name of file that holds the data

a 'differentiation length' and a 'tolerance level' -see note below

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

First 3 lines: 2 numbers to specify the minimum and maximum values of x, y and z.

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

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

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

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

 

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

The user is asked to specify:

name of file that holds the data

a 'differentiation length' and a 'tolerance level' -see note below

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 x coordinate at the origin is 0), and the grid spacing (which is the same in both directions).

Following lines: sets of values of bx,bz for each grid point, each set on a new line, with x 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

a 'differentiation length' and a 'tolerance level' -see note below

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.

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

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

 

User-supplied field:

See the relevant note for instructions on adding your routine (and also for an example of a program, of which a compiled version is supplied with the package).

12 numbers are available for use in the routine. They do not have to be used, but they must be read-in (if necessary as 'dummy' numbers). The first 3 of them will be converted to integers by the program, before they are transferred to the user-supplied routine. For safety, add a small value to each (eg if you want the integer 3, enter 3.1, and if you want -3, enter -3.1). The 12th is used as 'fail number'.

The user is also asked to specify a 'differentiation length' and a 'tolerance level' -see below.

 

If a user-supplied field appears more than once in the data list, then it will be called more that once by the program, but always with the last set of parameters that were read in.

 

'Differentiation length' and a 'tolerance level'.

These will be used to test the div and curl (or rot) which must be zero for a physically possible field. The tests will be used when the field is evaluated along a line. These tests can be disabled by making the 'tolerance level' greater than 1. Div and curl are not tested during ray tracing.

The 'differentiation length' is used for numerical differentiation of the field to calculate div and curl. It should be smaller than the minimum distance over which the field changes significantly, but not so small that numerical errors will occur. The 'tolerance level' is the maximum value of div/field or curl/field that will be tolerated. Put 0 to get the default value (0.01). Put 1 (or higher) to disable the tests.

 

 

 

For users who are editing or constructing an 'input data file' without the use of the data-builder -that is, pre-processor:

But Manual editing is certainly not recommended -it is a relic from the time when the databuilder was not available All users are strongly encouraged to use the databuilder, which always gives the correct formats and which has many options for which the formats are not described or easily deduced.

 

Parameters to be entered for different types of field:

(1) uniform field ('u'):

 1st line: strength (in Teslas)

 2nd line: x,y,z coordinates of the 2 ends of any vector that is in the field direction

(2) circular current hoop ('h'):

 1st line: current(amp) and radius(mm)

 2nd line: x,y,z coordinates of centre and of any other point on the axis, in right-hand corkscrew direction of the current (that is, the current is clockwise in the direction from the first point to the second point specified in this line)

(3) solenoid ('s'):

 1st line: current(amp), radius(mm) of first end, radius of second end, number of discrete hoops

 2nd line: x,y,z coordinates of the 2 ends of axis of solenoid (and the current is clockwise in the direction from the first end to the second end)

(4) straight length of current ('l'):

 1st line: current(amp)

 2nd line: x,y,z coordinates of 2 ends, in direction of the current

(5) point dipole ('d'):

 1st line: strength of dipole(SI units)

 2nd line: x,y,z coordinates of the dipole and of any other point on the axis

(6) circular arc of current ('a'):

 1st line: current(amp), radius(mm), number of subdivisions (max 50)

 of arc into straight lengths, xyz coordinates of the centre of the circle

 2nd line: x,y,z coordinates of the 2 ends of the arc

 An example is given in xmpl3d30.

(7) 3D grid of points, user-supplied ('g' or 'i'):

 1st line: name of file that holds the data

 2nd line: a 'differentiation length' and a 'tolerance level' -see note above

(8) 2D grid of points, user-supplied ('x' or 'y'):

 1st line: name of file that holds the data

 2nd line: a 'differentiation length' and a 'tolerance level' -see note above

(9) User-supplied field ('o'): -see the relevant note for instructions on adding your routine

 1st line: 6 numbers

 2nd line: 6 numbers

 3rd line: a 'differentiation length' and a 'tolerance level' see note above.