Nuclear Instruments and Methods in Physics Research A236 (1985) 145-150 North-Holland, Amsterdam
A METHOD MAGNETIC
OF CALCULATION OF A SOLENOID FIELD ON ITS AXIS
145
PRODUCING
A GIVEN
L.B. L U G A N S K Y
Institute for Physical Problems, Moscow 117334, Kosyginstreet 2, USSR Received 22 August 1984 and in revised form 28 November 1984
A method is described to calculate a sectioned solenoid generating a prescribed magnetic field on its axis. The method allows one to find a current distribution through the sections that the field obtained along the axis of the solenoid B(z) minimally deviates from a given function f(z).
1. Introduction
2. General equations
In many applications it is necessary to produce a magnetic field of a given shape in a solenoidal magnetic system consisting of a number of sections. The current density is considered as constant in each section, but may be different in different sections. It is desirable to find a current density distribution in the sections which should generate a field maximally close to the required
Let us consider a system of N coaxial annular coils with arbitrary cross sections (fig. 1). Let Ij be the current density in the j t h coil, so the magnetic field B(z) on the axis may be written as
one.
where the function Kj(z) is the field produced at the point z by the j t h coil with unit current Ij = 1. The function Kj(z) depends on the shape of the cross section of the coil, its size and its position relative to the point of observation. In particular, if the coil is a thin annular turn placed at a distance zj from the origin and having a radius aj
The most c o m m o n problem is to produce a homogeneous magnetic field on an interval as long as possible. Usually it is solved by the method of "cut and try" [1]. Due to a rather large number of variables the method takes much time and effort and leaves the designer uncertain as to the optimality of the solution he has chosen. In ref. [2] a method of calculation of solenoids with homogeneous field was developed, by using Chebyshev's polynomials orthogonalized on a system of equidistant points. The method is more effective than that of " c u t and try", but the optimality of the current distribution obtained remains undecided. In refs. [3,4] methods are described to determine the continuous current distribution on a cylindrical surface producing a given axial field shape. These methods are inconvenient from a practical point of view, because real magnetic systems are made from finite elements and this fact must be taken into account during the calculation and design. Approximation of a continuous current distribution by sectioned windings leads to additional errors. In this paper a method is proposed allowing one to find the optimal current distribution in the sections of a solenoid with a fixed geometry which produces a given magnetic field along the axis with a certain degree of accuracy. 0168-9002/85/$03.30 © Elsevier Science Publishers B.V. (North-Holland Physics Publishing Division)
N
B(z) = • Kj(z)lj,
(1)
j=l
2rr
2
Kj(Z)=caj[(zj-z)Z+a2
]
-3/2
In this c a s e / j is the current in the turn.
Fig. 1. General scheme of a solenoidal magnetic system.
(2)
L.B. Lugansky / Calculation of a solenoid
146
For an annular coil with a square cross section
Kj(z)=
I
2_~ ( z a y _ z ) In
C -(zU-z
a2j+ ~/a2j+(z21_z)2 alj+~a2j+(z2j_z)2
) In a 2 1 + ~ a ~ l + ( Z ' J - z ) 2 ] , ali + ( G
(3)
+ ( z,J - z
where z U and zzj are the coordinates of the ends of the coil, a u and a2i are the inner and outer radii of the coil (fig. 1). Let one need to produce on the axis of the system a magnetic field with a strength described by a given function f(z). Any fixed current distribution Ii( j = 1, 2 . . . . , N ) provides on the axis a field B(z) which differs from the required one. We introduce the deviation function N
h(z)=B(z)-f(z)=
Y~. K l ( Z ) I j - f ( z j=1
),
= f h h 2 ( z ) d z = [ I~
~I1J ~ Il
"=
Kj(z)Ii-f(z
]2
) dz.
(5)
It is easy to show from eq. (5) that the functional may be represented as N
N
F = E Cijlili - 2 Y'~ DiIj + Fo , 0=1
(6)
j=l
where the coefficients C u, D1 and F 0 are
C,i=fl;2Ki(z)K,(z)dz, ro
Di=fl;2f(z)Ki(z)dz,
=f'2f2(z)dz. /l
(7)
The condition of minimality of the functional
3F
--
%=
0 ( j = 1, 2 . . . . . N )
(8)
give us in accordance with eq. (6) a system of N linear equations with a symmetrical matrix (C,i = ~ i ) for N unknown currents 1i N
y" Ciilj = Di(i = 1, 2 ..... N), j=1
1
/2
. 1/2
[
Fmin
1/2
(1o) and also the plots B(z), f ( z ) and that of the deviation
h(z)=B(z)-f(z).
(4)
and are to find a current distribution 1i in the coils that would minimize the difference between B(z) and f ( z ) on a given interval on the axis l I < z < l 2. As a criterion of minimal deviation we use the squared functional
r ( l l , 12 ..... IN; 11, 12)
solenoids consisting of separate turns and annular coils with squared cross sections. As input data the sizes and positions of sections of the solenoid are inserted. The matrix coefficients C,j and right hand side column D, are calculated by numerical integration. We used subroutine Q U A D [6] for computation of the integrals (7) and subroutines D M F S S and D M L S S [7] for solving of the linear system (9). All the calculations were done with double precision. As a result we obtain the optimal currents lj, root-mean square deviation A of the field B(z) generated by these currents from the desirable field f ( z ) determined by
(9)
from which we can find the optimal (in the above mentioned sense) current distribution in the coils. This algorithm was accomplished in Fortran for
3. H o m o g e n e o u s field synthesis
To illustrate the method we consider a solenoid described in refs. [1,2]. It is a symmetrical solenoid, 727 m m long, having an inner radius of winding 85 mm and an outer radius of 166 mm. The solenoid consists of 14 sections: each of them is a coil made of 2 pancakes wound with copper tape in opposite directions. All the coils have the same sizes but different numbers of turns, so as to provide for the calculated current density in the coils. During the computation all the dimensions were scaled to facilitate the comparison with results in refs. [1,2], so that the length of the solenoid in arbitrary units is 28, the inner radius 3.3269 the outer radius 6.4990. In view of symmmetry of the system all the plots and tables are presented only for one half of the solenoid (0 < z < 14). We parted each half of the solenoid into N equal sections and for each partitioning found the optimal current distribution to obtain the maximally homogeneous field for a certain interval of the axis ( - / < z < l). Naturally, the optimal currents and resulting field homogeneity depend on the length of optimization l. Table 1 presents the results of computations with different numbers of sections N = 1, 2, 3, 4, 5, 6 for l = 8.5 (60% of the total length) and l = 12 (85% of the total length). It contains the calculated optimal currents lj, rms deviation A from f ( z ) = 1 and the electric power (in arbitrary units) required to energize the solenoid for the case. Fig. 2 shows the field homogeneity in this solenoid for 1 = 8.5. It is seen from the table that the homogeneity is improved with increasing number of sections N.
147
L.B. Lugansky / Calculation of a solenoid Table 1 Optimal currents for optimization length 1 = 8.5 and 1 = 12 in S.P. Kapitza's solenoid with equispaced sections N
l = 8.5
1 = 12
6
a
P
6
a
e
1
0.272504
2.4 x 10 2
1
0.282837
7.8 x 10 2
1.08
2
0.259894 0.304264
2.9 x 10 3
1.08
0.249751 0.334976
3.4 x 10- 2
1.18
3
0.260761 0.261601 0.346833
3.9 × 10 4
1.15
0.267081 0.233007 0.397358
1.5 × 10- 2
1.27
4
0.259773 0.262603 0.261271 0,398642
6.2 × 10 5
1.22
0.253534 0.282202 0.209414 0.472473
6.8 X 10 -3
1,38
5
0.259576 0.260620 0.264601 0.256276 0.460444
8.1 x 10 -6
1.30
0.263968 0,243425 0.300513 0.173161 0.562269
3.1 x 10- 3
1,52
6
0.259298 0.260109 0.261731 0.266791 0.243987 0.533947
2.1 × 10 6
1.39
0.254570 0.273806 0.231820 0,324942 0,119290 0.668943
1•5 x 10 -3
1.71
F o r a g r e a t e r length of h o m o g e n e i t y l, the q u a l i t y of the field is w o r s e a n d a h i g h e r p o w e r is required•
a 1
,¢o3 4. Synthesis of a prescribed field Z T o c o m p a r e the p r o p o s e d m e t h o d with the m e t h o d p r e s e n t e d in ref. [4] we p e r f o r m e d the calculations to
:;]
//
Table 2 Optimal currents for Adamiak's solenoid, generating field f ( z ) = 1/(1 + z2); equispaced sections N
•oo,"5~
/I
a
P
1
0.533397 x 101
6.8 x 10- 2
1
2
0.922651 x 101 0.435164
8.3 x 10- 3
1.50
3
0.155906 x 102 0.604819 x 101 0.538312×101
4.9 x 10 -4
3.62
2.2 x 10 -4
3.82
4
Fig, 2. Field homogeneity for Kapitza's solenoid (l = 8.5): (a) N = 3, 4, (b) N = 5, 6.
Ij
0.139356 0.763555 - 0.103034 0.873055
x x x x
102 101 102 101
L.B. Lugansky / Calculation of a solenoid
148
j
¢¢e)
•
,
2
;j Fig. 3. Synthesis of a focussing field f ( z ) = l / ( l + z 2) in Adamiak's solenoid. Deviation of the obtained field from the assumed one.
synthesize a focussing field described by the function f ( z ) = 1 / ( 1 + z 2) in a solenoid which has a total length 2 L = 2, an inner radius R 1 = 1 a n d an outer radius R 2 = 1.2. In table 2 the results for different n u m b e r s of equispaced sections of the solenoid c o m p u t e d for the interval of the axis - L < z < L are given. Fig. 3 shows the deviation of the field B ( z ) generated by the optimal currents lj from the assumed field f ( z ) = 1 / ( 1 + z2). T h e c o m p a r i s o n with the results of ref. [4] (fig. 9a) shows that our fitting is considerably better a n d can be o b t a i n e d with a fewer n u m b e r of sections. In ref. [5] a m e t h o d is described where one chooses N points z m ( m = l , 2.... , N ) along the axis of a solenoidal system over which the required field is to fit. T h e whole winding is divided into N sections a n d one looks for N values of currents Ij in the sections to provide the field fit. One obtains a system of N linear equations
m e t h o d seems to be unreasonable because the sectioning of the winding appears to depend on the n u m b e r of fitting points. Fig. 4 taken from ref. [5] shows a magnetic system p r o d u c i n g a " c o n i c a l " field B ( z ) = c o n s t . / z 2. In accord a n c e with the chosen 40 fitting points z,, the winding consists of 40 different coils with separate currents. We calculated a m u c h simpler solenoid ( L = 103, R 1 = 32, R 2 = 42) assembled of identical coils (fig. 5a) producing the field m e n t i o n e d in the same region 25 < z < 79. By our choice of the coordinate origin the field is described by the function f ( z ) = [ 6 4 / ( 1 2 + z ) ] 2, varying from f ( 2 5 ) = 2.9920 to f ( 7 9 ) = 0.4946. The results calculated
Table 3 Optimal currents for "conical" field generated by the solenoid of fig. 4a in the region 25 < z < 79; equispaced sections N 1
(m=1,2
which can be solved to yield N
0.66
1
0.27
3.05
3
0.573684 -0.128585 0.102797
0.10
7.9
4
0.985599 -0.280747 0.171761 -0.741939 × 10 -1
3.8 × 10 -2
18.0
5
0.159077 × 101 -0.593861 0.276488 -0.163468 0.144827
1.4X 10 . 2
40.0
6
0.246339 × 101 -0.115903 × 101 0.465215 -0.242549 0.236908 - 0.127104
5.3x 10 -3
86.1
7
0.371011 × 101 - 0.214075 × 101 0.818663 -0.393609 0.325957 -0.293270
2.0 × 10 .3
185
8
0.546889 × 101 -0.375850 × 101 0.146460 x 101 -0.650693 0.443489 -0.377382 0.405128 -0.219459
7.3 ×
393
values of Ij. This
O
Fig. 4. Zacharov's solenoid producing a "conical" field B(z) = const./z 2.
0.122607
P
0.298647 -0.502678 × 10 -1
.... N),
j=l
a
2
N
Z Kj(z,,,)Ij=B,,,,
Ij
10 - 4
L.B. Lugansky / Calculation of a solenoid
149
Table 4 Optimal currents for the "conical" field generated by the solenoid of fig. 4b in the region 25 < z < 79 (for P = 1, see table 3) N
zI
z2
R1
R2
3
0 20 60
20 60 100
20 32 20
30 42 30
0.796135 0.623457 × 10 -1 0.230399× 10 -1
1.8 × 10 -2
5.64
5
0 20 40 60 80
20 40 60 80 100
20 32 32 20 20
30 42 42 30 30
0.897091 -0.815100× 10 -1 0.167642 -0.139182 0.413531 × 10 -]
9.5 X 10 -3
7.5
10
0 10 20 30 40 50 60 70 80 90
10 20 30 40 50 60 70 80 90 100
20 20 32 32 32 32 20 20 20 20
30 30 42 42 42 42 30 30 30 30
0.312351 × 101 -0.584284 -0.115662 0.573367 - 0.460474 0.348110 -0.426600 × 10 -~ 0.476584× 10 -1 -0.627789× 10 1 0.972453x 10 i
2.4 × 10 -4
48.5
for different section n u m b e r s N are presented in table 3. W e see that a good fitting can be o b t a i n e d if we have e n o u g h electrical power. A better fitting can b e o b t a i n e d with a n o t h e r solenoid
?
£0
ea
~
P
(fig. 5b) which consists of only two kinds of coils. Table 4 gives the results calculated for this case. Fig. 6 shows the relative deviation of the field o b t a i n e d from the assumed field [ B ( z ) - f ( z ) ] / f ( z ) in percent.
5. Correction of magnetic fields
a
O
~
z,~
Z
Fig. 5. Simple solenoids, generating a "conical field": (a) assembled of identical coils, (b) assembled of two kinds of coils.
It should be n o t e d that the field fitting with an accuracy of 1 0 - 5 - 1 0 -6 in a large space is a very difficult engineering problem, because the m a n u f a c t u r ing of the windings a n d their assembling c a n n o t be fulfilled with the necessary mechanical precision especially for large-scale magnetic systems. Additional strains appear during operation (electrodynamical a n d t h e r m o m e c h a n i c a l forces) causing a d d i t i o n a l discrepancies. In practice, one often needs to insert special correcting windings which should produce a compensating field f * ( z ) = f ( z ) - B ( z ) , where f ( z ) is the assumed field a n d B ( z ) is the real field. T h e function f * ( z ) can be a p p r o x i m a t e d analytically a n d then currents in correcting turns can be calculated by the procedure described above. But often it is more convenient to give the c o m p e n s a t i n g field f * ( z ) as a table f * ( z k ) on a discrete set of experimental points z k ( k = 1, 2 . . . . . m ). The m e t h o d can naturally be generalized for the case of a tabulated function f * ( z k). As a minimized functional we take the finite sum F*(i 2,i 2..... i,,)= ~ k=l
[ b ( z k ) _ f *( z k ) ] , 2
(11)
L.B. Lugansky/ Calculationof a solenoid
150
Then the procedure described above gives us small additional currents which are to be introduced into the windings to improve the field without having any separate correcting coils.
6. Conclusion
Fig. 6. Deviation of the field in the solenoid of fig. 5b from the "conical" field with different numbers of sections N = 3, 5, 10.
where b(zk) is the compensating field produced in the point z k by correcting coils
b(z) = L Xj(z)ij.
(12)
A method of a magnetic field synthesis on the axis of solenoidal magnetic systems is developed that allows one to solve the problem for sectioned system with fixed geometry. By varying the currents in the sections one can obtain, in the same system, magnetic fields of different desirable shapes. The method uses a leastsquares deviation approach, it is very convenient and efficient and can be applied to different magnetic systems used in nuclear and plasma physics, NMR-spectroscopy and tomography, electron optics, etc.
j=l
Here n is the number of correcting coils, ig the current densities in them. The conditions of the functional minimization give us the same linear equations system
L Cl*ij D~ (l= 1, 2 ..... n),
The author would like to thank Prof. S.P. Kapitza for his assistance in this work and Drs. E.L. Kosarev and A.B. Manenkov for helpful discussions.
(13)
=
References
j=l
where
C,*j=~ K~(zk)Kg(Z,), k=l
m
D* = ~
/*(zk)K*(zk).
k=l
(14) The solution of the system gives us the currents in the correcting coils for optimal smoothing of discrepancies. It should be noted that sometimes one can use the same windings of a magnetic system as correcting ones.
[1] S.P. Kapitza, High Power Electronics, vol. 2 (Nauka, Moscow, 1963) p. 109 (in Russian). [2] L.P. Grabar, ibid., vol. 5, p. 195. [3] W. Glaser, Z. Physik 118 (1941) 264. [4] K. Adamiak, Appl. Phys. 16 (1978) 417. [5] B. Zacharov, Nucl. Instr. and Meth. 17 (1962) 132. [6] D. Kahaner, in: Mathematical Software, ed., J.R. Rice (Academic Press, New York, 1971). [7] System/360 Scientific Subroutine Package (360A-CM-03X), Version III, IBM Technical Publication Department, New York.