Electric fields store energy in space. A field solver can estimate that energy from samples and integrate it over a declared domain. The number is inseparable from its cell volumes, material model, singularity treatment, and boundary extent; calling it “the energy” without those inputs is under-specified.
Think like a programmer
Make domain geometry, cell volumes, permittivity, field convention, and singularity cutoff part of the energy API. Map immutable field snapshots to per-cell density, then reduce them with volumes into a new total. A point charge's ideal self-energy diverges, so an increasing result under cutoff refinement is a model warning, not a UI bug to clamp away.
Model checklist
Inputs
Vector field samples, cell volumes, positive permittivity, domain bounds, material assignment, cutoff/exclusion policy, and grid spacing.
State
Per-cell magnitude, energy density, included-volume mask, accumulated energy, and refinement metadata.
Rule
Compute |E|², multiply by ½ε in each included cell, then sum density times cell volume.
Output
Domain-limited field energy, density map, excluded-region report, and refinement comparison.
Check
Doubling E magnitude quadruples local density; all included cell volumes/energies are nonnegative; changing cutoff/domain is reported; grid refinement is compared at a fixed physical cutoff.
\[u=\frac12\varepsilon_0E^2\]
For a material, use its stated permittivity rather than silently substituting vacuum ε₀. The domain total is a Riemann-sum approximation,
\[U_{mathrm{domain}}approxsum_{mathrm{cells}}rac12arepsilonlVertmathbf E
Vert^2,Delta V\]
The square makes local energy density insensitive to field direction and nonnegative. It also means a factor-of-two amplitude error is a factor-of-four energy error. Integrating a point-source field all the way to its ideal zero-radius location fails: field magnitude grows too fast and the continuum point model has divergent self-energy. State an excluded radius, finite source model, or other regularization, then report how the answer changes when that physical assumption changes.
Try this experiment
Prediction: Doubling field magnitude quadruples local energy density; enlarging a finite domain changes the integrated total when field remains nonzero outside the old boundary.
Compute density for a fixed ε and field magnitudes E and 2E. Name every metadata item needed to compare two integrated results. Then define a fixed physical exclusion radius around a point source and explain why shrinking it is not ordinary convergence evidence.
Where this model breaks
Self-energy and material response require careful physical regularization. A finite sampled box is not all space, and a coarse grid can miss strong gradients. Dispersive, lossy, nonlinear, anisotropic, or time-varying materials need richer energy expressions. Field energy accounting also needs Poynting flux through boundaries when energy can enter or leave the domain.
Summary
Field energy is an integration problem over explicit material, domain, and cutoff assumptions. Preserve density data and refinement metadata, then distinguish numerical convergence from a divergent or incomplete physical source model.
Glossary
Energy density: energy per volume.
Permittivity: electric response parameter.
Cutoff: declared limit avoiding singular region.
Cell volume: physical volume represented by one discrete sample.
Regularization: stated modification that makes a singular ideal model computable.
Refinement: reducing grid spacing or cutoff while tracking result changes.
D. J. Griffiths, Introduction to Electrodynamics, field energy and point-source idealizations.
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.
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 Fields, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Electrostatics, 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 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
Which values are inputs, and which values must remain state?
What observable result would tell you the model is behaving as expected?
Which assumption would you test first before applying the model to a real system?
Model review: turn Energy in Fields into a test
Estimate electric field energy with explicit sampled domains, cell weights, and singularity policy.
Name the inputs and units that the electrostatics model needs.
Separate the state you must keep from values you can calculate when needed.
Write one rule that maps the current state and inputs to an observable result.
Choose a limiting case, unit check, invariant, or known result before trusting an output.
State one assumption you would change before using this simplified model for a real decision.