MAGNUM - A Fortran Library for the Calculation of Magnetic Configurations

Similar documents
Inductance Calculation for Conductors of Arbitrary Shape

Module 3: Element Properties Lecture 1: Natural Coordinates

COMPOSITE BEAM WITH WEAK SHEAR CONNECTION SUBJECTED TO THERMAL LOAD

More metrics on cartesian products

Module 1 : The equation of continuity. Lecture 1: Equation of Continuity

Lecture 12: Discrete Laplacian

1 Matrix representations of canonical matrices

Week 9 Chapter 10 Section 1-5

Three-dimensional eddy current analysis by the boundary element method using vector potential

Supplemental document

CHAPTER 14 GENERAL PERTURBATION THEORY

Professor Terje Haukaas University of British Columbia, Vancouver The Q4 Element

Physics 5153 Classical Mechanics. D Alembert s Principle and The Lagrangian-1

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Lecture Note 3. Eshelby s Inclusion II

PES 1120 Spring 2014, Spendier Lecture 6/Page 1

Mathematical Preparations

Tensor Analysis. For orthogonal curvilinear coordinates, ˆ ˆ (98) Expanding the derivative, we have, ˆ. h q. . h q h q

Advanced Quantum Mechanics

This model contains two bonds per unit cell (one along the x-direction and the other along y). So we can rewrite the Hamiltonian as:

Section 8.3 Polar Form of Complex Numbers

Finite Element Modelling of truss/cable structures

DUE: WEDS FEB 21ST 2018

PHYS 705: Classical Mechanics. Newtonian Mechanics

From Biot-Savart Law to Divergence of B (1)

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

For all questions, answer choice E) NOTA" means none of the above answers is correct.

Electricity and Magnetism - Physics 121 Lecture 10 - Sources of Magnetic Fields (Currents) Y&F Chapter 28, Sec. 1-7

Prof. Dr. I. Nasser Phys 630, T Aug-15 One_dimensional_Ising_Model

CIVL 8/7117 Chapter 10 - Isoparametric Formulation 42/56

Physics 114 Exam 3 Spring Name:

Chapter Eight. Review and Summary. Two methods in solid mechanics ---- vectorial methods and energy methods or variational methods

Army Ants Tunneling for Classical Simulations

Moments of Inertia. and reminds us of the analogous equation for linear momentum p= mv, which is of the form. The kinetic energy of the body is.

A PROCEDURE FOR SIMULATING THE NONLINEAR CONDUCTION HEAT TRANSFER IN A BODY WITH TEMPERATURE DEPENDENT THERMAL CONDUCTIVITY.

Numerical Transient Heat Conduction Experiment

Math1110 (Spring 2009) Prelim 3 - Solutions

EEE 241: Linear Systems

Indeterminate pin-jointed frames (trusses)

Celestial Mechanics. Basic Orbits. Why circles? Tycho Brahe. PHY celestial-mechanics - J. Hedberg

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

An Algorithm to Solve the Inverse Kinematics Problem of a Robotic Manipulator Based on Rotation Vectors

A linear imaging system with white additive Gaussian noise on the observed data is modeled as follows:

Physics 4B. Question and 3 tie (clockwise), then 2 and 5 tie (zero), then 4 and 6 tie (counterclockwise) B i. ( T / s) = 1.74 V.

Affine transformations and convexity

Advanced Circuits Topics - Part 1 by Dr. Colton (Fall 2017)

