BioniChaos Logo
  • Home
  • About
  • Contact

Global Magnet Controls

1.0x
Visualizer & Vector Options

Overview

Magnetism constitutes one of the fundamental interactions of classical electrodynamics, governed comprehensively by Maxwell's field equations. Magnetic induction fields ($\mathbf{B}$) originate from the spatial displacement of electric charge carriers, orbital electron momentum, and intrinsic quantum mechanical spin states. In stark contrast to electrostatic systems where isolated electric point charges generate monopolar electric flux ($\nabla \cdot \mathbf{E} = \rho / \epsilon_0$), experimental physics has consistently confirmed Gauss's law for magnetism ($\nabla \cdot \mathbf{B} = 0$), establishing that magnetic monopoles do not exist as free classical entities. Consequently, physical magnets universally present as polar magnetic dipoles possessing symmetrical paired North ($+q_m$) and South ($-q_m$) magnetic pole strengths, forming continuous, non-divergent field streamlines through space.

The field intensity produced by an ideal magnetic dipole attenuation curve exhibits inverse-cube drop-off characteristics at long spatial distances ($\mathbf{B} \propto r^{-3}$), whereas localized inter-pole mechanical forces follow Coulomb's inverse-square approximation for equivalent magnetic charge poles ($\mathbf{F} \propto r^{-2}$). When multiple dipoles share a spatial domain, their vector fields superimpose linearly, yielding intricate force vector topologies, critical points, and field cancellation nodes. Understanding these spatial field dynamics is essential across modern biomedical and industrial technology, ranging from magnetic drug targeting and plasma confinement in thermonuclear reactors to Tesla-scale spatial magnetic field shaping in diagnostic neuro-imaging platforms.

$$\mathbf{F}_{ij} = \frac{\mu_0}{4\pi} \frac{q_{mi} q_{mj}}{r_{ij}^2} \hat{\mathbf{r}}_{ij} \quad \implies \quad \mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi} \left( \frac{3(\mathbf{m} \cdot \hat{\mathbf{r}})\hat{\mathbf{r}} - \mathbf{m}}{|\mathbf{r}|^3} \right)$$
Coulomb Pole-Pair Force Vector Formula and Magnetic Dipole Field Superposition Equation

In clinical neuro-imaging and diagnostic medicine, powerful static magnetic fields ($\mathbf{B}_0$) align the nuclear magnetic dipoles of hydrogen protons inside biological tissue. Superimposed magnetic field gradients ($\mathbf{G}_x, \mathbf{G}_y, \mathbf{G}_z$) spatially encode precession frequencies, enabling Magnetic Resonance Imaging (MRI) scanners to construct anatomical cross-sections based on $T_1$ longitudinal spin-lattice and $T_2$ transverse spin-spin relaxation rates. This laboratory simulation models the exact mechanics of dipole vector summation, spatial torque alignment, and real-time magnetic field line topology.

How to Use

This interactive simulator provides a high-fidelity two-dimensional electrodynamic visualizer for manipulating magnetic dipoles within a real-time numerical engine. The workspace features the following control interfaces:

Mouse & Touch Canvas Workspace Interactions

  • Translational Dragging: Click or touch and hold the central body of any bar magnet (whether locked or unlocked) to drag its spatial coordinates $(x, y)$ across the canvas plane. The simulation continuously updates spatial vector fields and dynamic interaction forces.
  • Rotational Torque Adjustment: Click and drag near the terminal ends (North pole or South pole) of any magnet to manually adjust its rotational orientation angle ($\theta$).
  • Dynamic Force & Vector Visualizers: Yellow dynamic vector arrows originate from the center of mass of each active magnet, representing the net spatial force vector ($\mathbf{F}_{\text{net}}$).

Instrument Control Console & Master Sliders

  • Initial Orbiting Layout: Upon loading the workspace, a locked magnetic dipole anchors the center of the canvas while two adjacent magnets with higher initial strengths ($100-120\text{ A}\cdot\text{m}$) and tangential velocity vectors orbit and interact dynamically around it.
  • Position & Angle Lock (Fixation Toggle): Toggle the "Lock: OFF / ON" switch on any individual magnet panel. When locked, the magnet ignores physics forces and torques from adjacent magnets, but users can still manually drag and rotate it to any position. Once released, it stays anchored at its new position.
  • Direct Numerical Input Fields: Edit exact values directly inside the Strength or Angle number inputs (e.g., typing `125` or `45°`). The simulation automatically updates the slider position and recalculates vector fields.
  • Global Control Panel & Master Multiplier: Use the Master Strength slider ($0.1\times$ to $3.0\times$) to globally scale all magnetic pole strengths on the canvas simultaneously. Use the "Lock All" or "Unlock All" buttons for immediate scene configuration.
  • Real-Time Numerical Force & Torque Readouts: Observe live scalar readouts of instantaneous net force ($|\mathbf{F}_{\text{net}}|$ in Newtons) and torque ($\tau_{\text{net}}$ in $\text{N}\cdot\text{m}$) computed for every dipole on the canvas.
  • Polarity Inversion & Removal: Click "Flip" on a magnet panel to instantaneously invert its magnetic orientation by $180^\circ$ ($\pi\text{ rad}$), or click "Remove" to delete the dipole from the canvas workspace.
  • Automated Propagation Demo Mode: Click "Start Demo" (or press `D`) to start an automated orbital motion path sequence. The demo mode snapshot freezes user configuration state and restores it seamlessly when interrupted by any user input action.
  • Audio Sonification Synthesizer: Click "Audio: OFF" (or press `A`) to enable Web Audio API sound synthesis. The synthesizer sonifies dipole movement, boundary collisions, and field force oscillations into real-time acoustic tones.

