Fully and Partly Divergence and Rotation Free Interpolation of Magnetic Fields 283

Table 1. Coefficients of vectors ,

A

and . B

i Ai X

i B

i i Ai X

i B

i i Ai X

i B

i

1 a100 x Hx (0, 0, 0) 9 a020 y2 − x2 Hz (0, Δy, 0) 17 a103 xz (z2 − 3y2) Hy (Δx, 0, Δz)

2 a010 y Hy (0, 0, 0) 10 a102 x (z2 − y2) Hx (Δx, Δy, 0) 18 a310 xy (x2 − 3z2) Hz (Δx, 0, Δz)

3 a001 z Hz (0, 0, 0) 11 a012 y (z2 − x2) Hy (Δx, Δy, 0) 19 a301 xz (x2 − 3y2) Hx (0, Δy, Δz)

4 a110 xy Hx (Δx, 0, 0) 12 a021 z (y2 − x2) Hz (Δx, Δy, 0) 20 a013 yz (z2 − 3x2) Hy (0, Δy, Δz)

5 a101 xz Hy (Δx, 0, 0) 13 a300 x (x2 − 3y2) Hx (0, 0, Δz) 21 a031 yz (y2 − 3x2) Hz (0, Δy, Δz)

6 a011 yz Hz (Δx, 0, 0) 14 a030 y (y2 − 3x2) Hy (0, 0, Δz) 22 a113 xyz (z2 − x2) Hx (Δx, Δy, Δz)

7 a111 xyz Hx (0, Δy, 0) 15 a003 z (z2 − 3x2) Hz (0, 0, Δz) 23 a131 xyz (y2 − x2) Hy (Δx, Δy, Δz)

8 a002 z2 − x2 Hy (0, Δy, 0) 16 a130 xy (y2 − 3z2)Hx (Δx, 0, Δz) 24 a222 x2y2z2 Hz (Δx, Δy, Δz)

d,,

,, d

x

xyz

Hxyz

XA (3)

and similar for the y and z components. As

contains

23 coefficients, 23 magnetic fields components are

needed to be able to determine these coefficients. Of

course as only 23 components are needed one is not used.

As soon as the interpolation gets close to this point it will

get less accurate as one component is inferred from the

other components. This can be prevented by dividing the

box in two regions similar to Figure 2 so that the inter-

polation will always be at sufficient distance from this

point.

Another option is to add one additional coefficient.

The disadvantage is that in such a case the exactness of

the divergence free interpolation is given up. It has been

found that this method gives slightly more accurate re-

sults for the simulations considered here. Now,

and

contain 24 elements that are given by the complete

Table 1.

When is a vector with 24 elements, determined by

the values of the field components at the corners of the

rectangular box, then it is possible to write

B

ˆ

Q

BA (4)

where is a matrix connecting the elements of both

vectors. Each element of a row of is determined by

the corresponding element of Equation (3)

ˆ

Qˆ

Q

3,

d,,

d

iii

ij

xyz

Q

31,

d,,

d

iii

ij

xyz

Qy

32,

d,,

d

iii

ij

xyz

Qz

where i is to be taken over the 8 corners of the rectangu-

lar box, corresponding with coordinates (xi, yi, zi). Equa-

tion (3) can be inverted to find the elements of

1

ˆ

Q

B

and Equation (3) can be used to perform the interpola-

tion.

For a regular grid matrix is fixed and has to be

determined only once. One can even perform the inver-

sion of the matrix analytically, to speed up the process.

For a cubic grid and Δx = 1, the matrix reduces to a

very simple one and is shown in Table 2. The advantage

of this method over the one presented by Lekien [6] is

that no derivatives need to be determined at the corners

and that matrix has only 24 components instead of

96.

ˆ

Q

1

ˆ

Q

ˆ

Q

3. Simulation and Results

The accuracy of the interpolation scheme can be tested

by means of the magnetic field of a dipole at a certain

distance from the rectangular box that is considered. The

calculated magnetic field at a certain point in the box can

be compared to the one that is interpolated using the

magnetic field points at the corners of the box. This has

been done for above interpolation schemes (m = 3, m = 4

and 24-element) for a cubic grid and magnetic dipoles

directed in the x, y or z direction and positioned at the

x-axis at a certain distance. The magnetic field of such a

dipole was calculated according to

0

32

3

4rr

r

MrM

where µ0 is the magnetic permeability of vacuum, is

the vector from the dipole to the interpolation point and

is the magnetic dipole vector. For a magnetic dipole

in the x-direction only the x-component of is

non-zero (and similar for the y- and z-directions). Exam-

ples of the results for the 24-elements interpolation

scheme are shown in Figure 3. This figure shows the

relative deviation

r

M

M

interpolatedexact 1HH with respect to

Copyright © 2013 SciRes. JEMAA