Click the canvas to place a magnetic pole
Theory Notes
Magnetic Field and the Magnetic Monopole Approximation
Magnetic field from a point pole m (magnetic monopole approximation):
$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\frac{m}{|\mathbf{r}-\mathbf{r}_0|^2}\hat{r}$$
Superposition of multiple poles (Gauss's law for magnetism):
$$\oint_S \mathbf{B}\cdot d\mathbf{A}= 0 \quad \Leftrightarrow \quad \text{no magnetic monopoles exist}$$
Field line integration (RK4): starting from point $\mathbf{r}$, advance in direction $\hat{B}$ with step size $h$.
CAE Connection: In electromagnetic FEM analysis of motors, transformers, and MRI systems, field line patterns directly indicate design quality. Designs with high leakage flux — lines that escape rather than crossing the air gap — suffer greater losses.
🧑🎓 Student × 🎓 Professor — Dialogue
🧑🎓 "What happens to the field lines when you bring two N poles close together? They repel, right?"
🎓 "Right, they repel. In terms of field lines: both N poles push lines outward, so the lines from each pole run out of room and get deflected sideways. That 'pushing against each other' literally is the repulsive force."
🧑🎓 "And with an N and an S pole, they attract — because the field lines connect between them?"
🎓 "Exactly. Lines leaving the N pole terminate at the S pole. Faraday pictured those lines as having a tension that tries to shorten them — and that tension manifests as attraction. Modern electromagnetic FEM formalizes this via the Maxwell stress tensor."
🧑🎓 "How would you actually use this in CAE? What do you judge from looking at field line plots?"
🎓 "In motor design, the key question is whether field lines efficiently cross the air gap between rotor and stator. Leakage flux — lines that wander outside the gap without contributing to torque — means wasted energy. Load up the dipole preset here and watch how the lines concentrate through the center. That concentration pattern is what you're optimizing when you run Ansys Maxwell."
What is a Magnetic Field?
🧑🎓
What exactly are these lines I'm seeing when I place a pole in the simulator? They look like they're coming out of the red "N" and going into the blue "S".
🎓
Exactly! Those are magnetic field lines. They're a visual tool to show the direction and strength of the magnetic force in the space around a magnet. The direction (from N to S) shows where a tiny north pole would be pushed. Try moving the "Pole Strength" slider for a single pole—you'll see the lines get denser (stronger field) or sparser (weaker field).
🧑🎓
Wait, really? So if I place just a north pole, the lines go out forever? But real magnets always have both poles... what's the simulator doing?
🎓
Great observation! You've hit on a key trick in physics. Real magnetic poles come in inseparable pairs (a dipole). But for calculation, we can approximate one end of a very long, thin magnet as a single "point pole" or magnetic monopole. The simulator uses this neat math trick so you can build fields from individual sources. Try placing an "N" and an "S" close together—you've just built a dipole, and the lines connect them!
🧑🎓
That makes sense! So when I add more poles to make a complex shape, the simulator is just adding up these fake "monopole" fields? How does that work mathematically?
🎓
Precisely! This is the principle of superposition. The total magnetic field at any point is the vector sum of the fields from all your placed poles. The simulator calculates this in real time. Play with the "Field Line Density" slider—it changes how many sample lines are drawn from each pole, helping you visualize the summed field strength in different areas.
Physical Model & Key Equations
The simulator models each point pole (N or S) as a source of a radial magnetic field, analogous to the electric field from a point charge. This is the magnetic monopole approximation, useful for constructing complex fields.
$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\frac{m}{|\mathbf{r}-\mathbf{r}_0|^2}\hat{r}$$
$\mathbf{B}(\mathbf{r})$: Magnetic field vector at position $\mathbf{r}$.
$\mu_0$: Magnetic constant (permeability of free space).
$m$: Pole strength (positive for North, negative for South).
$\mathbf{r}_0$: Position of the point pole.
$\hat{r}$: Unit vector pointing from $\mathbf{r}_0$ to $\mathbf{r}$.
However, a fundamental law of magnetism states that true, isolated magnetic monopoles do not exist. The magnetic field must form closed loops, which is expressed by Gauss's Law for magnetism.
$$\oint_S \mathbf{B}\cdot d\mathbf{A} = 0$$
This equation says the net magnetic flux through any closed surface $S$ is always zero. In practice, this means every field line leaving a north pole must eventually enter a south pole. In the simulator, when you place poles, the drawn lines will always reflect this law, connecting poles or looping back on themselves.
Real-World Applications
Permanent Magnet Design: Engineers use field visualization to design magnets for speakers, hard drives, and MRI machines. By arranging pole strengths and geometries (like the quadrupole you can create in the simulator), they can shape the magnetic field for a specific purpose, such as creating a very uniform field inside an MRI scanner.
Particle Accelerators & Beam Steering: Complex arrangements of magnets, like quadrupoles and sextupoles, are used to focus and steer beams of charged particles. The simulator helps build intuition for how alternating sequences of N and S poles can pinch or bend a particle beam traveling through the center.
Magnetic Shielding: To protect sensitive equipment from stray magnetic fields, shields are designed using materials that "redirect" field lines. Visualizing how field lines prefer to travel through certain paths (like between nearby poles) is key to understanding how shielding works.
Educational & Diagnostic Tool: Before running complex 3D CAE simulations, physicists and engineers often sketch expected field line patterns. This simulator provides that intuitive first step, helping to diagnose issues or plan experiments by quickly testing different pole configurations.
Common Misunderstandings and Points to Note
First, understand that this simulator deals with an idealized model called "point magnetic poles". In a real bar magnet, N and S poles always exist as a pair, and the poles are spread over a surface, not a "point". Therefore, if you place two N poles extremely close together in the simulator, a repulsive force that is unrealistically strong in reality will be calculated. This is purely a tool for understanding principles; for precise design of actual devices, you'll need higher-accuracy FEM software.
Next, don't misunderstand the meaning of the "Display Density" slider. Increasing it makes the magnetic field lines appear denser, but this does not mean "the magnetic field itself has become stronger". For example, increasing the pole strength from 10 to 20 will strengthen the field, but increasing the display density from 10 to 20 only increases the number of visible lines. Judge the field strength by the "Pole Strength" slider and the crowding of the field lines (the spacing between lines).
Finally, a common pitfall in practical work is "ignoring the influence of surrounding materials". This simulator calculates for a vacuum (air). But in actual design, if there are ferromagnetic materials like iron, magnetic field lines concentrate and are drawn to them (magnetic shielding or magnetic circuit formation), and if there are conductors like copper, eddy currents are generated, working to cancel the magnetic field. The correct step is to first get a feel for the basic "magnetic field in a vacuum" with this tool, and then learn "how it changes when materials are added".
Related Engineering Fields
You could say the concept of this magnetic field visualization connects to almost all engineering fields based on "electromagnetism". The most direct is "motor/actuator design". For instance, in a brushless DC motor, coils rotate within the magnetic field of permanent magnets (multipoles) arranged alternately around a circumference. If you create quadrupoles or sextupoles in the simulator, you can visually understand the basic principle of torque generation.
It's also crucial in the fields of "magnetic sensors and non-destructive testing". In magnetic flux leakage testing to detect pipe corrosion, weak leakage flux is predicted via simulation to optimize sensor placement. Furthermore, in "particle accelerators and nuclear fusion devices", "quadrupole electromagnets" and "sextupole electromagnets" are used to bend and focus charged particle beams. Understanding the complex magnetic field distributions they create is exactly where the experience of playing with this tool becomes useful.
Surprisingly, "power engineering" is also deeply related. The magnetic field created by busbars (conductors carrying large currents) inside substations causes eddy current losses in nearby metal structures or affects instruments. The first step in evaluating that impact is visualizing the conductor as a source generating a magnetic field, albeit using a different model called a "current element".
For Further Learning
Once you're comfortable with this tool, the next step is to learn the basics of "vector analysis". The magnetic field $\mathbf{B}$ is a vector field, so its divergence $\nabla \cdot \mathbf{B}=0$ (Gauss's law) and curl $\nabla \times \mathbf{B} = \mu_0 \mathbf{J}$ (Ampère's law) hold the essence. The way field lines always form closed loops in the simulator is precisely a visualization of $\nabla \cdot \mathbf{B}=0$. The concept of curl is needed to understand how electric current ($\mathbf{J}) generates a magnetic field like a "whirlpool".
After the math, as a "bridge to real 3D design tools", I recommend trying out free CAE software based on the Finite Element Method (FEM) (e.g., open-source software capable of magnetic field analysis). The keywords here are "scalar potential" and "vector potential". Our simulator directly sums the potentials of point magnetic poles, but FEM solves partial differential equations for these potentials over the entire domain. Being aware of this difference will make the meaning of the CAE software's settings much clearer.
Ultimately, aim for a "unified understanding of electric and magnetic fields". A time-varying electric field generates a magnetic field (displacement current), and a time-varying magnetic field generates an electric field (electromagnetic induction). This interaction is the core of Maxwell's equations. Having first experienced the behavior of magnetic field lines in a static field with this tool, you should now be able to approach learning about dynamic phenomena like electromagnetic waves with a solid mental image.