The analytical model (Layer 1)¶
The foundation of the package: a closed-form sizing model that evaluates a complete motor design (torque, back-EMF, losses, steady-state temperature, mass, and constraint margins) in microseconds. Every higher-fidelity layer reproduces it in a limit; the annular model matches it to 1×10⁻¹² with one slice, and tests pin this. The physics derived here is therefore the reference for everything else.
Code: axfluxmdo.models.analytical,
axfluxmdo.materials.magnetic,
axfluxmdo.models.losses,
axfluxmdo.models.thermal_rc.
1. The air-gap field from the magnet load line¶
Assumptions: a surface permanent magnet of thickness \(h_m\) faces an iron stator across an air gap \(g\); iron permeability is effectively infinite; the flux path is one-dimensional, with no fringing. The FEA-measured consequence of the last assumption is given in Limitations.
Apply Ampère's law around the magnet–gap loop. With infinitely permeable iron, the only MMF drops are in the magnet and the gap:
where \(k_C \ge 1\) is the Carter factor, the classical correction that inflates the effective gap to account for slot openings (\(k_C = 1\) for a slotless face). Flux continuity through the series circuit gives \(B_m = B_g\). The magnet operates on its recoil line,
with recoil permeability \(\mu_r \approx 1.05\) and temperature-derated remanence \(B_r(T) = B_{r,20}\,[1 + \alpha_{B_r}(T - 20)]\) (NdFeB: \(\alpha_{B_r} \approx -0.12\,\%/°\mathrm{C}\)). In the gap, \(B_g = \mu_0 H_g\). Eliminating the field intensities:
This is airgap_flux_density() in
materials/magnetic.py. Two limits check the form:
as \(g \to 0\) (with \(\mu_r \to 1\)), \(B_g \to B_r\); and thickening the magnet
pushes \(B_g\) toward \(B_r\) asymptotically, with diminishing returns that the
sensitivity tornado makes visible.
Reference motor numbers (N42 at 65 °C, \(h_m\) = 4 mm, \(g\) = 0.8 mm): \(B_r(65) = 1.30 \times (1 - 0.0012 \cdot 45) = 1.2298\) T, so \(B_g = 1.2298 \cdot 4/(4 + 1.05 \cdot 0.8) = 1.016\) T.
The load line is an upper bound
2D FEA measures the real under-magnet mean about 11% lower, due to
inter-magnet leakage and fringing; see
FEA validation. Pass a measured carter_factor to
either model to fold corrections back in.
2. The fundamental of the gap field¶
The magnets create a square-wave field pattern: \(+B_g\) under N poles, \(-B_g\) under S poles, and zero in the uncovered fraction \((1-\alpha_m)\) of each pole pitch. Sinusoidal machine theory works with the fundamental of that wave. For a square wave of amplitude \(B_g\) spanning the central fraction \(\alpha_m\) of each half-period, the Fourier fundamental is
Derivation sketch: \(b_1 = \frac{2}{\tau}\int_{-\tau/2}^{\tau/2} B(x)\sin(\pi x/\tau)\,dx\) with \(B(x) = \pm B_g\) over the magnet arc; the integral over the covered span \([\tau(1-\alpha_m)/2,\ \tau(1+\alpha_m)/2]\) produces the \(\sin(\alpha_m\pi/2)\) factor. The payoff diminishes near full coverage: \(\alpha_m: 0.85 \to 1.0\) raises \(\sin(\alpha_m\pi/2)\) only from 0.972 to 1.0, which the magnet-arc sweep in example 04 shows directly.
3. Flux linkage, torque, and back-EMF from one quantity¶
The fundamental flux per pole over the annular gap area \(A_g = \pi(r_o^2 - r_i^2)\) is the average of the half-sine over a pole:
with \(k_w\) the winding factor and \(N\) turns per phase. The package derives both torque and back-EMF from this single \(\lambda\):
This construction carries an exact energy balance. Multiply:
Electrical power into the EMF equals mechanical power out identically, not
approximately. The test suite enforces this to 10⁻⁹ relative
(tests/test_analytical.py::TestExactIdentities), which pins down every
\(\sqrt2\) and \(\pi\) in the chain. Models that compute torque and EMF from
separate formulas routinely leak a few percent here.
Equivalence to the classical sizing equation
The SPEC's shear-stress form \(T = \tfrac{2\pi\sigma_t}{3}(r_o^3 - r_i^3)\) integrates a uniform air-gap shear over the annulus. It differs from the flux-linkage form only by the geometry factor \(\tfrac{2}{3}(r_o^3-r_i^3)\,/\,[r_m(r_o^2-r_i^2)] \approx 1.09\) for the reference motor. Both are valid Layer-1 conventions; the package uses the flux-linkage form internally and reports the implied average shear.
4. Pole pairs and torque: a common misconception¶
A frequent question about example 02: why is torque flat across the pole-pair sweep when the standard machine equation \(T = \tfrac{3}{2} p\, \lambda_{pm}\, i_q\) contains an explicit \(p\)?
Substitute the flux-per-pole expression into the torque equation:
The \(p\) cancels. At fixed gap field, electrical loading, turns, and active area, more pole pairs means proportionally less flux per pole, and torque does not change. The same cancellation hides inside the dq equation: the per-phase flux-linkage amplitude \(\lambda_{pm}\) falls as \(1/p\) in a fixed-size machine because the flux per pole does. The \(p\) in that equation counts electrical cycles per revolution; it is not a torque multiplier.
The intuition that high-pole machines are better is still correct, but the mechanism is torque density, and it requires resizing the iron. Each pole's flux return scales with the pole pitch, so the required yoke thickness scales as \(1/p\). Two sweeps of the reference motor at 500 rpm and 25 A make the distinction concrete (both runnable in example 02):
| Sweep | \(T\) (N·m) | mass (kg) | \(T\)/kg (N·m/kg) |
|---|---|---|---|
| Fixed geometry, \(p\): 4 → 20 | 8.63 → 8.63 | 4.06 → 3.60 | 2.12 → 2.40 |
| Yokes resized \(\propto 1/p\) (constant \(B_y\)), \(p\): 4 → 20 | 8.63 → 8.63 | 9.96 → 2.89 | 0.87 → 2.98 |
Torque is flat in both. In the fixed-geometry sweep, the modest density gain comes only from shorter end turns (mean turn length contains a \(\tau_p \propto 1/p\) term). In the design-scaled sweep, holding yoke flux density constant lets the iron shrink with \(p\), and torque density rises by a factor of 3.4. Thinner iron at constant shear is the real basis of the high-pole intuition, along with gearless low-speed operation.
One more direction worth checking: in this model, core loss falls with \(p\) at fixed geometry (1.66 W at \(p\) = 4 to 0.79 W at \(p\) = 20 in the sweep). Frequency rises as \(p\), but the yoke flux density falls as \(1/p\), so the hysteresis term \(k_h f B^{\alpha}\) scales as \(p^{\,1-\alpha} \approx p^{-0.68}\) and the eddy term \(k_e f^2 B^2\) is independent of \(p\). Real machines can still lose at high pole counts through mechanisms this model omits (AC copper loss, PWM harmonics, magnet eddy currents); see Limitations.
5. Losses¶
Copper: DC resistance per phase from geometry, \(R_\mathrm{ph}(T) = \rho(T)\, N L_\mathrm{turn} / A_\mathrm{cond}\), with \(\rho(T) = \rho_{20}[1 + 0.00393\,(T-20)]\) and \(L_\mathrm{turn} = 2(r_o - r_i) + 2 k_\mathrm{end}\tau_p\). Then \(P_\mathrm{cu} = m I^2 R_\mathrm{ph}\). Copper loss is linear in temperature, which is what makes the thermal solution below closed-form.
Core (Steinmetz): the classical two-term model per unit mass,
hysteresis (the B–H loop area traversed \(f\) times per second, with the empirical Steinmetz exponent \(\alpha \approx 1.6\!-\!1.8\)) plus classical eddy currents (induced EMF proportional to \(fB\), loss proportional to its square). The M-19 coefficients are pinned to the manufacturer's 60 Hz / 1.5 T datasheet point by a unit test. The flux density used is the stator-yoke value \(B_y = B_g \alpha_m \tau_p / (2 t_\mathrm{core} k_\mathrm{stack})\), since half of each pole's flux returns through the yoke cross-section.
6. The thermal RC and its closed form¶
A single thermal resistance \(R_\theta\) couples the winding node to ambient. At steady state,
a fixed-point equation because copper loss rises with its own temperature. Since \(P_\mathrm{cu}(T) = P_\mathrm{cu,ref}\,[1 + \alpha(T - T_\mathrm{ref})]\) is linear in \(T\), the fixed point solves in closed form:
The denominator has a physical reading: each kelvin of rise adds \(\alpha R_\theta P_\mathrm{cu,ref}\) kelvin of additional rise through the resistivity feedback. When
the geometric series diverges and the winding runs away thermally. The model
flags this (ThermalSolution.runaway) and forces the thermal constraint to
violated rather than reporting a meaningless negative temperature. A
50-iteration fixed-point reference implementation verifies the closed form
in tests.
7. Constraints¶
Every evaluation reports six named constraints with normalized margins
\((\mathrm{limit} - \mathrm{value})/|\mathrm{limit}|\): winding temperature,
electrical frequency, current density, line voltage
(\(\sqrt3\,(E + IR) \le V_{dc}/\sqrt2\), with inductive drop neglected; see
Limitations), yoke flux density against the steel's
saturation knee, and magnet temperature against its grade rating. The
constraint names double as the optimization grammar's vocabulary
("winding_temp_c < 140").
See example 01 for the full chain on the reference motor and example 02 for both pole-pair sweeps.