Magnetic Field Visualizer Physics

Bar Magnet | Field lines show direction from N to S
2.0

What is the Magnetic Field Visualizer?

Quick Answer: An interactive tool to see magnetic field patterns for a bar magnet, solenoid, and straight current-carrying wire. Observe field lines, a compass grid showing local direction, and the Lorentz force on a moving charge. Adjust strength and toggle features to explore magnetism concepts.

Theory of Magnetostatics

Magnetic fields are produced by moving charges (currents) or intrinsic magnetic moments. Bar magnets have a dipole field approximated by two magnetic "charges" (north and south). A solenoid (coil of wire) creates a nearly uniform field inside, similar to a bar magnet. A straight wire carrying current produces circular field lines around it (right‑hand rule). The Lorentz force on a moving charge q in a magnetic field B is F = q (v × B). The simulator calculates the field using superposition of dipole formulas or Biot‑Savart law approximations. Field lines are traced via streamline integration.

Step-by-Step Examples

Example 1: Bar Magnet Dipole Field

  1. Select "Bar Magnet". The north pole (red) is on the right, south (blue) on the left.
  2. Field lines emerge from N, curve around, and enter S. Toggle "Compass Grid" to see tiny needles align with the field at each grid point.
  3. Enable "Moving Charge" and adjust velocity; a green dot shows the Lorentz force (arrow) as it moves through the field.

Example 2: Solenoid Uniform Field

  1. Choose "Solenoid". The coil appears as a rectangle with current direction indicated.
  2. Inside the solenoid, field lines are nearly straight and parallel — a uniform magnetic field region. Outside, the field resembles a bar magnet.

Example 3: Straight Wire Circular Field

  1. Pick "Straight Wire". The wire is perpendicular to the screen (current out of page, indicated by a dot with circle).
  2. Field lines are concentric circles. Use the compass grid to see the circular pattern. Right‑hand rule: thumb out of page, fingers curl counter‑clockwise.

Frequently Asked Questions

What do the field line colors mean?

The lines are colored from red (near north/high field) to blue (near south/low field) to indicate relative strength. Arrowheads show the local B direction.

How is the compass needle drawn?

Each needle aligns with the magnetic field direction at its grid point. The north tip (red) points along B; the south tip (blue) opposite.

Why does the moving charge change direction?

The Lorentz force is perpendicular to both velocity and magnetic field, causing circular or helical motion. The arrow shows instantaneous force.

How accurate is the solenoid field?

The solenoid is approximated by two parallel lines of magnetic charges (north and south poles) generating a dipole-like external field and a uniform internal field.

Can I place multiple sources?

Currently one source at a time. The tool clears previous source when you switch. Future versions may support multiple magnets.