About Spinning Magnets Lab

Deterministic electromagnetic and electromechanical simulation for rotating permanent magnets and stationary coils

Spinning Magnets Lab is a scientific simulator developed to study how rotating permanent magnets interact with stationary coils, electrical loads, and rotor mechanics. The main objective is not visual novelty, but physically interpretable prediction: magnetic field distribution, coil flux, flux linkage, induced voltage, load current, electrical power, reaction torque, and mechanical power should emerge from a clear and auditable computational chain.

The project is designed as a virtual laboratory instrument. It is intended for engineers, researchers, experimenters, and technically curious users who want to inspect generator behavior with the same mindset used for real measurement systems: clear assumptions, explicit units, deterministic results, transparent numerical methods, and repeatable comparison between machine configurations.

Core principle. The simulator is built around a deterministic physics pipeline: project state → geometry → magnetic field → flux integration → induction → load response → power balance → mechanics → instruments → rendering. Rendering is never allowed to influence the physics.

What Changed in v0.9.4

Version 0.9.4 advances the simulator into a deterministic, instrument-oriented electromechanical analysis environment. The system is now driven by an authoritative runtime engine with time-domain energy integration, power validation, and phase-resolved diagnostics, enabling physically consistent analysis of generator behavior.

Project Purpose

The software exists to answer a focused class of questions:

This makes the simulator useful for conceptual generator studies, flux visualization, coil placement comparison, solver benchmarking, machine preset comparison, rotor sweep diagnostics, and scientific documentation.

Scientific Philosophy

Spinning Magnets Lab follows a physics-first development philosophy. The simulator should remain understandable and reproducible, which means every major computational step should have a clear owner and a defensible physical interpretation.

What the Simulator Models

At its current stage, the simulator models a rotor carrying permanent magnets and a stator region containing one or more coils. From that machine description it computes derived geometry, evaluates the magnetic field, samples the field over the coil aperture, derives electrical quantities from the resulting flux linkage, and can propagate those results into load response, power balance, and rotor mechanics.

Domain What is represented
Geometry Disc radius, slot count, magnet placement, coil placement, orientation, and working plane positions
Field solving Magnetic flux density vector B(x,y,z) from the currently selected magnet model
Flux integration Surface integration of B · n over the coil aperture using deterministic quadrature
Induction Flux linkage history and induced voltage derived from time change of linkage
Load response Open, resistive, and dynamic RL-style current response based on coil and load parameters
Power balance Electrical output, mechanical input power, and efficiency-style comparison metrics
Mechanics Rotor speed, shaft torque, reaction torque, net torque, and safety-related mechanical quantities
Analysis Rotor sweep signatures, per-angle machine metrics, and exportable analysis results
Instruments Probe readout, coil prediction table, scope traces, performance diagnostics, and solver comparison metrics

Physical Principles Respected

The simulator is based on standard electromagnetic and electromechanical concepts used in classical engineering analysis. These include the magnetic field of permanent magnets, magnetic flux through a finite surface, flux linkage of a multi-turn coil, Faraday’s law of induction, current response under electrical load, and mechanical power/torque relationships at a rotating shaft.

This is why coil outputs are not guessed from simple proximity or visual overlap. They arise from explicit field sampling and integration, and they can now be propagated into load response and power balance rather than stopping at open-circuit voltage alone.

Modeling Approach

Spinning Magnets Lab is intentionally built as a layered system. A new visualization can be added without changing the induction engine. A new field solver can be introduced without moving physics into the UI. A new preset machine can be added without rewriting the renderer. That separation is central to the credibility of the tool.

The simulator is now better understood as a compact deterministic laboratory stack:

Rotor Sweep Analysis

One of the major additions is rotor sweep. Instead of evaluating only the current display angle, the simulator can now step through a full mechanical revolution and build a deterministic signature of the machine over angle. This allows direct comparison of how electrical power, mechanical power, shaft torque, reaction torque, and net torque evolve throughout one turn.

Rotor sweep is especially useful for identifying waveform shape, torque ripple, phase relationships, asymmetric geometry effects, and the influence of load configuration across a full cycle. It also provides a stronger basis for generator benchmarking than a single static snapshot.

Preset Machines and Usability

The simulator now includes multiple preset machine configurations intended for different use cases, from simple laboratory baselines to more ambitious generator-style arrangements. These presets make it easier to learn the system, compare machine families, and start from stable known-good configurations.

This matters because a scientific tool becomes more useful when users can move quickly between documented reference machines instead of rebuilding every geometry from scratch.

Why Determinism Matters

Many simulator problems start when the codebase lets rendering, UI events, or convenience shortcuts silently alter physical state. Spinning Magnets Lab avoids that. Physics belongs to the engine path, not the presentation path. This matters because engineers need repeatability. When a parameter changes, the result should change for a reason that can be explained.

This is especially important when comparing field solvers, validating coil responses, benchmarking presets, studying torque balance, or using the simulator to prepare real laboratory experiments.

Target Audience

This documentation is written for a technical audience. It assumes familiarity with at least some of the following topics:

Even so, the project also values visual accessibility. The simulator should help people learn by inspection, without compromising the integrity of the underlying model.

Current Scope

The simulator is strongest when used as a controlled prediction and comparison environment for rotating-magnet generator systems. It now reaches beyond pure induction visualization into load-aware electromechanical analysis, but it is still not intended to replace full finite-element multiphysics workflows, nonlinear magnetic material solvers, thermal models, structural finite-element analysis, or complete external network simulation.

Its strength is clarity: a compact scientific environment where geometry, field structure, flux behavior, induced voltage, current response, power flow, and torque interaction can be inspected in a way that remains understandable.

Documentation intent. The goal is not only to describe what the simulator does, but also why it is structured this way, what assumptions it makes, what has recently been added, and where its present boundaries lie.

Distribution & Deployment

Spinning Magnets Lab is distributed as a self-contained web application and can be deployed locally or on servers using container technology. A prebuilt container image is available on Docker Hub, allowing the simulator to run without manual setup of web servers or dependencies.

The container provides a ready-to-use environment with static file serving, support for Web Workers, and full compatibility with the simulator’s import/export features. No additional configuration or networking setup is required for standard use.

Because the simulator runs entirely in the browser, all computation remains local to the user’s machine. Imported and exported project data stays under user control and is not transmitted externally.

Design goal. Container-based deployment ensures that the simulator behaves identically across systems, making it suitable for laboratory environments, reproducible experiments, and long-term archival usage.