How Magnets Work: Magnetic Field Equations and the Electric-Magnetic Connection


Magnets feel mysterious at first because magnetic effects are invisible. You can feel a pull or push, but you cannot directly see the field that causes it. A useful way to learn magnetism is to connect three layers: field intuition, equations, and physical consequences. This article follows that path and then links magnetism to electricity through the core laws that unify them.

Magnetic Field Intuition

A magnetic field is a vector field, meaning each point in space has both a direction and a strength. For permanent magnets, field lines emerge from the north pole and re-enter at the south pole outside the magnet. For electric currents in wires, field lines form circles around the wire. These line drawings are not literal strings in space. They are maps of direction: a compass needle aligns tangent to the local field line.

The first strong pattern to remember is this: moving electric charge creates magnetic field. Inside many permanent magnets, electrons contribute tiny magnetic moments, and in ferromagnetic materials many of those moments align in domains. When enough domains line up, the net field becomes strong and measurable outside the material.

Magnetic Field Around a Current-Carrying Wire

For a long straight wire carrying current II, the magnetic field magnitude at distance rr is

B=μ0I2πrB = \frac{\mu_0 I}{2\pi r}

where μ0\mu_0 is the permeability of free space. This gives two immediate predictions:

  1. Increase current and the field grows linearly.
  2. Move farther from the wire and the field drops as 1/r1/r.

Use the interactive visual below as a top view of the wire. The small arrows behave like compass needles: they rotate to show local field direction. Change current direction (dot vs cross) to see the circulation reverse, then change distance to see the magnitude fall with 1/r1/r.

B=μ0I2πrB = \frac{\mu_0 I}{2\pi r} | I = 10 A | r = 10 cm | B = 20.0 uT | direction: counterclockwise

One practical comparison helps anchor the numbers. Earth’s magnetic field near the surface is typically on the order of tens of microtesla. So when the visualization shows similar values, you are looking at the same rough scale as everyday compass behavior.

Force on Moving Charge: From Field to Motion

A magnetic field does not push every charge in every situation. If charge is stationary, magnetic force is zero. If charge moves, the magnetic part of Lorentz force appears:

F=qv×B\mathbf{F} = q\,\mathbf{v} \times \mathbf{B}

The cross product means force is perpendicular to both velocity and magnetic field. That perpendicular nature is why magnetic fields often bend trajectories rather than speeding particles up along their direction of motion. In a uniform field, charged particles can move in circles or helices, which is the operating idea behind devices like cyclotrons and mass spectrometers.

The direction part is where many learners struggle. For positive charge, use the right-hand rule directly on v×B\mathbf{v} \times \mathbf{B}. For negative charge, reverse the direction.

Use the visualizer as a motion-first view of the same law. Instead of only showing arrows, it animates a charged particle path in a uniform field. Try this sequence: increase speed to grow orbit radius, increase field to shrink orbit radius, then flip charge sign or field direction to reverse bend direction.

Trajectory: clockwise circle | radius r = 1.80 (arb.)

Magnetism from Ampere’s Law

The wire equation above is one specific case. The more general statement is Ampere’s law (with Maxwell’s correction in full form):

Bdl=μ0Ienclosed+μ0ϵ0dΦEdt\oint \mathbf{B}\cdot d\mathbf{l} = \mu_0 I_{\text{enclosed}} + \mu_0\epsilon_0\frac{d\Phi_E}{dt}

For steady currents, the changing-electric-flux term is zero, and magnetic circulation is tied to enclosed current. That is why loops around current are natural in field diagrams. The law also explains why coils concentrate magnetic effects: multiple turns stack contribution and can produce strong nearly uniform fields near the coil axis.

This is also the bridge from simple wires to electromagnets. A ferromagnetic core increases field strongly because the material response increases magnetic flux density for the same current. That is why relays, motors, and transformers use core materials instead of air whenever possible.

Changing Magnetic Field Creates Electric Field

So far, electricity created magnetism. The reverse is also true. Faraday’s law states that changing magnetic flux induces electric circulation:

E=dΦBdt\mathcal{E} = -\frac{d\Phi_B}{dt}

The minus sign encodes Lenz’s law: the induced effect opposes the flux change that produced it. In differential form this becomes

×E=Bt\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}

which says a time-varying magnetic field generates a circulating electric field. This is deeper than “a wire cuts field lines.” Even without a metal conductor, changing B\mathbf{B} implies a rotational E\mathbf{E} field in space.

In the visualization below, the blue signal is B(t)B(t) and the red signal is proportional to dB/dt-dB/dt. When BB changes fastest, induced electric circulation is largest. When BB reaches a peak (slope near zero), induced circulation drops near zero.

E=dΦBdt\mathcal{E} = -\frac{d\Phi_B}{dt} and ×E=Bt\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}

t = 0.0 s | B = 0.00 T | induced E circulation = -6.22 (arb.)

This phase relationship is central to AC generators and transformers. Generators rotate coils or magnets so flux varies in time; transformers use AC current to create time-varying flux that induces voltage in secondary windings.

Maxwell’s Equations and the Electric-Magnetic Pair

The complete coupling appears in Maxwell’s equations:

E=ρϵ0\nabla\cdot\mathbf{E} = \frac{\rho}{\epsilon_0} B=0\nabla\cdot\mathbf{B} = 0 ×E=Bt\nabla\times\mathbf{E} = -\frac{\partial\mathbf{B}}{\partial t} ×B=μ0J+μ0ϵ0Et\nabla\times\mathbf{B} = \mu_0\mathbf{J} + \mu_0\epsilon_0\frac{\partial\mathbf{E}}{\partial t}

Two lines are especially important for the electric-magnetic connection:

  1. Changing B\mathbf{B} creates circulating E\mathbf{E}.
  2. Changing E\mathbf{E} creates circulating B\mathbf{B}.

That mutual coupling supports electromagnetic waves. A changing electric field generates magnetic field, and changing magnetic field generates electric field, allowing propagation through space. The wave speed from these constants is

c=1μ0ϵ0c = \frac{1}{\sqrt{\mu_0\epsilon_0}}

which matches the measured speed of light. That is the key unification result: light is an electromagnetic wave.

Common Mistakes and a Practical Workflow

Frequent mistakes in magnetism problems are predictable:

  • Mixing up field direction and force direction.
  • Forgetting that magnetic force requires motion of charge.
  • Ignoring the sign of charge in direction rules.
  • Treating induction as depending on flux value instead of flux change rate.

A reliable workflow is:

  1. Draw vectors first: v\mathbf{v}, B\mathbf{B}, and geometry.
  2. Decide which law fits the scenario (wire field, Lorentz force, Ampere, or Faraday).
  3. Predict direction before computing magnitude.
  4. Compute magnitude and compare against scale intuition (microtesla, millitesla, tesla).
  5. Check limiting cases, such as v=0v=0 or constant flux, to catch conceptual errors.

Recap

Magnets are not separate from electricity. Magnetic fields arise from moving charge and magnetic moments, and their effects are captured quantitatively by field equations. Lorentz force connects field to particle motion, Ampere’s law connects current to magnetic circulation, and Faraday’s law connects changing magnetic flux to induced electric fields. In Maxwell’s full system, electric and magnetic fields are a single coupled framework, and electromagnetic waves are a direct consequence of that coupling.

If you can move comfortably between intuition, vector direction, and equations, magnetism becomes predictable instead of mysterious.