A Byte of PhysicsLogo

Energy in magnetic fields

An inductor stores energy as its current grows. The lumped model connects electrical work to a positive magnetic-energy state. It is therefore a useful regression surface for a circuit integrator: a state update should not create unexplained energy when source, resistance, and time-step accounting are available.

Think like a programmer

Calculate stored energy with one validated canonical function from the same current state that the integrator updates. Compare discrete energy change with integrated branch power under a named time-level convention. This makes a numerical accounting residual visible instead of letting a transient plot hide drift behind smooth animation.

Model checklist

Inputs
Positive inductance L, signed current and voltage histories, time step/sample times, resistance/loss model, integration convention, and initial state.
State
Current, magnetic energy, source work, dissipated energy, cumulative power integral, and residual history.
Rule
Evaluate ½LI² at documented current time levels and accumulate VI with a documented quadrature rule.
Output
Stored energy, energy change, power ledger, and numerical residual.
Check
Energy is nonnegative and zero at zero current; reversing I leaves U unchanged; doubling |I| quadruples U; ideal constant-current voltage is zero; refinement reduces a fixed-problem accounting residual.
\[U=\frac12LI^2\]

For an ideal inductor, V = L dI/dt, so VI equals the rate at which ½LI² changes in the continuous model. A current reversal changes the sign of current and voltage conventions but not stored energy because current is squared. This makes two compact fixtures: I = 0 gives U = 0, and I = 3 A versus 6 A at fixed L gives a fourfold energy ratio.

\[P=VI= rac{d}{dt}left( rac12LI^2 ight)\]

In a discrete calculation, pick whether power uses the old, new, or midpoint current. Log that choice. Compare the cumulative power integral with the change in stored energy and any resistor dissipation; the remaining residual should be reported alongside grid/time-step refinement. This is how a programmer distinguishes a physical loss model from an integrator artifact.

Try this experiment

Prediction: Doubling current quadruples stored magnetic energy, while a refined ideal transient reduces its power-ledger mismatch.

Test zero current and compare energies at I = 3 A and 6 A for the same L. Then list the three ledger terms for a driven RL circuit and state whether power is sampled at the start, end, or midpoint of a step. Predict what changing that convention can do to a discrete residual.

Where this model breaks

Losses, saturation, core hysteresis, mutual inductance, parasitic capacitance, and distributed fields make ideal lumped inductor energy incomplete. High-frequency fields require spatial energy density and boundary flux rather than one L and one I. A low discrete residual still depends on correct units, source convention, and the physical appropriateness of the loss model.

Summary

Use a tested magnetic-energy function as an accounting check for dynamic circuits. Preserve time-level, power-integration, source, and loss conventions so a residual can diagnose numerical drift instead of being mistaken for magnetic physics.

Glossary

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Energy in Magnetic Fields, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Magnetism and Induction, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Energy in Magnetic Fields as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Energy in Magnetic Fields into a test

Use a canonical inductor-energy function to test dynamic circuit accounting.

  1. Name the inputs and units that the magnetism and induction model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: