Skip to main content
University Physics II

University Physics II · Gauss's Law · 3.8

Numerical Flux & 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.

01

Build the model

Connect the measurement to the mechanism.

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.

Simple definition
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.
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 m

Discrete 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 inputE(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 surface

Measured order of convergencep = log₂[(Φₕ − Φₕ/2)/(Φₕ/2 − Φₕ/4)]

p well below 2 means the integrand is unresolved — usually a charge too near the surface.

p ≈ 2 confirms the mesh, not the physics

Flux as solid angledΦ = 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 it

01

What 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.

02

Cutting 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.

03

Refinement, 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₂[(Φₕ − Φₕ/2)/(Φₕ/2 − Φₕ/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.

04

Irregular 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.35 N m² C⁻¹. The sum delivers it: 283.1 at 384 patches (+0.27%), 282.40 at 6144 (+0.017%), 282.355 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.

05

Resolve 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.

06

What 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.

02

Change one variable at a time

Make the relationship visible.

Interactive model
0.200 m
0.20 m

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.

Interactive physics modelA square Gaussian patch of half-width a = 0.200 m seen edge-on as the horizontal axis, with a 1.0 nC point charge 0.20 m below its centre; the two arrows are rays from that charge to the patch centre and to the patch edge — their lengths are distances, not field strengths, and the longer oblique one lands where E⊥ is weaker. The curve is the exact normal component E⊥ across the patch, normalised to its value at the centre where the single midpoint sample is taken, and the open rectangle is what that one sample assumes — the centre value held flat across the whole width. The exact flux through the patch is 18.82 N m² C⁻¹ against a one-patch estimate of 35.95 N m² C⁻¹, a ratio of 1.910.E⊥ / E⊥(0) on the surfacerectangle = midpoint sampleedge midpoint = 0.354 × centreq = 1.0 nC at depth d = 0.20 mpatch width 2a = 0.40 m

EXACT PATCH FLUX18.82 N m² C⁻¹

ONE-PATCH ESTIMATE E(0)·(2a)²35.95 N m² C⁻¹

ESTIMATE ÷ EXACT1.910

CORNER E⊥ ÷ CENTRE E⊥0.192

Live interpretationEXACT 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

03

Catch the common trap

Explain before calculating.

A point charge q sits at the centre of a cube of side 2a. You estimate the flux through one face with a single patch — the field at the face centre, dotted with the outward normal, times the face area 4a². By what factor does that estimate exceed the exact face flux q/(6ε₀)?

Choose an answer to test the model.

04

Practice & worked examples

Reason from the model, then test the result.

EasyA 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.
  1. 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.
  2. Φ = Q(enc)/ε₀ = 2.5 × 10⁻⁹ C ÷ (8.854 × 10⁻¹² C² N⁻¹ m⁻²) = 282 N m² C⁻¹.
  3. 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.
  4. 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

MediumA 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.
  1. 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.
  2. E = kq/a² = (8.988 × 10⁹ × 2.0 × 10⁻⁹) ÷ (0.10 m)² = 17.98 ÷ 0.010 = 1.80 × 10³ N C⁻¹.
  3. One patch, one sample: Φ₁ = E × A = 1797.6 N C⁻¹ × (0.20 m)² = 1797.6 × 0.040 m² = 71.9 N m² C⁻¹.
  4. Exact face flux: symmetry splits q/ε₀ six ways, so Φ = q/(6ε₀) = 2.0 × 10⁻⁹ ÷ (5.313 × 10⁻¹¹) = 37.6 N m² C⁻¹.
  5. 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

HardA 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.
  1. Successive differences: Φₕ − Φₕ/2 = 113.37 − 113.05 = 0.32 N m² C⁻¹, and Φₕ/2 − Φₕ/4 = 113.05 − 112.97 = 0.080 N m² C⁻¹.
  2. 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.
  3. With p = 2 the error still left in Φₕ/4 is (Φₕ/2 − Φₕ/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⁻¹.
  4. Q(enc) = ε₀Φ = 8.854 × 10⁻¹² × 112.94 = 1.00 × 10⁻⁹ C.
  5. 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.

Answerp = 2.00; Φ → 112.94 N m² C⁻¹; Q(enc) = 1.00 nC