TerreLenz / Validation

Validation report

Every number, and how we got it.

TerreLenz is checked against closed-form solutions, FEMM 4.2 on identical models and the TEAM benchmark problems. Each case on this page is an automated test: it runs on every build, and a result that drifts out of tolerance fails the build. Below are the numbers, the method behind them, and the limits we know about.

  • Over 60 automated validation cases
  • Second-order elements throughout
  • Signs and tolerances kept, not rounded away

How to read the tables

What “error” means here.

Error is TerreLenz’s result minus the reference, as a percentage of the reference, at the mesh and element order the test uses. Signs are kept: “+” means TerreLenz reads high. Where a test checks several points or speeds, the table gives the worst of them.

Tolerance is what the automated test enforces, and it is usually looser than the error we measure. That way a mesher or library update that moves a result by a hair doesn’t break the build, but a real regression does. Where the tolerance is the only number we publish, the table says “within”.

References are of four kinds: closed-form solutions (textbook fields, inductances, forces and losses); FEMM 4.2 with mesh-converged models built from the same geometry; the TEAM problems (published measurements for TEAM 7, the published reference table for TEAM 30a); and internal cross-checks, where two independent routes to the same quantity must agree, such as a transient run to steady state against the AC solution, a 3D model against its axisymmetric twin, or Maxwell stress against virtual work.

Second-order elements as standard

First-order elements are not good enough for engineering results: near a magnet the error reaches 30 %. Every study therefore defaults to second order, with nodal elements in 2D and hierarchical edge elements in 3D.

Block magnet, 2 mm from the pole face: +0.09 %

Open boundaries, not a wall

A finite air box with a zero-potential wall is wrong in a known direction. TerreLenz maps the exterior to infinity with a shell transformation, in 2D and 3D, so the model can stop close to the part.

Block magnet in a 30 mm ball of air: within 0.3 % of exact. Same ball, plain wall: 6–13 % off

Bracketing the answer

Flux-tangential walls overestimate stored energy; field-normal walls underestimate it. The tests solve both and require the open-boundary result to land between them. If it ever doesn’t, something is wrong with the boundary treatment, not the mesh.

Block magnet: 1.296 J (FN) < 1.330 J (open) < 1.399 J (FT)

Forces from the Maxwell stress tensor

Integrated over a shell of air around each body, with a thin-film term for bodies that touch. Machine torque uses Arkkio’s method over the meshed air-gap ring. Virtual work, dW′/dx, is kept as an independent cross-check.

Plunger stroke force: Maxwell stress −20.09 N, virtual work −20.14 N

Saturation by Newton–Raphson

With the exact Jacobian, in 2D and 3D, and optional adaptive relaxation. Given a straight-line B-H curve, the Newton solver reproduces the linear solver to six digits. Curves are extended at μ0 beyond the last point, so a solve never runs off the end of the table.

Steel sphere, 1.5 MA/m applied: +0.65 % at 3.2 T

Convergence you can watch

A Zienkiewicz–Zhu error estimator drives adaptive refinement in 2D and 3D. Check accuracy re-solves with a finer mesh, higher order, a tighter Newton tolerance, half the time step and more air, then reports how far each result moved. That spread is the error bar you put in the report.

Two-wire line, 4 adaptive passes: −6.2 % → +0.39 % → +0.024 % → −0.034 %

Results

The cases, by study type.

Geometry and settings are stated where they matter. Unless noted, every case uses second-order elements and the mesh the test specifies.

3D magnetostatics

Block magnet: 20 × 20 × 10 mm, Br 1.3 T, μr 1, in a 180 × 180 × 170 mm air box. Sphere: radius 10 mm, Fröhlich-type steel with μi 1500 and Js 1.95 T, checked against the exact relation ⅔·H + B(H)/3μ0 = H0.

