
Physics II course sequence · Interactive lesson
Numerical flux and limits of symmetry
Take away the sphere, the cylinder and the plane and ∮E⋅dA = Q(enc)/ε₀ still holds — it just stops handing you the field. What is left is a number you can compute patch by patch, and a check that catches mistakes.
UPII-03.08 · Lesson 8 of 8 in this unit. Position is not a completion score.Build the model
Always true, only sometimes useful
The key idea
A numerical flux estimate replaces ∮E⋅dA with a finite sum over surface patches, Φ ≈ Σ E(rᵢ)⋅n̂ᵢ ΔAᵢ, sampling the field at each patch centroid. It works on any geometry, but it takes the field as input rather than producing it.
Example. Cut each face of a cube around a central charge into 8 × 8 patches and the sum lands 0.38% above q/ε₀; at 32 × 32 it is 0.024% above. The mesh is what is wrong, never the law.
The complete physical model and assumptions
Gauss's law is a statement about a closed surface, not a method for finding fields. Its truth comes from the inverse-square field and the outward-normal bookkeeping, and both survive any charge arrangement and any surface shape. Symmetry adds one extra step, and only that step: if |E| is constant over the surface and everywhere along the normal, ∮E⋅dA collapses to |E|A and the law can be solved for E. Remove the symmetry and the step disappears while the law does not. You can still get the flux — cut the surface into N patches, sample E at each centroid, and sum E⋅n̂ ΔA — but you need E first, so the sum verifies rather than solves. Its worth is that it converges: for a resolved integrand the midpoint error falls as h², so halving the patch width quarters it, and the residual Φε₀/Q(enc) − 1 becomes a measurable audit of the mesh and of the field model behind it.
1What symmetry actually buys you
Gauss's law says ∮E⋅dA = Q(enc)/ε₀ for every closed surface, whatever the charges do. Nothing in it selects a shape. The step you learned for spheres, cylinders and sheets is separate and comes after: choose a surface on which |E| is constant and everywhere along the outward normal, so the integral becomes |E|A and the law can be rearranged into E = Q(enc)/(ε₀A). That rearrangement is what symmetry licenses, and it is the only thing symmetry licenses. Put a point charge at the centre of a cube and the law still fixes the total flux at q/ε₀, but no rearrangement follows, because the normal component on that surface is not constant: at a face corner it is 1/(3√3) = 0.192 of its value at the face centre, a spread of 5.2. Dividing flux by area gives q/(24ε₀a²) for a cube of side 2a, which is 48% below the face-centre field and 2.7 times the corner field — an average that matches the field at neither the face centre nor a corner — it is attained only on a ring between them, which is no place a formula would ever hand you.
2Cutting the surface into patches
The flux integral is a sum, so evaluate it as one. Partition the closed surface into N patches of area ΔAᵢ, take the centroid rᵢ of each, get the outward unit normal n̂ᵢ there, and add up E(rᵢ)⋅n̂ᵢ ΔAᵢ. That is the midpoint rule applied to a surface, and the two things that break it are a normal accidentally taken inward — which flips the sign of that patch — and a field evaluated somewhere other than the centroid. Try the crudest version on the cube: one patch per face, sampled at the face centre where E = q/(4πε₀a²) along the normal, times the face area 4a², gives q/(πε₀) per face. The exact value is q/(6ε₀), so the estimate is high by 6/π = 1.91, a 91% error from a sum that used the correct field at every point it sampled. The field it did not sample was weaker, and there was much more of it.
3Refinement, and the error law you should see
Refine and the error obeys a law. For an integrand the mesh resolves, the midpoint error scales as h² in the patch width, so on a fixed surface where N ∝ h⁻² it falls as 1/N. Take the same cube face: 2 × 2 patches give +3.96%, 4 × 4 give +1.53%, 8 × 8 give +0.383%, 16 × 16 give +0.0957%, and 32 × 32 give +0.0239%. From 8 × 8 onward each halving of h divides the error by almost exactly four, and p = log₂[(Φ(h) − Φ(h/2))/(Φ(h/2) − Φ(h/4))] returns 2.00. The two coarsest meshes do not obey it — the step from 2 × 2 to 4 × 4 gains only a factor 2.6 — because they are not yet resolving the integrand. So a convergence order is something you measure and confirm, not something you assume; quoting one from two coarse meshes is how a mesh error gets mistaken for physics.
4Irregular charges: the sum is invariant, the patches are not
Now break the symmetry outright. Around a cube of side 2.00 m centred on the origin, put +4.0 nC at (0.30, −0.20, 0.50) m, −1.5 nC at (−0.60, 0.40, −0.10) m, and +6.0 nC outside at (2.50, 0, 0) m. Enclosed charge is +2.5 nC, so the flux must be 2.5 nC/ε₀ = 282.358 N m² C⁻¹. The sum delivers it: 283.12 at 384 patches (+0.27%), 282.41 at 6144 (+0.017%), 282.361 at 98 304 (+0.0011%). The external charge is the interesting part. Its own contribution converges to zero — −0.34, then −0.021, then −0.0013 N m² C⁻¹ — but patch by patch it is large, entering through the near face and leaving through the far one. Its field is on the surface at full strength the whole time. Only the total cancels, which is exactly what the law claims and no more.
5Resolve the length scale, or refine where it matters
Uniform refinement is not always the fix, because the integrand has its own width. Put 1.0 nC in the same 2.00 m cube but only 0.05 m below one face. The normal component there is concentrated in a spot of about that size, so a mesh with h = 0.25 m steps straight over it and returns 84.0 against 112.94 N m² C⁻¹ — 25.6% low. Halving to h = 0.125 m still gives −10.4%. Only once h = 0.0625 m, comparable with the 0.05 m gap, does the error drop to −1.14%, and h = 0.031 m reaches −0.006%. The working rule is that h must be well below the distance from the surface to the nearest charge, which is an argument for adaptive refinement: subdivide the patches where the integrand is peaked and leave the quiet faces coarse. A charge sitting exactly on the surface has no finite answer at all; move the surface.
6What the check certifies, and what it cannot
Treat the result as a test, not a proof. The flux is a single scalar collapsed out of the whole surface, so agreement to 10⁻⁵ does not mean the field is right patch by patch — opposite errors cancel inside the sum and leave no trace. What it does catch is cheap and worth catching: a normal taken inward, a charge left out of Q(enc), a charge wrongly counted as enclosed, a stale ε₀. And notice what the whole procedure never does. It never produces E. You must already have the field, from superposition or from a Poisson solver, before the first patch can be evaluated. Gauss's law is a constraint the solution has to satisfy, not an algorithm for finding it. Symmetry is the special case where the constraint is tight enough to be inverted; the rest of the time the law is exactly as true and simply will not do the work for you.
Key equations
Read the units, assumptions and limits before substituting.
Gauss's law, the target value
∮E⋅dA = Q(enc)/ε₀
True for any closed surface. External charges cancel in the sum; they do not vanish from the field.
ε₀ = 8.854 × 10⁻¹² C² N⁻¹ m⁻²; flux in N m² C⁻¹ = V mDiscrete flux sum
Φ ≈ Σᵢ E(rᵢ) ⋅ n̂ᵢ ΔAᵢ
The midpoint rule on a surface. One normal taken inward flips the sign of that patch.
rᵢ is the patch centroid, n̂ᵢ the outward unit normal, ΔAᵢ in m²Field the sum needs as input
E(r) = (1/4πε₀) Σₖ qₖ (r − rₖ)/|r − rₖ|³
Superposition supplies E for discrete charges; a Poisson solver supplies it otherwise.
1/(4πε₀) = 8.988 × 10⁹ N m² C⁻²Refinement error
Φ(h) − Φ ≈ C h², so error ∝ 1/N
Resolved integrand only. Halve h and the error falls by four.
h is the patch width in m; N ∝ h⁻² patches on a fixed surfaceMeasured order of convergence
p = log₂[(Φ(h) − Φ(h/2))/(Φ(h/2) − Φ(h/4))]
p well below 2 means the integrand is unresolved — usually a charge too near the surface.
Φ(h) is the flux sum at patch width h; p ≈ 2 confirms the mesh, not the physicsFlux as solid angle
dΦ = q dΩ/(4πε₀), so Φ = qΩ/(4πε₀)
Why shape cannot matter: every closed surface subtends the same solid angle.
Ω = 4π sr for any closed surface around q, 0 for one that excludes itInteractive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. Set a = d = 0.20 m and the patch is one face of a cube around the charge — the estimate overshoots by exactly 6/π = 1.910 while the corner field is 0.192 of the sampled one — then halve a and watch the excess fall by about four, the h² law, or shrink d instead and watch one sample miss a peak it can no longer resolve.
Live results
- EXACT PATCH FLUX
- 18.82 N m² C⁻¹
- ONE-PATCH ESTIMATE E(0)⋅(2a)²
- 35.95 N m² C⁻¹
- ESTIMATE ÷ EXACT
- 1.910
- CORNER E⊥ ÷ CENTRE E⊥
- 0.192
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Patch half-width a: 0.200 m; Charge depth d: 0.20 m
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The usual claim is that Gauss's law fails for irregular distributions. It does not — nothing in ∮E⋅dA = Q(enc)/ε₀ mentions symmetry. What fails is the extra step of pulling |E| outside the integral, which needs |E| constant and along the normal. The consolation prize Φ/A is not a rescue either: one scalar divided by an area is still one scalar, carrying no direction and no address on the surface, so it cannot be a field — and reading it as one is how a true statement about flux turns into a false statement about E.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
A closed surface encloses +4.0 nC and −1.5 nC, while a +6.0 nC charge sits outside it. Find the flux through the surface, and say what changes if the surface is a crumpled bag rather than a cube.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 4 steps revealed.
- Only enclosed charge appears on the right-hand side: Q(enc) = +4.0 nC − 1.5 nC = +2.5 nC. The 6.0 nC outside is not in the sum.
- Φ = Q(enc)/ε₀ = 2.5 × 10⁻⁹ C ÷ (8.854 × 10⁻¹² C² N⁻¹ m⁻²) = 282 N m² C⁻¹.
- Nothing changes for the crumpled bag: an enclosed charge subtends the full 4π sr whatever the shape, and Φ = qΩ/(4πε₀) knows only that solid angle.
- The outside charge is not absent from the surface — it changes E at every point of it — but its lines enter and leave, so it adds zero to the total. That 282 N m² C⁻¹ is the target any patch sum has to converge to.
Answer. Φ = 2.82 × 10² N m² C⁻¹ (= V m), identical for any closed surface enclosing the same 2.5 nC
MediumExample 2
A 2.0 nC point charge sits at the centre of a cube of side 20 cm. Estimate the flux through one face with a single midpoint patch — the field at the face centre, dotted with the outward normal, times the face area — and compare it with the exact face flux.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Half-side a = 0.10 m, so the face centre lies 0.10 m from the charge and E there points straight along the outward normal.
- E = kq/a² = (8.988 × 10⁹ × 2.0 × 10⁻⁹) ÷ (0.10 m)² = 17.98 ÷ 0.010 = 1.80 × 10³ N C⁻¹.
- One patch, one sample: Φ₁ = E × A = 1797.6 N C⁻¹ × (0.20 m)² = 1797.6 × 0.040 m² = 71.9 N m² C⁻¹.
- Exact face flux: symmetry splits q/ε₀ six ways, so Φ = q/(6ε₀) = 2.0 × 10⁻⁹ ÷ (5.313 × 10⁻¹¹) = 37.6 N m² C⁻¹.
- Ratio = 71.9 ÷ 37.6 = 1.91 = 6/π. The one sample took the strongest field on the face and handed it the whole area; at a corner the normal component is only 1/(3√3) = 0.192 of it.
Answer. Φ₁ = 71.9 N m² C⁻¹ against 37.6 N m² C⁻¹ exact — high by 6/π = 1.91, a 91% error
HardExample 3
A flux sum over a fixed closed surface around an unknown charge returns 113.37 N m² C⁻¹ at patch width h, 113.05 at h/2 and 112.97 at h/4. Find the measured order of convergence, extrapolate to h → 0, and get the enclosed charge.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Successive differences: Φ(h) − Φ(h/2) = 113.37 − 113.05 = 0.32 N m² C⁻¹, and Φ(h/2) − Φ(h/4) = 113.05 − 112.97 = 0.080 N m² C⁻¹.
- p = log₂(0.32 ÷ 0.080) = log₂ 4.00 = 2.00, so the mesh is in the h² regime and the refinement is telling the truth rather than drifting.
- With p = 2 the error still left in Φ(h/4) is (Φ(h/2) − Φ(h/4))/(2² − 1) = (113.05 − 112.97)/3 = +0.027 N m² C⁻¹, so Φ(h → 0) = 112.97 − 0.027 = 112.94 N m² C⁻¹.
- Q(enc) = ε₀Φ = 8.854 × 10⁻¹² × 112.94 = 1.00 × 10⁻⁹ C.
- The 0.03 N m² C⁻¹ that vanished under extrapolation was mesh error, not physics: Gauss's law was exact at every mesh, only the quadrature was not.
Answer. p = 2.00; Φ → 112.94 N m² C⁻¹; Q(enc) = 1.00 nC
Quick check
Select an answer and explain it before checking.
Review & continue
A numerical flux estimate replaces ∮E⋅dA with a finite sum over surface patches, Φ ≈ Σ E(rᵢ)⋅n̂ᵢ ΔAᵢ, sampling the field at each patch centroid. It works on any geometry, but it takes the field as input rather than producing it.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.