Technical Details

The computational physics engine uses Euler-Cromer numerical integration scheme to resolve translation forces and rotational torques at 60 frames per second. Each physical bar magnet $i$ is modeled as two point magnetic charges ($q_m = \pm \text{Strength} \times \text{MasterMultiplier}$) separated by a fixed moment arm length $L$. The net force vector $\mathbf{F}_i$ and net torque $\tau_i$ acting on magnet $i$ are calculated by iterating over all external poles $j$:

$$\mathbf{F}_i = \sum_{p \in \{N,S\}_i} \sum_{k \in \{N,S\}_j, j \neq i} \frac{\mu_0}{4\pi} \frac{q_{m,p} q_{m,k}}{|\mathbf{r}_{pk}|^2} \hat{\mathbf{r}}_{pk}, \quad \tau_i = \sum_{p \in \{N,S\}_i} \mathbf{r}_{p/cm} \times \mathbf{F}_{p}$$

When a magnet's position lock switch is engaged ($i \in \text{Locked}$), the engine sets its linear acceleration and angular acceleration from adjacent fields to zero ($\mathbf{a}_i = \mathbf{0}, \alpha_i = 0$), bypassing velocity integration while retaining full user manual drag authority and full field contribution to $\mathbf{B}_{\text{total}}(\mathbf{r}) = \sum \mathbf{B}_k(\mathbf{r})$.

Field lines are computed using an adaptive Eulerian ray-tracing streamline algorithm. Streamlines originate from the North pole of each dipole and iterate through small spatial integration steps along the local magnetic field vector $\mathbf{B}_{\text{total}}(x,y)$ until they terminate at a South pole or exit the viewport boundary. To maintain smooth Interaction to Next Paint (INP) responsiveness during touch drag events, the streamline integration step limit dynamically adapts based on active interaction states.

Cross-browser consistency across Chrome, Firefox, Safari, and Edge is strictly enforced using a native `ResizeObserver` listener on the `.canvas-wrapper` block. Upon viewport resizing, `adjustCanvasScaling()` scales the backing buffer matrix using `window.devicePixelRatio` ($DPR$). Target canvas dimensions are wrapped in precise `Math.round()` safety constraints, preventing fractional sub-pixel floating-point discrepancies that would otherwise trigger infinite mathematical coordinate drift loops on Windows environments running custom OS scaling percentages.

Future Directions

Planned technological enhancements for this simulation framework include:

  • Maxwell Electromagnetism Modules: Integrating current-carrying coils and solenoids to demonstrate Biot-Savart vector generation ($\mathbf{B} = \frac{\mu_0 I}{4\pi} \int \frac{d\boldsymbol{\ell} \times \hat{\mathbf{r}}}{r^2}$) and Lorentz deflection of electron beams.
  • 3D WebGL Vector Field Workspace: Upgrading the rendering pipeline to a responsive Three.js camera environment for rendering 3D magnetic flux isosurfaces and volumetric field line topologies.
  • Soft Iron Ferromagnetic Material Models: Simulating induced magnetic dipoles in soft iron materials governed by material susceptibility ($\mathbf{M} = \chi_m \mathbf{H}$).
  • NMR Proton Precession Module: Modeling nuclear magnetic resonance, $T_1$ spin-lattice relaxation curves, and RF pulse tipping vectors inside simulated tissue maps.

Related Interactive Laboratories

  • Synthetic Brain MRI Simulator - Explore proton spin density alignment and magnetic resonance spatial gradients.
  • Kinetic Particle Thermodynamics - Simulate molecular kinetics, fluid dynamics, and elastic collisions.
  • Life & Diffusion Sandbox - Study metabolic diffusion dynamics and cellular automata growth matrices.
  • Acoustic Spectrogram Laboratory - Analyze real-time frequency arrays and Fourier transform signal visualizers.