CaseChecked againstQuantityError
Block magnetClosed formBz, 2 mm from the pole face (0.3605 vs 0.3601 T)+0.09 %
Block magnetClosed formBz, 5 mm+0.63 %
Block magnetClosed formBz, 10 mm+1.00 %
Block magnetClosed formBz, 20 mm (air-box truncation starts to count)+1.93 %
Block magnet, adaptive mesh from a 20 mm seed: 3 742 → 211 000 elements in 4 passes, 49 sClosed formBz, 3 mm above the pole0.14 %
Block magnet in a 30 mm ball of air, open boundaryClosed formOn-axis fieldwithin 0.3 %
One eighth of the block magnet, three symmetry planesWhole modelStored energy × 80.015 %
Block magnet with field-normal / flux-tangential walls at ±25 and ±50 mmOpen-boundary model, 1.330 JStored energy brackets the open value1.296 / 1.327 J below · 1.399 / 1.340 J above
Steel sphere, 10 kA/m (linear, μr 1000)Exact solutionB at the center+0.22 %
Steel sphere, 100 kA/m (nearly linear)Exact solutionB at the center+0.22 %
Steel sphere, 400 kA/m (at the knee)Exact solutionB at the center (1.5069 vs 1.5036 T)+0.22 %
Steel sphere, 1.5 MA/m (deep saturation)Exact solutionB at the center (3.2051 vs 3.1844 T)+0.65 %
Ring coil, second-order edge elementsThick-coil formulaB on axis: center / 10 mm / 25 mm+0.7 % / −0.4 % / −1.0 %
Ring coil, 3D modelIts own 2D axisymmetric modelFlux linkage (5.712 vs 5.701 mWb)0.2 %
Two cuboid magnetsMagnetic charge modelFz (−42.2 N) / Fx (−10.2 N) / torque−0.08 % / +0.03 % / +1.2 %

Tolerances: block magnet 1 % to 5 mm, 1.5 % at 10 mm, 4 % at 20 mm; sphere 2 %; ring coil 1 % below 20 mm, 3 % at 25 mm. The ring coil’s +0.7 % at the center is discretization: the exact discrete solution on the same mesh sits at +0.14 %.

2D magnetostatics and saturation

C-core: a saturating core with a 100-turn coil and an armature across two 1 mm gaps, planar, 100 mm deep. The FEMM 4.2 models are mesh-converged and built from the same geometry description.

CaseChecked againstQuantityError
Two-wire line, planarL′ = μ0/π (ln(d/a) + ¼)Inductance per length−0.08 %
Two-wire line, planarF′ = μ0I²/2πdForce per length−0.4 %
Two-wire line, adaptive from 833 elements: 4 passes to 23 400 elements, 3 sAnalyticInductance per length, pass by pass−6.2 → +0.39 → +0.024 → −0.034 %
Two coaxial rings, axisymmetricMaxwell’s filament formulaMutual inductance−0.08 %
Two coaxial rings, axisymmetricAnalyticAxial force+0.06 %
Thick solenoid, axisymmetricAnalyticCenter field+0.43 %
Permeable cylinder, μr 10, in an applied fieldAnalyticField inside−0.20 %
Sphere in an axial applied field, axisymmetricAnalyticField inside+0.08 %
Two-wire line / thin ring in a small air region, open boundaryFree-space valuesInductance−0.03 % / +0.09 %
Same region with a plain zero-potential wall (for comparison)Free-space valuesInductance−8.7 % / −3.4 %
Planar magnet with field-normal / flux-tangential wallsOpen-boundary model, 8.437 JStored energy brackets the open value8.049 / 8.333 J below · 8.818 / 8.525 J above
C-core, 500 A-turnsFEMM 4.2Gap B (0.29115 vs 0.29115 T)0.00 %
C-core, 500 A-turnsFEMM 4.2Armature force (−73.306 vs −73.307 N)0.00 %
C-core, 500 A-turnsFEMM 4.2Flux linkage (46.167 vs 46.166 mWb)0.00 %
C-core, 3000 A-turns (saturated)FEMM 4.2Gap B (1.2128 vs 1.2137 T)−0.07 %
C-core, 3000 A-turns (saturated)FEMM 4.2Armature force (−1266.96 vs −1267.46 N)−0.04 %
C-core, 3000 A-turns (saturated)FEMM 4.2Flux linkage (194.18 vs 194.20 mWb)−0.01 %
C-core, 5 A and 30 AFEMM 4.2 block integralsEnergy and co-energywithin 0.5 %
Laminated ring, stacking factor 0.9AnalyticLoss / flux density0.03 % / 0.01 %
Magnet at 120 °C, library temperature coefficientsScaled 20 °C solveFieldexactly 0.88×

AC, eddy currents, transients and circuits

Where the reference is another TerreLenz study, the two routes are independent: a transient stepped to steady state against the time-harmonic solution, or a 3D model against its axisymmetric twin.

