Symbolic Analysis of Magnetic Field with Symbolic Analysis of Magnetic Field with the Biot-Savart-Laplace Method

Daniel Ioan and Irina Munteanu

9.1  Problem 1 - Current-carrying segment

Calculate the contribution to the magnetic field of a straight filamentary conductor of length l, carrying the current Io, in an exterior point placed at the distance r from the conductor.

Solution

> restart:with(linalg): # initialize session and allow work with vectors

Warning, new definition for norm

Warning, new definition for trace

> i:=vector([1,0,0]);j:=vector([0,1,0]);k:=vect or([0,0,1]); # unit vectors of the coordinate axes


i : = [1,  0,  0]


j : = [0,  1,  0]


k : = [0,  0,  1]

> R := -x*i + r *j; # Vector source-field


R : = - x i + r j

> R := evalm(");


R : = [ - x,  r,  0]

> modR := norm(R, 2); # Module of vector R


modR : =

 

|  x  | 2 + |  r  | 2
 

> assume(r, positive); # Indicate that distance r is positive

> Hz := Io /(4*Pi) * Int(dotprod(k, crossprod(i, R))/modR^3, x); # Non-definite BSL integral


Hz : = 1
4
 
Io 
r
( |  x  | 2 + r~2)3/2
 dx

p

> Hz := value(subs(x=b,Hz)-subs(x=a,Hz)); # The value of the definite BSL integral


Hz : = 1
4
  Io b
p r


|  b  | 2 + r~2
- 1
4
  Io a
p r


|  a  | 2 + r~2

Indicate how must be continued the ends of the conductor, so that the above expression has a physical significance (i.e., so that the contribution of these portions to Hz is zero).

What is the spatial orientation of the field vectors?

Which is the form and the orientation of the field lines?

> limit(Hz, a=-infinity); # for the semi-infinite conductor


1
4
 
Io (b +

 

|  b  | 2 + r~2
 
)

p r


|  b  | 2 + r~2

> limit(", b=infinity); # for the infinite conductor


1
2
  Io
p r~

Numerical application: Io = 20 A; l = 1 m; r = 0.5 m.

> evalf(subs(Io= 20, a=0, b=1, r =0.5, Hz));


2.847050172

> Hza := evalf(subs(Io= 20, b=a+1, r =0.5, Hz)); # Field variation on a line # parallel to the conductor, placed at the distance r=0.5m from the conductor


Hza : = 3.183098861  a + 1.



|  a + 1.  | 2 + .25
- 3.183098861  a



|  a  | 2 + .25

> plot(Hza, a=-2..1);

pictures/bsl_en03.gif
> Hzar := evalf(subs(Io= 20,b=a+1,Hz)); # Variation of the field magnitude in the plane of the conductor


Hzar : = 1.591549431  a + 1.
r


|  a + 1.  | 2 + r~2
- 1.591549431  a
r


|  a  | 2 + r~2

> with (plots): contourplot(Hzar,a=-1.5..0.5,r=0.05..0.5,filled=true,coloring=[yellow, red]);

pictures/bsl_en04.gif
> A:= Io /(4*Pi) * Int(1/modR, x=a..b); # The vector potential


A : = 1
4
 
Io 
b
a 
1
{ |  x  | 2 + r~2}
 dx

p

> assume(a,negative);assume(b,positive);A := value(");


A : = 1
4
 
Io (ln(b~ +

 

b~2 + r~2
 
) - ln(a~ +

 

a~2 + r~2
 
))

p

>

It must be noted that this expression of the vector potential doesn't have a finite limit when the conductor is of infinite extent, even if B exists in this case.

9.1.1  Comments to the case of the infinite conductor

The lines of the magnetic field produced by an infinitely long filamentary conductor are circles, in planes perpendicular to the conductor and with the center on the conductor. In the following figure, the current-carrying conductor is represented in red, and the one of hte field lines is represented in blue. In this figure, the conductor is oriented along the Oz axis. The magnetic field is has non-zero components only in the xOy plane, with values independent of z.

> restart: with(linalg): with(plottools): with(plots):

Warning, new definition for norm

Warning, new definition for trace

> t:=torus([0,0,0],.01,2,color=blue):

> c:= line([0,0,-2],[0,0,2],color=red,thickness=3):display(t,c,orientation=[ 45,80]);

pictures/bsl_en05.gif
The magnitude of the magnetic field intensity is H = [(Io)/(2 p r)], in which r = {x2 + y2} represents the distance from the point P (in which the field is computed) to the conductor. In order to calculate the field components, the vector product of the unit vector of the current direction and the unit vector of the position vector in the xOy plane, must be computed:

H = (k x r / r) H.

> r := vector([x,y,0]);


r : = [x,  y,  0]

> modr := sqrt(x^2+y^2);


modr : =

 

x2 + y2
 

> modH:= Io/(2*Pi*modr); # The field magnitude


modH : = 1
2
  Io
p 


x2 + y2

> k:=vector([0,0,1]);


k : = [0,  0,  1]

> H := evalm((crossprod(k,r)/modr)*modH);


H : =

- 1
2
  Io y
(x2 + y2p
,   1
2
  Io x
(x2 + y2p
,  0

> Ho := [subs(Io=1,H[1]), subs(Io=1,H[2]), 0]:

> f:=fieldplot3d(Ho,x=-1..1,y=-1..1,z=-1..1,gri d =[5,5,5],color=blue):

> display(f,c, orientation=[45,15],axes=box);

pictures/bsl_en06.gif
In what follows, some of the identities satified by the magnetic field and by the vector potential will be checked.

> B:=vector([mu*H[1], mu*H[2], 0]); # Magnetic flux density


B : =

- 1
2
  m Io y
(x2 + y2p
,   1
2
  m Io x
(x2 + y2p
,  0

> J := curl(B/mu,[x,y,z]); # Curl of H (current density)


J : =

0,  0,  - Io x2
(x2 + y2)2 p
+ Io
(x2 + y2p
- Io y2
(x2 + y2)2 p


> simplify(J[3]);


0

> diverge(B,[x,y,z]); # Divergence of the flux density


0

> vecpotent(B,[x,y,z],'A'); # Calculation of the vector potential


true

> eval(A);




1
2
  z m Io x
(x2 + y2p
,   1
2
  z m Io y
(x2 + y2p
,  0

> curl(A,[x,y,z]); # Checking the potential




- 1
2
  m Io y
(x2 + y2p
,   1
2
  m Io x
(x2 + y2p
,  0

> gf:=grad(x^2*y+sin(z),[x,y,z]); An := evalm(A+gf); curl(An,[x,y,z]); # Adding a gradient to A does not modify its curl (B)


gf : = [2 x y,  x2,  cos(z)]


An : =

1
2
  z m Io x
(x2 + y2p
+ 2 x y,   1
2
  z m Io y
(x2 + y2p
+ x2,  cos(z)




- 1
2
  m Io y
(x2 + y2p
,   1
2
  m Io x
(x2 + y2p
,  0

> diverge(A,[x,y,z]); # Vector potential calculated by Maple has nonzero divergence


- z m Io x2
(x2 + y2)2 p
+ z m Io
(x2 + y2p
- z m Io y2
(x2 + y2)2 p

In what follows, the particular vector potential oriented along the Oz axis will be calculated (this is also called logarithmic potential). To this purpose, we we solve the differential equation B = rot A , i.e. Bx = [()/(y)] A, By = - ([()/(x)] A). The vector potential is obtained by integration of the flux density.

> int(B[1],y);


- 1
4
  ln(x2 + y2m Io
p

> A:=int(-B[2],x); # The logarithmic potential


A : = - 1
4
  ln(x2 + y2m Io
p

> curl([0,0,A],[x,y,z]); # Checking the potential




- 1
2
  m Io y
(x2 + y2p
,   1
2
  m Io x
(x2 + y2p
,  0

> diverge([0,0,A], [x,y,z]);


0

> mu := 1: Io:=1:

> contourplot(A,x=-1..1,y=-1..1,color=blue);

pictures/bsl_en07.gif
> plot3d(A,x=-1..1.01,y=-1..1.01,color=red);

pictures/bsl_en08.gif
> f:=fieldplot3d([0,0,A],x=-1..1,y=-1..1,z=-1.. 1,grid =[5,5,5],color=black):

> display(f,c, orientation=[45,15],axes=box); # Vectors of the logarithmic potential

pictures/bsl_en09.gif
> eval(An);




1
2
  z m Io x
(x2 + y2p
+ 2 x y,   1
2
  z m Io y
(x2 + y2p
+ x2,  cos(z)

> f:=fieldplot3d(An,x=-1..1,y=-1..1,z=-1..1,gri d =[5,5,5],color=black):

> display(f,c, orientation=[45,15],axes=box); # Vectors of another potential yielding the same B

pictures/bsl_en10.gif
>


File translated fromTEX by TTH, version 2.62.
On 16 Feb 2000, 02:04.