Theory
Infinite straight wire:
$$B = \frac{\mu_0 I}{2\pi r}$$Magnetic dipole (far field):
$$B_r = \frac{\mu_0 m}{4\pi r^3}2\cos\theta, \quad B_\theta = \frac{\mu_0 m}{4\pi r^3}\sin\theta$$Click to place sources — drag to reposition
Place current-carrying wires and bar magnets on the canvas to visualize magnetic fields in real time. Explore Ampere's Law, dipole fields, and the attraction/repulsion between parallel currents.
Infinite straight wire:
$$B = \frac{\mu_0 I}{2\pi r}$$Magnetic dipole (far field):
$$B_r = \frac{\mu_0 m}{4\pi r^3}2\cos\theta, \quad B_\theta = \frac{\mu_0 m}{4\pi r^3}\sin\theta$$Click to place sources — drag to reposition
The magnetic field around an infinitely long, straight conductor is derived from Ampère's Law. The field strength is inversely proportional to the radial distance from the wire.
$$B = \frac{\mu_0 I}{2\pi r}$$$B$: Magnetic field magnitude (Teslas). $\mu_0$: Permeability of free space ($4\pi \times 10^{-7}$ T·m/A). $I$: Current in the wire (Amperes). $r$: Perpendicular distance from the wire (meters).
The field of a magnetic dipole (like a bar magnet) is more complex and depends on both distance and angle. It's often described using spherical coordinates.
$$B_r = \frac{\mu_0 m}{4\pi r^3}2\cos\theta, \quad B_\theta = \frac{\mu_0 m}{4\pi r^3}\sin\theta$$$B_r$, $B_\theta$: Radial and angular components of the magnetic field. $m$: Magnetic dipole moment (A·m²). $\theta$: Angle from the dipole's north-south axis. The field strength decays much faster with distance ($1/r^3$) compared to a straight wire.
Electric Motors & Generators: The interaction between magnetic fields from permanent magnets and current-carrying coils is the fundamental principle behind electric motors and generators. Engineers use these exact field calculations to design efficient and powerful devices.
Magnetic Resonance Imaging (MRI): MRI machines use incredibly strong and precisely shaped magnetic fields, generated by superconducting coils (essentially wires with massive current), to align hydrogen atoms in the body. The field uniformity is critical for clear imaging.
Particle Accelerators: To steer and focus beams of charged particles at near-light speeds, physicists use arrays of electromagnets. Calculating the exact magnetic field profile, like the dipole fields in this simulator, is essential for controlling the particle paths.
Fault Current Protection: Circuit breakers and protective relays often use the magnetic field generated by fault currents (sudden, high current) to trigger a disconnection. The force on a mechanism increases with $B$, which is proportional to $I$, allowing for fast, reliable protection of electrical grids.
Let's go over a few points where people often stumble when starting with the simulator. First, the point that "magnetic field lines are not physical lines". The lines drawn on the screen are "guide lines" that visualize the direction and strength of the magnetic field. A line becoming thicker or the number of lines increasing solely represents a higher magnetic flux density. When you review CAE analysis results in practical work, remember the meaning of this visualization.
Next, the simulation's assumptions. This tool uses simplified models like "infinitely long straight currents" or "ideal bar magnets". For instance, an actual coil has a finite length, so the shape of the field lines near its ends will differ slightly from the simulator. Also, it's important to note that it ignores the influence of surrounding materials (permeability). If there is a current near iron, the magnetic field lines will concentrate and be drawn towards the iron. Be cautious when directly applying the fundamental principles learned with the tool to complex real-world machines.
Finally, a pitfall in parameter settings. Let's think about current values in realistic orders of magnitude. For example, the magnetic field created by a few amps from a household outlet is much smaller than the Earth's magnetic field. On the other hand, a large current of several thousand amps, like in a welding machine, generates enough force to make nearby iron tools move noticeably. Even when experimenting with the simulator, imagining "how much is this current value in reality?" will help sharpen your physical intuition.
The relationship between "current and magnetic field" covered here is fundamental to the vast discipline of electromagnetism. Its applications are remarkably broad. First, consider power electronics. For example, in designing EV drive motors or chargers, large currents and high-frequency magnetic fields interact complexly. Understanding magnetic field line behavior here directly relates to designing to suppress leakage flux, which causes noise (EMI).
Another is the field of MEMS (Micro-Electro-Mechanical Systems). In micron-sized devices like smartphone gyro sensors or medical micro-pumps, "electromagnetic actuators" are used, where current flows through a coil to move a tiny structure. The relationship between current, distance, and force ($$F \propto I_1 I_2 / d$$) you learn with this simulator forms the very basis of mechanical design in the microscopic world.
Furthermore, magnetic levitation (maglev) technology is an interesting application. It uses superconducting coils to create a powerful magnetic field, levitating a vehicle. The "repulsive force" that generates the levitation is a sophisticated application of the principle of "repulsion between parallel currents in opposite directions" you can confirm in the simulator. It's a great example of a fundamental principle supporting cutting-edge transportation systems.
Once you've gained an intuitive understanding with this tool, the next step is to follow the "why?" with equations. First, understand the meaning of Ampère's law, $$ \oint_C \vec{B} \cdot d\vec{l} = \mu_0 I $$, which also appears in the tool. This elegant law states that "the line integral of the magnetic field around a closed loop is proportional to the current enclosed," enabling magnetic field calculations for cases with high symmetry (like a straight wire). It's important to once go through the process of deriving the earlier $$B = \frac{\mu_0 I}{2\pi r}$$ from this integral form yourself in your notes.
Next, you should challenge yourself to understand the "Biot–Savart law". This is the concept of summing (integrating) the infinitesimal magnetic fields created by infinitesimal segments of current, allowing calculation of magnetic fields for coils with complex shapes (like circular coils or solenoids) that cannot be solved with Ampère's law. $$ d\vec{B} = \frac{\mu_0}{4\pi} \frac{I d\vec{l} \times \vec{r}}{r^3}$$ Don't be intimidated by this equation containing a vector cross product. If you observe the simulator drawing a circular coil and see how the magnetic field direction behaves at its center and periphery while looking at the equation, you should grasp how it defines both "direction" and "magnitude".
Ultimately, take a look at how these laws are integrated as part of "Maxwell's equations". Learning about the dynamic relationship (electromagnetic induction) where electric and magnetic fields generate each other through time variation will give you a perspective that encompasses the principles of motors, generators, and even radio waves. Think of it as first solidifying the foundation of magnetostatics, and then building the grand mansion of electromagnetism upon it.