CaseChecked againstQuantityError
Round copper wire, 5 kHz (δ 0.93 mm, radius 5 mm), adaptive from 240 to 6 300 elementsBessel-function solutionAC resistance+0.04 %
Round copper wire, 50 / 300 / 1000 HzBessel-function solutionAC resistancewithin 1 %
Conducting cylinder as a shield, a/δ = 2B0 / |J0(ka)|Field insidewithin 0.16 %
Same cylinder under a transient sineIts AC solutionLosswithin 1.8 %
Conducting sphere in a uniform AC field, 3DClosed formEddy-current losswithin 3 %
Aluminum disk above a ring coil, 200 Hz, 3DIts axisymmetric AC modelEddy loss / coil inductance1.2 % / 0.2 %
TEAM 7 asymmetric conductor with a hole, 50 and 200 Hz, 675 000 unknownsPublished measurementsBz 15 mm above the platewithin 4 % of the 78 G peak at all but two points per line; worst 5.4 G
TEAM 7Published measurementsJy on the face toward the coilwithin 15 % of the extreme, except at the hole’s edge
Plate over a coil, Crank–Nicolson transient to steady stateIts AC solutionCurrent / loss / force0.02 % / 0.04 % / 0.06 %
Saturating C-core, nonlinear transient at DCIts magnetostatic solutionAll quantitiesidentical
Stranded coil, voltage stepV/R (1 − e−tR/L)Current risepasses
Same step with adaptive BDF2 time stepsExactCurrent, in 29 steps0.26 %
Ring around a wireAnalyticIron loss (Bertotti)0.007 %
Jiles–Atherton ring, 50 HzLoop area × fHysteresis loss (0.5446 W, equal to electrical input to six digits)within 0.4 %
Jiles–Atherton ringIndependent integration of the modelRemanence (0.627 vs 0.624 T)+0.5 %
Saturated C-core, AC study with the effective B-H curveFundamental of the transientFlux linkage+5.9 % (see Limits)
Induction heating of a round coil, 2DClosed formTemperaturewithin 0.5 %
Capacitor discharge into a coil (netlist)RLC solutionCurrent / overshoot0.03 % / 0.003 %
Freewheeling diodeAnalyticDecaywithin 0.5 %
Crowbar decayAnalyticCurrentwithin 0.001 %
Star and delta netlistsNodal analysisCurrents6 digits

TEAM 7: at 200 Hz and ωt = 90° the field is 3.5–4 G high along the line; a phase offset in the measurement is suspected but not confirmed, so the test keeps the tighter tolerance and the discrepancy is reported as is.

Motion, machines and magnets

TEAM 30a: the three-phase induction motor, 60 Hz, 1 m deep, torque checked at 0, 200, 400 and 1200 rad/s against the published table. Machine torque is Arkkio’s method over the meshed air-gap ring.

CaseChecked againstQuantityError
TEAM 30a, 0 / 200 / 400 / 1200 rad/sPublished reference tableTorquewithin 0.02 %
TEAM 30aIndependent FE referenceRotor losses≤ 4 %
TEAM 30a, slip model in ACMotion solutionTorque at s = 0.47 / s = −2.18+0.7 % / −4.9 %
TEAM 30a, locked rotor, 1 ms time stepAC solutionTorque: Crank–Nicolson (implicit Euler for comparison)−0.9 % (−9 %)
4-pole rotor, 12-slot statorFEMM 4.2Cogging torquewithin 6 % of amplitude
12-slot, 4-pole sector sweepWhole machineCogging torquewithin 1.6 % of amplitude
One pole of a 4-pole rotor (periodic sector)Whole machineFields / energy × 40.3 % / 0.001 %
Anti-periodic sector, AC and transientWhole machineBar loss / flux linkage × 40.005 % / 1 %
Translational periodic arrayWhole modelField at every probewithin 1 %
Rotating magnetω · dλ/dθ from a static sweepBack-EMFpasses
Magnetic pendulum, load-driven2π √(J/k)Period−0.05 %
Rotor on a torsion spring, load-drivenAnalyticPeriod0.01 %
Load-driven sector modelWhole machineRotor anglewithin 0.15°
Magnetic gear, two rotorsExact ratio 2.5Torque ratio; sum of the three torques2.44–2.55; 0.4 %
Magnetic gear, free outer rotorGear ratio −120Lock-in speed−119.997 rpm
Plunger, blockedV/R (1 − e−tR/L)Currentwithin 0.2 %
Plunger, freeEnergy balanceElectrical in vs mechanical + storedwithin 0.3 %
Plunger stroke forceVirtual work dW′/dy (−20.14 N)Maxwell stress force (−20.09 N)0.2 %
Eddy-current brakeLow-speed formula (−0.26054 N)Drag (−0.26033 N)0.08 %
45° of rotation at 1000 rpm, adaptive time stepsFixed fine stepsFlux linkagewithin 0.4 % of peak
Irreversible demagnetization with recoilDemagnetization law, per elementB at every stepwithin 0.2 mT
Cylindrical magnetAnalyticMean demagnetization marginwithin 0.3 mT
Magnetizing fixture, half-field curveExactMagnetized fraction50.001 %

