Hover over the menu bar to pick a physics animation.

Magnetic Field of a Long Solenoid Coil

Mathematics for solenoid magnetic field

We will compute the `bbB` field due to a solenoid of a given number of turns using the Biot-Savart (BS) law.

`bbB(bbr)=mu_0int_C(Idbblxxbbr')/|bbr'|^3`

where `C` is the full path of the current in the length increments, `bbl`, and `bbr'=bbr-bbl` and `I` is the current in the given solenoid loop. We'll assume that radius of the 'wire' in the single loop is zero.

Field for a Single Solenoid Current Loop

We need to compute the BS integral for a circular loop for any radius as well as axial location, `z'`. Let the current loop lie at `z'=z_("loop"` and its radius be `a_E`. Then a description for any source point `bbr_s` on the loop would be

`bbr_s(phi)=bbl(phi)=a_Ecosphibbhatx+a_Esinphibbhaty+z'bbhatz)`

A description for the length increment `dbbl` is found by taking the derivative with respect to `phi`.

`dbbl(phi)=a_E(-sinphibbhatx+cosphibbhaty)dphi`

The expression for the field point will be

`bbr=xbbhatx+zbbhatz`

where the loop field is symmetrical about the loop axis so we don't need to specify a `y` component for the field point. The value of `bbr-bbl` is then

`bbr'=bbr-bbl=(x-a_Ecosphi)bbhatx-a_Esinphibbhaty+(z-z')bbhatz`

A cross product operation `xx` is defined in `(x,y,z)` coordinates as

`dbblxxbbr'=bbuxxbbv=|[bbhatx,bbhaty,bbhatz], [u_x,u_y,u_z], [v_x,v_y,v_z]|= (u_yv_z-u_zv_y)bbhatx-(u_xv_z-u_zv_x)bbhaty+(u_xv_y-u_yv_x)bbhatz`

In our particular symbols this is:

`dbblxxbbr'=bbuxxbbv=|[bbhatx,bbhaty,bbhatz], [-a_Esinphidphi,a_Ecosphidphi,0], [x-a_Ecosphi,y-a_Esinphi,z-z']|=`

`[a_E(z-z')cosphidphi]bbhatx-`
`[-(z-z')a_Esinphidphi]bbhaty+`
`[-a_Esinphidphi(y-a_Esinphi) -a_Ecosphidphi(x-a_Ecosphi)]bbhatz`

Recall that the integrand is this quantity divided by `|bbr-bbl(phi)|^3`. We now have everything we need for the BS integral

`bbB(bbr)=mu_0int_C(Idbblxxbbr')/|bbr'|^3`

We will set `mu_0=1` and, to start, let `I=1" ampere"` for each current loop.

Learner Range Contol

The only controlled variable available is the number of coil turns which also increases the total length of the coil. The width of the axial field magnitude, `|B|`, Vs `z` plot is proportional to the length of the coil.

Equal values of `|bbvecB|` are plotted as contours
Arrows are the angles of an iron filing array
All colors are scaled to the color bar at left

Appendix: Interaction of the Permanent Magnet Field with the Solenoid Current

In this Appendix we will assume that any current in the solenoid does not affect the magnetization or dipole moment of the permanent magnet (PM). Another assumption is that the PM's magnetization is along the axis of the solenoid which could result in the largest interaction between the PM and the solenoid.

The pertinent equation for any interaction is one of Maxwell's equations.

`bbgradxxbbvecE=-(delbbvecB)/(delt)`

where `bbvecE` is the electric field and `bbvecB` is the magnetic induction (which we will call the magnetic field here). To make use of this equation we will apply Stokes Theorem

`intintgradxxbbvecEdA=oint(bbvecE.dbbvecl)=del/(delt)intbbvecB*dbbA`

where the integral on the right is the sum of the magnetic flux going through the area an loop. So the integral of the electric field around a closed loop is equal to the time derivative of the integral of the magnetic field over an area which which is bounded by that loop. In our case the loop will be one of the wire turns of the solenoid. If the solenoid turn is circular of radius `a_t`, then we can say that

`oint(bbvecE.dbbvecl)=2pia_t|bbvecE|=del/(delt)intbbvecBbb*dA`

The voltage per turn, `V_t` is just equal to the expression on the left so we can conclude that

`V_t=del/(delt)intintbbvecB*dbbA`

It is the permanent magnet that provides the magnetic field `bbvecB`. If the permanent magnet is moving in the `z` (axial) direction then the variation of `B_z` with time can be written:

`(dB_z)/(dt)=((dB_z)/dz)(dz/dt)`

where `dz/dt` is the z component of relative velocity between the solenoid and the PM. Then, assuming that `B_z` is constant over the loop the previous equation becomes

`V_t=2pia_t^2(dB_z)/dzdz/dt`

Then the current, `i`, in a turn is related to its resistance, `R`, as

`i=V_t/R`

If we have `N` turns all with this same current then the solenoid's axial magnetic field, `Bs_z`, due to that current is approximately

`Bs_z=(2mu_0Ni)/(2L+2a_t)`

where `L` is the length of the solenoid.

That seems like it's all cut and dried but it isn't

This is where the rubber meets the road. If you consider the magnetization of a cylindrical permanent magnet, you will note that the axial fields from both ends are the same in both direction and magnitude (see Canvas 1). So the magnet `bbvecB` is symmetrical with respect z axis. When we take the derivative with respect to `z` we get a positive result at the magnet's tail end and a negative result at the magnet's leading end. And when we multiply these results by the magnet's `dz/dt` we still have the positive and negative results. When we apply these results to the solenoid turns, we have the leading part of the magnet trying to induce counter-clockwise current and the trailing part trying to induce clockwise current. Another way of expressing this is that we have a combination of negative and positive voltages on the coil and the result is zero current. What can be a solution to this predicament? As shown on Canvas 1, we can make the magnet longer than the solenoid. Then during part of the magnet's travel the voltages will not be cancelling so we can obtain some current.

How does the solenoid current affect the magnet's motion?

The solenoid current will always cause a magnetic field, `Bs_z` that is opposite to that of the permanent magnet field. So it will oppose the motion of the of the PM by a force that is proportional to the product `F_z=cBs_z*Bm_z` where c is a constant. Since the magnet is moving, the power being absorbed is `P_z=F_zdz/dt`. This is also the power that is being absorbed by the resistance of the solenoid plus any load resistors in the circuit that connects the ends of the solenoid.