C/CS/Phy191 Problem Set 3 Solutions Out: Oct 1, 2008., where ( 00. ), so the overall state of the system is ) ( ( ( ( 00 ± 11 ), Φ ± = 1

Lecture Notes on Linear Regression

Lecture 6/7 (February 10/12, 2014) DIRAC EQUATION. The non-relativistic Schrödinger equation was obtained by noting that the Hamiltonian 2

Lagrangian Field Theory

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

2 Finite difference basics

AERODYNAMICS I LECTURE 6 AERODYNAMICS OF A WING FUNDAMENTALS OF THE LIFTING-LINE THEORY

CSci 6974 and ECSE 6966 Math. Tech. for Vision, Graphics and Robotics Lecture 21, April 17, 2006 Estimating A Plane Homography

Chapter 4 The Wave Equation

σ τ τ τ σ τ τ τ σ Review Chapter Four States of Stress Part Three Review Review

Physics 181. Particle Systems

Chapter 3 Differentiation and Integration

Causal Diamonds. M. Aghili, L. Bombelli, B. Pilgrim

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

PHYS 705: Classical Mechanics. Calculus of Variations II

PHYS 1101 Practice problem set 12, Chapter 32: 21, 22, 24, 57, 61, 83 Chapter 33: 7, 12, 32, 38, 44, 49, 76

In this section is given an overview of the common elasticity models.

Formulas for the Determinant

One Dimension Again. Chapter Fourteen

Pressure Measurements Laboratory

χ x B E (c) Figure 2.1.1: (a) a material particle in a body, (b) a place in space, (c) a configuration of the body

The Geometry of Logit and Probit

Generalized Linear Methods

Structure and Drive Paul A. Jensen Copyright July 20, 2003

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

Canonical transformations

ˆ (0.10 m) E ( N m /C ) 36 ˆj ( j C m)

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

1 (1 + ( )) = 1 8 ( ) = (c) Carrying out the Taylor expansion, in this case, the series truncates at second order:

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

Numerical Heat and Mass Transfer

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Physics for Scientists & Engineers 2

Solution Thermodynamics

Feb 14: Spatial analysis of data fields

Appendix B. The Finite Difference Scheme

PHY2049 Exam 2 solutions Fall 2016 Solution:

Thermal-Fluids I. Chapter 18 Transient heat conduction. Dr. Primal Fernando Ph: (850)

A boundary element method with analytical integration for deformation of inhomogeneous elastic materials

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Difference Equations

MMA and GCMMA two methods for nonlinear optimization

Linear Approximation with Regularization and Moving Least Squares

9 Characteristic classes

Robert Eisberg Second edition CH 09 Multielectron atoms ground states and x-ray excitations

APPROXIMATE PRICES OF BASKET AND ASIAN OPTIONS DUPONT OLIVIER. Premia 14

Analytical Gradient Evaluation of Cost Functions in. General Field Solvers: A Novel Approach for. Optimization of Microwave Structures

. The kinetic energy of this system is T = T i. m i. Now let s consider how the kinetic energy of the system changes in time. Assuming each.

kq r 2 2kQ 2kQ (A) (B) (C) (D)

2E Pattern Recognition Solutions to Introduction to Pattern Recognition, Chapter 2: Bayesian pattern classification

The Quadratic Trigonometric Bézier Curve with Single Shape Parameter

Linear Regression Analysis: Terminology and Notation

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

Magnetostatics. T i. Ursula van Rienen, Universität Rostock, FB Elektrotechnik und Informationstechnik, AG Computational Electrodynamics

Transcription:

CRYO/6/34 September, 3, 6 MAGNUM - A Fortran Lbrary for the Calculaton of Magnetc Confguratons L. Bottura Dstrbuton: Keywords: P. Bruzzone, M. Calv, J. Lster, C. Marnucc (EPFL/CRPP), A. Portone (EFDA- CSU) Magnetc feld Summary Ths note reports general formulae for the calculaton of magnetc feld generated by conductors n plane -D, axsymmetrc -D and 3-D confguratons, n the presence of current and magnetzaton sources. All formulae have been programmed n numercally stable routnes, collected n a lbrary named MAGNUM. Introducton In ths note we revew the state of the art of ntegral formulae for the calculaton of the magnetc feld n lnear and magnetsed meda. The formulae have been collected n a lbrary of FORTRAN routnes that compute the magnetc feld and the vector potental generated by dstrbutons of current and magnetzaton n several confguratons of nterest for magnet desgn and analyss. The routnes are organsed accordng to the feld source (current or magnetzaton), and spatal symmetry, for the followng confguratons: plane -D axsymmetrc -D general 3-D Most of the calculatons are based on analytcal formulae for the feld, and numercal ntegraton or functon approxmaton s lmted to the mnmum strctly necessary. In partcular, all plane -D and 3-D confguratons are computed analytcally. Axsymmetrc -D confguratons requre a numercal approxmaton to ellptc ntegrals and numercal ntegraton n one dmenson. 1

We descrbe below the confguratons, as well as the relevant analytcal formulae programmed n the lbrary. The am of ths note s to descrbe the workng prncple of the routnes, and the bascs of magnetostatcs are ntentonally left to the numerous textbooks and references quoted on the subjects. Plane, -D confguratons Long straght current lnes normal to a plane (x,y), or magnetc moments whch are unform n one space dmenson and have components only n the (x,y) plane generate magnetc feld confguratons that are -D and plane. The magnetc feld only has the two components n the plane (x,y), and the vector potental only has a component normal to the plane, along z. Under ths assumpton we can make an extensve use of the complex formalsm ntroduced by Beth (Beth, 1966). The poston of the current and magnetzaton sources s defned n the complex plane ζ = x + y. 1 Fgure 1. Plane -D reference frame and confguratons consdered for the calculaton of magnetc feld and vector potental of current and magnetzaton sources. As dscussed n (Beth, 1966) a complex, analytcal functon B = B y + B x can be defned from the x- and y-components of the magnetc feld vector. We ndcate below the z-component of the current densty n a current carryng conductor wth J, and the total current wth I. By analogy wth the defnton of the complex feld functon, we defne a complex magnetzaton functon M = M y + M x, where the two components M y and M x are the magnetzaton denstes, unform n z, n a magnetsed materal. Fnally, when computng the feld of small magnetc moments, we make use of the complex magnetc moment per unt length p = p y + p x, where the two components p y and p x are the magnetc moments per unt length, unform n z, n the magnetsed materal. 1 Note that we ndcate wth ζ the complex varable, to dstngush t from the axs coordnate z n the general 3-D frame (x,y,z).

The advantage of ths defnton s that, as B s analytcal, t can be expanded n a seres that converges n a crcle that does not contan current sources: n)1 # " B = + C n R ( (1) n=1 ref where C n s called complex harmonc, or multpole coeffcent, of order n, and R ref s a reference radus that has a pure normalzaton functon. The complex multpole coeffcents have a real and an magnary part: C n = B n + A n (). The real part B n s the so-called normal multpole, whle the magnary part, A n s the skew multpole. Magnetc feld calculaton Flamentary current The magnetc feld generated n a pont ζ P = x P + y P by a flamentary current I located at ζ C = x C + y C s gven by: B = µ I "# (3) where the dstance ρ s defned as: " = # C # P Unform current densty wth polygonal boundary (4) We consder the case of a polygonal conductor, delmted by a seres of N pecewse straght segments defned n the complex plane through the poston of the N vertces ζ. A unform current densty J flows nsde the polygonal conductor normal to the complex plane, see Fg.. 3

Fgure. Polygonal conductor wth unfom current densty n the drecton normal to the plane. The feld s computed n a pont z p that can be n an arbtrary poston n the plane. The feld generated at any pont ζ P n the complex plane s gven by the surface ntegral: B = µ J " S 1 ( ) ds # # P (5) The above ontegral can be transformed n the followng lne ntegral (Beth, 1966), (Beth, 1967), (Halbach, 197): B = 4" µ J # # P d# (6) # # P where the varable of ntegraton ζ descrbes the contour of the polygon n postve (ant-clockwse) drecton. Introducng the dstance vector ρ, as defned n Eq. (4), and recallng that the contour of the polygon between two vertces -1 and s a straght lne, t s possble to smplfy the above ntegral: r B = N 4" µ J # # d# (7). =1 r 1 where we mplctly assume that ρ = ρ N. Introducng the auxlary quanttes: "# = # # 1 "# = # # 1 (8) (9) we can solve the contour ntegral: B = N 4" µ J # + 1# 1 # ),( ( ln ln 1 ) + (1). # =1 4

The expresson above provdes an exact and closed form soluton for the feld generated by a polygonal conductor wth unform current densty. Its evaluaton s straghtforward for ponts ζ P outsde the conductor, but requres care n the monotonc treatment of the argument of the complex natural logarthm for ponts ζ P placed nsde and on the contour of the conductor. Localsed magnetc moment The magnetc feld generated n a pont ζ P = x P + y P by a localsed magnetc moment per unt length p wth components (p x,p y ) and located at z M = x M + y M s gven by: B = "µ p # (11) where the dstance ρ s defned smlarly to Eq. (4). " = # M # P Unform magnetzaton wth polygonal boundary (1) As for the magnetc feld, we consder the polygonal conductor of Fg.. The materal n the polygon has a unform magnetzaton M wth components (M x, M y ). The feld generated at any pont ζ P n the complex plane s gven by the surface ntegral: B = " µ M 1 # ( " P ) ds (13) S For ponts external to the polygon, the above ntegral can be transformed n the followng lne ntegral (Beth, 1966; Beth, 1967; Halbach, 197): B = " 1 4# µ 1 M d (14) " P wth the same conventons as Eq. (6). For ponts nternal to the polygon the result s the same, but the magnetc feld n ths case s gven by the result of Eq. (14) plus the contrbuton of the magnetzaton, µ M. We ntroduce the dstance vector r, as defned n Eq. (4), and we wrte the above ntegral decomposng over the sdes of the polygon: In general the logarthm of a complex nuber ζ can be wrtten as: log(ζ) = log( ζ ) + arg(ζ) whle the log of the module of the complex number s well behaved and always sngle-valued, the argument can flp by π dependng on the evaluaton method. The care that s needed s to make sure that under all crcumstances the argument of the terms n the lne ntegral s a monotoncal ncreasng or decreasng functon wth no jumps. 5

B = " 1 N 4# µ 1 M d (15). =1 "1 where we mplctly assume that ρ = ρ N. Introducng the auxlary quanttes: "# = # # 1 "# = # # 1 (16) (17) we can solve the contour ntegral: B = " 1 N 4# µ M ),( ( ln " ln "1 ) + (18). =1 The expresson above but requres the same care n the monotonc treatment of the argument of the complex natural logarthm for ponts ζ P placed nsde and on the contour of the conductor as Eq. (1). Vector potental calculaton Flamentary current The vector potental generated n a pont ζ P = x P + y P by a flamentary current I located at ζ C = x C + y C s gven by: + I A z = "Re µ # ln + 1 (., / - ) (19) where the dstance ρ s defned as n Eq. (4). Unform current densty wth polygonal boundary The vector potental generated by a polygonal conductor as n Fg.., carryng a unform current dstrbuton s gven by the followng surface ntegral: A z = " 1 4# µ J ln ( " P ) + ln [ ( " P )]ds (). S that can be transformed (Halbach, 197) n the lne ntegral: A z = 8" µ J # ( # P ) ln (# # P ) + ln # [ ( # P )]d# (1). As prevously, we ntroduce the dstance vector ρ as n Eq. (4), and we break the ntegral n a summaton along the straght sdes of the polygon: 6

r A z = N 8" µ J ( # ln # + ln# )d# (). =1 r 1 The ntegral can be solved and leads to the followng closed form for the vector potental of a polygonal conductor wth unform current densty: A z = N 8" µ J, # 1 # # 1 # ) /-( + # ln # 1. # =1 [ ( ) # 1 ( ln # 1 1) ] # # # ln# 1 ) ( + # 1 ln # 1 ) 3 ( 1 + 5 + 1 4 # # # ln # 1 ) ( + # 1 ( 1 ln# 1 + 1 ) 368 + 57 45 98 (3) that can be evaluated wth the same precautons taken for the magnetc feld (see prevous sectons). Localsed magnetc moment The vector potental generated n a pont ζ P = x P + y P by a localsed magnetc moment p wth components (p x,p y ) and located at ζ m = x m + y m s gven by: p ( A z = "Re µ ) # (4) where the dstance ρ s defned as n Eq. (1). Unform magnetzaton wth polygonal boundary The vector potental generated by a polygonal dstrbuton of unform magnetzaton, wth the polygon defned as n Fg.., s gven by the followng surface ntegral: p A z = "Re µ ( # S 1 ( ) ds " P ) + (5) Apart for a constant, the term n parentheses, and n partcular the ntegral, s the same as that of the magnetc feld of a unform current densty n a polygon, Eq. (1). Hence we can use the same procedure, and the fnal result s: - N A z = "Re 4# µ p + "1 " "1 ).,( ( ln " ln "1 ) + 1 / =1 (6). 7

Harmoncs calculaton Flamentary current A lne of current I located at a poston ζ C = x C + y C n the complex plane generates the followng harmoncs: I R C n = "µ ref ( #R ref ) C n (7). Localsed magnetc moment A localsed magnetc moment p wth components (p x,p y ) and located at a poston ζ m = x m + y m n the complex plane generates the followng harmoncs: C n = "nµ p #R ref R ref ( ) n +1 (8). Axsymmetrc, -D confguratons In the case of axsymmetrc crcular flamentary or massve cols, the current lnes are normal to the plane (R,z) n clndrcal coordnates, and magnetc moments have components only n the (R,z). Both currents and magnetc moments are constant n the thrd space dmenson θ. The resultng magnetc feld has only the two components n the plane (R,z), and the vector potental has only one component normal to the (R,z) plane, along θ. We lmt ourselves to flamentary currents or magnetc moments, or to polygons n -D plane wth constant current densty and volume magnetzaton. Fgure 3. Cylndrcal reference frame for the axsymmetrc -D confguraton, and geometres consdered for the calculaton of magnetc feld and vector potental of current and magnetzaton sources. 8

The calculaton of felds n ths confguraton nvarably results n expresson nvolvng the ellptc ntegrals, and n partcular the complete ellptc ntegral of frst knd K and E, defned as follows: K( k) = E k d" (9) 1# k sn " / / ( ) 1/ ( ) 1/ d# (3) ( ) = 1" k sn # Magnetc feld calculaton Flamentary loop current The magnetc feld generated n a pont (R P,z P ) by a flamentary loop current I wth radus R C and placed at an heght z C s gven by: B R = "µ I B z = µ " I z 1 # R p R C + R P [( ) + z ] K k 1/ 1 [( R C + R P ) + #z ] K k 1/ ( ) " R C + R P + z ( ) + z E ( k ) R C " R P ( ) + R C R P #z ( ) + #z E ( k ) R C R P ( ) ( ) (31) (3) where: k = 4R C R P ( ) + "z R C + R P (33) and the dstance Δz s defned as: "z = z P # z C (34) Unform current densty loop wth rectangular boundary NOTE: Ths feld prmtve s presently not documented Unform current densty loop wth polygonal boundary NOTE: Ths feld prmtve s presently not documented Localsed magnetc moment loop NOTE: Ths feld prmtve s presently not documented 9

Unform magnetzaton loop wth rectangular boundary NOTE: Ths feld prmtve s presently not documented Unform magnetzaton loop wth polygonal boundary NOTE: Ths feld prmtve s presently not documented Vector potental calculaton Flamentary current loop The vector potental generated n a pont (R P,z P ) by a flamentary loop current I wth radus R C and placed at an heght z C s gven by: I A " = µ k# R c R p ) ( 1/ + 1 k - ) K k, ( ( ) E( k) where k s defned as n Eq. (33).. (35) / Unform current densty loop wth rectangular boundary NOTE: Ths feld prmtve s presently not documented Unform current densty loop wth polygonal boundary NOTE: Ths feld prmtve s presently not documented Localsed magnetc moment loop NOTE: Ths feld prmtve s presently not documented Unform magnetzaton loop wth rectangular boundary NOTE: Ths feld prmtve s presently not documented Unform magnetzaton loop wth polygonal boundary NOTE: Ths feld prmtve s presently not documented 3-D confguratons In the case of general, 3-D confguratons, the current and magnetzaton vectors can have arbtrary orentaton n the (x, y, z) space. The resultng magnetc feld and vector potental also have three non-zero components. 1

Fgure 4. Reference frame for the 3-D confguraton, and geometres consdered for the calculaton of magnetc feld and vector potental of current and magnetzaton sources. For 3-D confguratons we restrct the lbrary of modellng elements to the case of localsed sources (flament current I [A] or pont-lke magnetc moment P [Am ]), and to a general volume element wth plane faces and constant current densty J [A/m] or constant volume magnetzaton M [A/m]. Furthermore, although the volume element could have an arbtrary number of nodes (the equatons below reflect ths case), the mplementaton has been done only for a 8-node hexahedron, whch s the most useful modellng element for col wndng packs. To smplfy the notaton, t s useful to defne local reference frames. In the case of a current flament or a localsed magnetc moment we defne a local reference frame (x,y,z ) orented such that the z axs has the drecton of the current, or of the magnetc moment, and centered n the center of the current flament, or n the locaton of the magnetc moment. The orentaton of the other two axes, x and y, s nessental, as the results are nvarant for a rotaton around z. Ths reference frame s schematcally shown n Fg. 5. Fgure 5. Local reference frames on faces and sdes of a source volume. 11

Fgure 6. Local reference frames on faces and sdes of a source volume. In the case of a volume element we defne two frames, one on the plane faces and one on the sdes of the element. For the -th plane face delmtng the volume we defne the local reference frame (x,y,z ) wth z axs orented towards the external of the element. Ths reference frame s shown schematcally n Fg. 6. Note that wth ths choce the z component of the dstance vector between a feld calculaton pont and a source pont on the face s a constant. In turn, each face s delmted by straght sdes. For the j-th sde we defne a local reference frame (x,y,z ) wth z axs parallel to z defned above, and y parallel to the sde. Ths reference frame s also shown schematcally n Fg. 6. Note that wth ths choce the y component of the dstance vector between a feld calculaton pont and a source pont on the face s a constant. Furthermore, the equatons descrbng the sde becomes y = and z =. In general, the versors n the drecton of the axes of the local reference frames ((x,y,z ) or (x,y,z )) are ndcated as t, s, and n respectvely. The transformaton of a vector g from the cartesan frame (x, y, z) to the cartesan frame (t, s, n) s obtaned by the followng matrx relatons: " g x g ( x,y,z) = g y # g z " g t g ( t,s,n) = g s # g n " t x s x n x " = t y s y n y # t z s z n z # g t g s g n " t x t y t z " = s x s y s z # n x n y n z # = Tg ( t,s,n) (36) g x g y g z = T (1 g ( x,y,z) (37) 1

Magnetc feld calculaton Flamentary current The magnetc feld generated n a pont (x P,y P,z P ) by a straght flament of current I wth extremes (x C1, y C1, z C1 ) and (x C, y C, z C ) s gven n the local coordnate frame (x, y, z ) orented along the flament and shown n Fg. 5: B x = "µ I 4#, y p, x p +y, p, +, L " z p x p +y p + L " z p) ( + - L + z / p / x p +y p + L / + z p) / (./ (38) B y = µ I 4", x p, x p +y, p, +, L # z p x p +y p + L # z p) ( + - L + z / p / x p +y p + L / + z p ) / (./ (39) B z = (4) where L s the total length of the current flament, and x P, y P, z P are the coordnates of the feld pont n the local reference frame (x, y, z ). The components of the feld n the global reference frame (x, y, z) are obtaned by rotaton of the above values usng Eq. (36). Unform current densty n a sold volume The magnetc feld generated by a current densty dstrbuton n an arbtrary volume V s gven by: B = µ 4" J # r dv (41) V r 3 where r s the vector from the source pont (x Q, y Q, z Q ) to the feld pont (x P, y P, z P ): r = [ x P " x Q y P " y Q z P " z Q ] (4) We make the hypothess that the current densty s constant n the volume, and that the volume s delmted by plane faces. In ths case the calculaton of (41) can be performed analytcally usng the procedure devsed n (Colle, 1976) to frst reduce volume ntegrals to surface ntegrals, and then reduce surface ntegrals to lne ntegrals. We sketch here the process, wthout enterng n the detals of the method descrbed n the above reference. 13

As the current densty s constant, the ntegral n Eq. (4.6) can be wrtten: B = µ 4" J # r r dv (43). 3 V The vector n the ntegral can be wrtten as follows 3 : r r = "# 1 ) 3 r( (44). If we ndcate wth S the surface boundng the volume V, and wth n ts normal pontng towards the outsde of the element, we can use the followng property of vector functons: # "g dv = # gn ds (45) V S whch relates the volume ntegral of the dvergence of g to the flux of g over the surface S. We can transform the ntegral n Eq. (4.8) as follows: B = " µ 4# J ) ( n ) S 1 + r ds ), -) (46). Above we have ndcated wth S the -th plane surface composng the boundary of the volume element, and wth n ts normal (constant on the surface S ). As the ntegral s nvarant to a change of reference frame, we can choose that each surface ntegral s performed on the local reference frame (x, y, z ) shown n Fg. 6. In ths frame a pont on the surface S has coordnates (x Q, y Q, ), and the feld pont (x P, y P, z P ) s hence at a constant dstance along z. We can reduce further the dmenson of the ntegral by usng the followng vector relaton: " # g ds = g # s dl (47) S l where l s the curve enclosng the surface S, s s the normal to the curve, n the plane of S, pontng towards the outsde of the surface, and the dvergence s ntended as taken n the plane (.e. no dervatve n the drecton n normal to S). To apply Eq. (47) we use the dentty: 1 r = " # r r + z P ) ( (48). 3 the gradent s taken wth respect to the source pont (.e. the runnng varable n the ntegraton). 14

where we have defned the vector r wth components: r= [ x P "x Q y P "y Q ] (49). Usng Eqs. (47) and (48), we have that Eq. (45) yelds: B = " µ - 4# J /. n ) / ( j l j r r + z P 1 / s j dl, + 3 / (5). Above we have ndcated wth l j the j-th straght lne of the boundary of the surface S, and wth s ts normal (constant on the lne l ). We choose now to ntegrate n the local reference frame (x, y, z ) shown n Fg. 6. In ths frame a pont on the lne l has coordnates (x Q,, ), and the feld pont (x P, y P, z P ) s hence at a constant dstance both along y and z. Furthermore, the product r s j s the dstance of the feld pont along y, and we can hence wrte: B = µ, 4" J #. n 1 - ( y P /. j l j r + z P ). dl + 1. (51). The last step s to solve the lne ntegral above. The general soluton s: 1 " r + z dx = ln x + r ( ) + z x z y tg#1 where we have ndcated wth x ) # tg #1 )) = I 1 x, y,z yr ( y (( ( ) (5) r = x + y + z (53). We can use the above result to wrte the followng expresson for the magnetc feld: B = " µ, 4# J. - n ( y P I 1 x Q "x P, y P,z P /. j [ ( ) " I 1 ( x Q1 "x P, y P,z P )] ). + 1. (54) where we have ndcated wth x Q1 and x Q the coordnates of the begnnng and end of the lne l j, and we have made use of the fact that n the reference frames (x, y, z ) and (x, y, z ) the z-coordnate of the fld pont s the same,.e. we have z P = z P. 15

Localsed magnetc moment The magnetc feld generated n a pont (x P,y P,z P ) by a localsed magnetc moment P located at (x M, y M, z M ) s gven n the local coordnate frame (x, y, z ) orented along the magnetc moment and shown n Fg. 5: B " = 3µ P 4# B " = 3µ P 4# B " = µ P 4# x P z P x P +y ( P +z P ) (55) 5 / y P z P x P +y ( P +z P ) (56) 5 / z P x P y P x P +y ( P +z P ) (57) 5 / where P s the module of the magnetc moment and x P, y P, z P are the coordnates of the feld pont n the local reference frame (x, y, z ). The components of the feld n the global reference frame (x, y, z) are obtaned by rotaton of the above values usng Eq. (36). Unform magnetzaton n a sold volume The magnetc feld generated by a unform magnetzaton n a volume can be obtaned n dfferent ways. We choose here the followng expresson: µ M " µ ) B = ( " µ ) 4# M r r 3 dv V 4# M r r 3 dv V nsde the volume V outsde the volume V (58) where we used common conventons n vector calculus, and n partcular the defnton of the operator: M " # = M x x o +M y y o +M z z o (59). Examnng Eq. (58) we see that the volume ntegral s the same as already solved for the magnetc feld,.e. Eq. (43). It s hence possble to use the result obtaned there, and n partcular Eq. (54), to wrte: 16

" µ 4# M r r dv = 3 V = " µ. 4# M ( / n y P 1 ) j I 1 x Q "x P, y P,z P [ ( ) " I 1 ( x Q1 "x P, y P,z P )] + - 3, 4 (6) The gradent s ntended to be taken wth respect to the feld pont. The dervaton of the expresson under the summatons can be smplfed by recallng that: " "x = " "x "x "x + " "y "y "x + " "z "z "x = t x " "x + s x " "y + n x " "z (61). where we used the components of the versors t, s, n n the frame (x, y, z) as defned n Eqs. (36) and (37). It s hence possble to derve the expresson under the summaton n the local frame (x, y, z ) and transform the dervatves n the frame (x, y, z) usng Eq. (61) and analogous for the other drectons to solve Eq. (6). Vector potental calculaton Flamentary current The vector potental generated n a pont (x P,y P,z P ) by a straght flament of current I wth extremes (x C1, y C1, z C1 ) and (x C, y C, z C ) s gven n the local coordnate frame (x, y, z ) orented along the flament and shown n Fg. 5: A x = A y = ) # I A z = µ 4" ln z p + L + x # p +y p + z p + L + ( + ( #,ln z p, L + x # p +y p + z p, L - ( / ( /. (6) (63) (64) where L s the total length of the current flament, and x P, y P, z P are the coordnates of the feld pont n the local reference frame (x, y, z ). The components of the vector potental n the global reference frame (x, y, z) are obtaned by rotaton of the above values usng Eq. (36). 17

Unform current densty n a sold volume We use here the same technque as used for the magnetc feld calculaton. The the vector potental A generated by an arbtrary dstrbuton of current J n a volume V s: A = µ 4" # J r dv (65) V where r s the vector from the source pont (x Q, y Q, z Q ) to the feld pont (x P, y P, z P ) defned as n Eq. (4). Under the hypothess of constant current densty, we have: A = µ 4" J # 1 r dv (66). V The scalar n the ntegral can be wrtten as follows: 1 r = 1 " # r ) r ( (67). and n accordance wth the relaton Eq. (45) we can transform the volume ntegral of Eq. (67) n the followng surface ntegral: A = µ J ( 4" )( S r # n r ( ds+,( (68) Above we have ndcated wth S the -th plane surface composng the boundary of the volume element, and wth n ts normal (constant on the surface S ). We choose that each surface ntegral s performed on the local reference frame (x, y, z ) shown n Fg. 6. In ths frame the scalar product r n s constant, and s equal to z P, the z component of the dstance of the feld pont from the surface. Based on ths, the surface ntegral becomes: A = µ 4" J 1 ( 1 ) z P # r ds + S (69) We note now that the surface ntegral n Eq. (69) s dentcal to that already solved for the magnetc feld generated by a unform current densty n a volume element, n Eq. (46). We can use the procedure already detaled there to obtan the followng summaton of lne ntegrals n the local reference frame (x, y, z ): A = µ + 4" J -, 1.- 1 z P y P # j l j r + z P (/ - dl ) 1 - (7). 18

Fnally, usng the defnton of the prmtve n Eq. (5), we have: A = µ + 4" J -, 1.- z P y P I 1 x Q #x P, y P,z P j [ ( ) # I 1 ( x Q1 #x P,y P,z P )] (/- ) 1 - (71). where we have ndcated wth x Q1 and x Q the coordnates of the begnnng and end of the lne l j, and we have made use of the fact that n the reference frames (x, y, z ) and (x, y, z ) the z-coordnate of the fld pont s the same,.e. we have z P = z P. Localsed magnetc moment The vector potental generated n a pont (x P,y P,z P ) by a localsed magnetc moment P located at (x M, y M, z M ) s gven n the local coordnate frame (x, y, z ) orented along the magnetc moment and shown n Fg. 5: A x = " A y = A z = µ P y P 4# x P +y P +z P ( ) µ P x P 4" x P +y P +z P ( ) (7) (73) (74) The vector potental generated n a pont (x P,y P,z P ) by a localsed magnetc moment P located at (x M, y M, z M ) s gven n the local coordnate frame (ξ, η, ζ) orented along the magnetc moment: where P s the module of the magnetc moment and x P, y P, z P are the coordnates of the feld pont n the local reference frame (x, y, z ). The components of the vector potental n the global reference frame (x, y, z) are obtaned by rotaton of the above values usng Eq. (36). Unform magnetzaton n a sold volume The the vector potental A generated by an arbtrary dstrbuton of magnetzaton M n a volume V s: A = µ 4" M # r dv (75) V r 3 where r s the vector from the source pont (x Q, y Q, z Q ) to the feld pont (x P, y P, z P ) defned as n Eq. (4). Under the hypothess of constant magnetzaton densty, we have: 19

A = µ 4" M # r r dv (76) 3 V The above ntegral s dentcal to the expresson for the magnetc feld generated by a constant current densty n a volume (see Eq. (43)), where the vector potental takes the place of the magnetc feld and the magnetzaton takes the place of the current densty. Under the hypothess of a volume delmted by plane faces, and usng the local coordnate frame (x, y, z ) as shown n Fg. 6, we have: A = " µ, 4# M. - n ( y P I 1 x Q "x P, y P,z P /. j [ ( ) " I 1 ( x Q1 "x P, y P,z P )] ). + 1. (77) where the prmtve I 1 s defned n Eq. (5), and we have ndcated wth x Q1 and x Q the coordnates of the begnnng and end of the lne l j. References (Beth, 1966) R.A. Beth, Complex Representaton and Computaton of Two- Dmensonal Magnetc Felds, J. Appl. Phys, 37 (7), 568-571, 1966. (Beth, 1967) R.A. Beth, An Integral Formula for Two-Dmensonal Felds, J. Appl. Phys, 38 (1), 4689-469, 1967. (Colle, 1976) (Halbach, 197) C.J. Colle, Magnetc Felds and Potentals of Lnearly Varyng Current or Magnetsaton n a Plane Bounded Regon, Proceedngs of Compumag Conference, Oxford, 86-95, 1976 K. Halbach, Felds and Frst Order Perturbaton Effects n Two- Dmensonal Conductor Domnated Magnets, Nucl. Inst. and Meth., 78, 185-198, 197.