Quick design against finite elements

Quick design is an analytic (magnetic-equivalent-circuit) estimate of the template machine, about 0.1 ms per design. It is a sizing tool: this is how far it sits from the full FE model of the default 12-slot, 10-pole machine at 10 A, using the tabulated M270-35A steel.

QuantityQuick designFinite elementsDifference
Magnet flux linkage ψm67.7 mWb67.2 mWb+0.7 %
Phase EMF at 1500 rpm, peak53.2 V52.8 V+0.8 %
Torque at 10 A, q axis5.08 N·m5.01 N·m+1.4 %
Ld (2D part)1.19 mH1.20 mH−0.8 %
Lq (2D part)1.28 mH1.18 mH+8 %
Open-circuit iron loss7.4 W8.2 W−10 %

Buried-magnet rotors (flat, V and spoke) are rougher: flux linkage within 15 %, best torque within 20 %, Ld and Lq within 35 % of FE, because the estimate has no leakage-bridge saturation model. The induction-machine estimate reads 5–8 % above FE on torque at every slip and within 3 % on current. That is why the button next to the estimate builds the FE model.

Where the error comes from

Four things move a finite-element result. TerreLenz shows you each.

The air region

A finite box moves far-field results by about 1.6 % depending on whether the wall is field-normal or flux-tangential, and the effect grows with distance: +1.93 % on the block magnet at 20 mm. Open boundaries remove it; Check accuracy adds more air and shows what changed.

The mesh

On a typical wire-force model, a mesh refinement moves the answer by 0.4 % and the air-region choice by 7.4 %, so the tests always vary both. Adaptive refinement shows the convergence pass by pass rather than asking you to trust one mesh.

The element order

First-order elements reach 30 % error near a magnet, which is why second order is the default and not an option to remember. Orders above two are on the roadmap.

The time step

On TEAM 30a with the rotor locked and a 1 ms step, implicit Euler reads the torque 9 % low; Crank–Nicolson reads it 0.9 % low. Crank–Nicolson is the default, adaptive BDF2 is available, and every transient starts from a converged static solve.

Limits

What TerreLenz doesn’t do yet.

You should know these before you buy, not after. The tester build reports the same list under Help.

  • Motion is 2D. Rotation, periodic sectors, netlists and the controller in the loop are 2D today. 3D covers magnetostatics, AC and transients with coils on current or voltage sources (series R, L and C, no switches), eddy currents and saturation, at fixed time steps. 3D motion is next on the roadmap.
  • 3D AC is linear. A saturating body in a 3D eddy-current study is refused with a message, not silently approximated.
  • 2D AC treats saturation with an effective B-H curve, fundamental only. On the saturated C-core that reads +5.9 % on flux linkage, so for waveforms distorted by saturation use a transient study.
  • Element order is 1 or 2. Higher orders are planned.
  • The built-in soft materials are generic approximations, not datasheet data. Enter your own B-H curves and loss coefficients for design work. The magnet catalog (129 grades) is fitted to the standard grade tables and measured production lots.
  • Iron loss is Bertotti per harmonic. Minor loops and DC bias are not modeled, and stranded (Litz) coils have no proximity-loss model. Magnet eddy loss comes from transient FE, not from quick design.
  • 2D heating is steady state, air gaps don’t conduct, planar models have no end windings, and the machine thermal network is not yet calibrated against heat runs.
  • Per-body torque on a rotor at the default mesh reads 3–6 % below Arkkio’s method, so machine models use Arkkio. Cogging against FEMM is within 6 % of amplitude; the sector sweep is within 1.6 %.

