div B and curl B for the current loop
We have stated above that the two components of the magnetic field are really the transverse and longitudinal components respectively. Thus, in cylindrical coordinates we have the z -component as defined. and what was calculated as the x -component is really the component along the radial direction. Due to the symmetry of the field (circular current loop) there is no phi-component of the magnetic field. We re-define our previously calculated components, and use the variable r to specify the cylindrical radial variable (often denoted by rho, to set it apart from the spherical radial coordinate). We do not specify the amount of current, or the radius of the loop R .
> restart; with(linalg): with(plots):
Warning, new definition for norm
Warning, new definition for trace
> Qp:=(Q+R)^2+a^2: Qm:=(Q-R)^2+a^2:
> Qr:=2*sqrt(Q*R/Qp);
> Brex:=i_L*a/(5*10^(6))/(sqrt(Qp)*Q)*((R^2+Q^2+a^2)*EllipticE(Qr)/Qm-EllipticK(Qr));
> Bra:=unapply(Brex,Q,a):
> Bzex:=i_L/(5*10^(6))/sqrt(Qp)*(EllipticE(Qr)*(R^2-Q^2-a^2)/Qm+EllipticK(Qr));
> Bza:=unapply(Bzex,Q,a):
The first property we wish to demonstrate is the fact that there are no magnetic charges, i.e., that the B field is divergence free. The divergence in cylindrical coordinates is given as follows [it is part of the linalg package loaded before]:
>
B := vector([Br(r,z), 0, Bz(r,z)]): v := vector([r, phi, z]):
divB:=diverge(B, v, coords=cylindrical);
Here we have made use of the fact that there is no phi-component of the magnetic field.
Let us see what the calculation tells us about the divergence of the magnetic field for the current loop.
> divBcl:=simplify(subs(Br(r,z)=Bra(r,z),Bz(r,z)=Bza(r,z),divB));
Indeed, the magnetic field for the current loop is divergence-free. The student is encouraged to look at the result before the simplify command is applied to see how the cancellation occurs.
We can continue with a calculation of the curl. According to Maxwell's equations the curl of the vector field B should be related to the rate of change of electric fields, and the current density. If we assume that we have no electric field present, and if we stay away from the current loop (assumed to be of infinitesimal extent), then we should calculate that the field is curl-free.
>
B := vector([Br(r,z), 0, Bz(r,z)]): v := [r, phi, z]:
rotB:=curl(B, v, coords=cylindrical);
The reader is encouraged to look at the expression in the general case with non-vanishing phi-component of the field.
For our special case of the current loop we have the following [note that the subs command has to substitute into a vector quantity, thus the op()!] :
> rotBcl:=simplify(subs(Br(r,z)=Bra(r,z),Bz(r,z)=Bza(r,z),op(rotB)));
It is worthwhile to look at the individual parts that get cancelled below.
> simplify(diff(Bra(r,z),z))-simplify(diff(Bza(r,z),r));
We can arrive at a more general conclusion: whenever the situation is as simple as discussed here from a symmetry point of view (vanishing phi-component), the two statements (divergence-free, and curl-free properties of the magnetic field; the first statement is always true, the second requires no time-varying electric fields, and no current density in the spatial region considered) can be combined to relate variations in the radial and transverse components of the field.
>