Worksheet 8

PHY201, 1999
Donev Aleksandar

Problem I-Magnetic Field of a Ring

Part a) Biot-Savart Law

In this problem we need to use Biot-Savart's law for the magnetic field of an arbitrary current distribution:
		B=∫(((Subscript[μ, 0]) I)/(4  π))((dl × r )/(r^3)) where r=(Subscript[r, ring])-(Subscript[r, point])
  
 We therefore need the radius vector of the element of the ring over which we perform the integration and the radius of the point of observation, which we take to be in the xz plane:

Remove["Global`*"]
Rring = {Cos[theta], Sin[theta], 0};
Rpoint = {x, 0, z};
R = Rpoint - Rring;

Now we use Bio-Savart's law to find the magentic field from a current element of the ring, and we discard all constants for simplicity. Also, we need the vector dl for the current element:

dI = Cross[{0, 0, 1}, Rring];
mag[a_] := Sqrt[a . a];
dB = Simplify[Cross[dI, R]/mag[R]^3]

Now we can perform the integration over θ to finf the total magnetic field. The integrals can be simplified a lot more, but Mathematica needs more help to do that. Since we are going to evaluate them numerically anyway, that doesn't matter:

Bx = Simplify[Integrate[dB[[1]], {theta, 0, 2*Pi}]]

Try to see why the y component is zero:

By = Simplify[Integrate[dB[[2]], {theta, 0, 2*Pi}]]

Bz = Simplify[Integrate[dB[[3]], {theta, 0, 2*Pi}]]

Part b) Some Special Cases

At the axis of the ring (x,y=0), the field can be found very easily and is found in many textbooks:

\(B = {Bx, By, Bz}; 
Baxis = Limit[B, x -> 0]\)

At the center of the ring:

Bcenter = Baxis /. z -> 0

Also, for Problem 2 in Fortran, we will need values of the magnetic field at some point (to check our answers against it). Just as in Worksheet 1, here we again have two options for performing the integration. First, we can simply evaluate the analytical result at a specific point:

Subst = {x -> 0.3, z -> 0.6}N[B /. Subst, 15]

Or, we can integrate numerically in the first place (notice the interesting conclusion Mathematica makes about the y component):

Bxnum = NIntegrate[dB[[1]] /. Subst, {theta, 0, 2*Pi}]Bynum = NIntegrate[dB[[2]] /. Subst, {theta, 0, 2*Pi}]Bznum = NIntegrate[dB[[3]] /. Subst, {theta, 0, 2*Pi}]

You should remember that in this case it is better to use the analytic solution (we were lucky enough to have it), since Mathematica has very fast ways of evaluating the special Elliptic functions that appear in the solution.
  So at the point {0.3,0.6} (in the xz plane), the field is {0.822381,3.88234}. We will use this in the Fortran part.

Part c) The Magnetic Field

This is identical to the procedure for plotting vector fields in the previous worksheets. Can you tell where the ring is on the graph?

<< Graphics`PlotField`PlotVectorField[{Bx, Bz}, {x, -2, 2}, {z, -1, 1}, 
      PlotPoints -> 20, MaxArrowLength -> 7.5, ScaleFactor -> 1]