Engineers’ FAQ

The questions we’d ask.

Which formulations does it solve?

2D planar and axisymmetric magnetostatics use the vector potential Az (r·Aφ in axisymmetry) with reluctivity ν(|B|²). 2D AC and transient studies use the a-v formulation with stranded and massive conductors, coupled to circuits. 3D magnetostatics without coils uses the total scalar potential; 3D with coils, and 3D AC, use an ungauged vector potential on second-order edge elements, with each coil’s current density taken from a conduction solve and made exactly divergence-free.

How are force and torque computed?

Force per body is the Maxwell stress tensor integrated over a shell of air around the body, with a thin-film term for bodies in contact. Torque on a rotor uses Arkkio’s method over the meshed air-gap ring, which is far less mesh-sensitive than a surface integral. Virtual work is available as a cross-check; the two agree to 0.2 % on the plunger benchmark.

How are flux linkage and inductance defined?

Flux linkage is the integral of A over the coil section, times turns and depth (or 2π). The inductance matrix is reported two ways: apparent, from each circuit alone at its test current, and incremental, from ±1 % steps about the operating point. For permanent-magnet devices the incremental value is (λ − λ0)/i. AC studies give the coil impedance R + jωL directly.

What linear solvers are used, and on how many cores?

2D and small 3D systems (below about 20 000 unknowns) use a sparse direct solver. Larger 3D systems use conjugate gradients with domain-decomposition (BDDC) or algebraic multigrid preconditioning, threaded across up to 12 physical cores. Sweeps run several solves in parallel, each in its own process, so a failed variant is reported rather than stopping the sweep.

For scale: TEAM 7 at 675 000 second-order edge unknowns solves in about 22 s per frequency on a desktop PC.

How is motion handled?

Rotation uses a moving band in the air gap, at a set speed, from an angle table, or load-driven: a semi-implicit Euler step on the rotor’s inertia, friction and load with Arkkio torque evaluated each step. Up to two rotors can turn, which is how magnetic gears are modeled. Translation is a static position sweep (re-meshed at each position), a quasi-static plunger model on λ(x, i) and F(x, i) tables, or a full 2D transient with eddy currents, re-meshed every step. Skew is modeled by slices.

How does time stepping work?

A theta scheme with implicit Euler or Crank–Nicolson (the default for new projects), or adaptive BDF2 with error control. Every transient starts from a converged static solve, so there is no artificial start-up transient. Nonlinear steps use Newton–Raphson with the exact Jacobian.

How is temperature handled?

Each material carries temperature coefficients or tables: Br and HcJ for magnets (library values −0.12 / −0.6 %/°C for NdFeB, −0.2 / +0.3 for ferrite, −0.035 / −0.25 for SmCo), resistivity for conductors, and saturation polarization for steels, with per-temperature demagnetization curves. A 2D heating study feeds its temperatures back into all of them.

Are results reproducible?

Yes. Meshing is deterministic, and a test checks that two runs of the same model produce byte-identical meshes. Every solve is written as plain files you can archive and re-run, and a project file is a zip of JSON you can read without TerreLenz.

Why a rainbow colormap, and can I change it?

By default, magnitudes use turbo, a rainbow map whose lightness is smoothed so it doesn’t show the false bands of the classic “jet”, and signed values use cool-warm. Rainbow maps separate more levels by eye, but their lightness doesn’t rise evenly, so they can overstate some features and they don’t survive a grayscale print.

When that matters, switch to a perceptual map in the Lenz · Results panel under Colors: Viridis or Inferno, whose lightness rises evenly, or Cividis, which is also safe for the most common color blindness. Grayscale is there too. Your choice is remembered and used for the report’s field plots, and the report’s method notes name the map.

Can I run these cases myself?

Ask us for any benchmark on this page as a project file and we’ll send it with the tester build. Or bring your own reference case: the fastest way to judge a solver is on a problem whose answer you already know.

TerreLenz — Electromagnetic and motor simulation

Check it on a problem you already know the answer to.

Request the tester build and any benchmark on this page as a ready-to-run project, or send us your own reference case, a measurement or a known design, and our applications engineers will model it with you.

Every license includes full support, in every region.