Accelerator guide fields
Magnetic fields are also used to produce special particle trajectories in high energy particle accelerators. Machines like the cyclotron and synchrotron bring particles to high energies by passing the particles repeatedly through a strong electric field. The particles are held in their cyclic orbits by a magnetic field.  We have seen that a particle in a uniform magnetic field will go in a circular orbit. This, however, is true only for a perfectly uniform field. Imagine a field $B$ which is nearly uniform over a large area but which is slightly stronger in one region than in another. If we put a particle of momentum $p$ in this field, it will go in a nearly circular orbit with the radius $R=p/qB$. The radius of curvature will, however, be slightly smaller in the region where the field is stronger. The orbit is not a closed circle but will “walk” through the field, as shown in Fig. 29–10. We can, if we wish, consider that the slight “error” in the field produces an extra angular kick which sends the particle off on a new track. If the particles are to make millions of revolutions in an accelerator, some kind of “radial focusing” is needed which will tend to keep the trajectories close to some design orbit. Another difficulty with a uniform field is that the particles do not remain in a plane. If they start out with the slightest angle—or are given a slight angle by any small error in the field—they will go in a helical path that will eventually take them into the magnet pole or the ceiling or floor of the vacuum tank. Some arrangement must be made to inhibit such vertical drifts; the field must provide “vertical focusing” as well as radial focusing. One would, at first, guess that radial focusing could be provided by making a magnetic field which increases with increasing distance from the center of the design path. Then if a particle goes out to a large radius, it will be in a stronger field which will bend it back toward the correct radius. If it goes to too small a radius, the bending will be less, and it will be returned toward the design radius. If a particle is once started at some angle with respect to the ideal circle, it will oscillate about the ideal circular orbit, as shown in Fig. 29–11. The radial focusing would keep the particles near the circular path. Actually there is still some radial focusing even with the opposite field slope. This can happen if the radius of curvature of the trajectory does not increase more rapidly than the increase in the distance of the particle from the center of the field. The particle orbits will be as drawn in Fig. 29–12. If the gradient of the field is too large, however, the orbits will not return to the design radius but will spiral inward or outward, as shown in Fig. 29–13. We usually describe the slope of the field in terms of the “relative gradient” or field index, $n$: \begin{equation} \label{Eq:II:29:2} n=\frac{dB/B}{dr/r}. \end{equation}  A guide field gives radial focusing if this relative gradient is greater than $-1$. A radial field gradient will also produce vertical forces on the particles. Suppose we have a field that is stronger nearer to the center of the orbit and weaker at the outside. A vertical cross section of the magnet at right angles to the orbit might be as shown in Fig. 29–14. (For protons the orbits would be coming out of the page.) If the field is to be stronger to the left and weaker to the right, the lines of the magnetic field must be curved as shown. We can see that this must be so by using the law that the circulation of $\FLPB$ is zero in free space. If we take coordinates as shown in the figure, then \begin{equation} (\FLPcurl{\FLPB})_y=\ddp{B_x}{z}-\ddp{B_z}{x}=0,\notag \end{equation}  or \begin{equation} \label{Eq:II:29:3} \ddp{B_x}{z}=\ddp{B_z}{x}. \end{equation}  Since we assume that $\ddpl{B_z}{x}$ is negative, there must be an equal negative $\ddpl{B_x}{z}$. If the “nominal” plane of the orbit is a plane of symmetry where $B_x=0$, then the radial component $B_x$ will be negative above the plane and positive below. The lines must be curved as shown. Such a field will have vertical focusing properties. Imagine a proton that is travelling more or less parallel to the central orbit but above it. The horizontal component of $\FLPB$ will exert a downward force on it. If the proton is below the central orbit, the force is reversed. So there is an effective “restoring force” toward the central orbit. From our arguments there will be vertical focusing, provided that the vertical field decreases with increasing radius; but if the field gradient is positive, there will be “vertical defocusing.” So for vertical focusing, the field index $n$ must be less than zero. We found above that for radial focusing $n$ had to be greater than $-1$. The two conditions together give the condition that \begin{equation*} -1<n<0 \end{equation*}  if the particles are to be kept in stable orbits. In cyclotrons, values very near zero are used; in betatrons and synchrotrons, the value $n =-0.6$ is typically used. 