Skip to main content

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.
Starting model: Numerical flux and limits of symmetryA 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
Start with a picture. Change the model in the lab below.
1

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.

2

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 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 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 surface

Measured 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 physics

Flux 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 it
3

Interactive lab

Predict first. Explore the model. Compare the result.

Explore the model

0.200 m
0.025 to 0.5 m; steps of 0.025.
0.20 m
0.06 to 0.28 m; steps of 0.02.

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.

Interactive Physics II 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
A 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.

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

Baseline 0.200; choose 0.025 to 0.5, in steps of 0.025.
4. Compared with the saved baseline, this result will…

This experiment is kept only while this page is open. It does not change saved course progress.

4

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.

5

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.

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.

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.

6

Quick check

Select an answer and explain it before checking.

A point charge q sits at the centre of a cube of side 2a. A single midpoint patch is stretched over a whole face: the normal component of E is sampled only at the face centre, and that one value is credited with the entire face area 4a². By what factor does the estimate exceed the exact face flux q/(6ε₀)?
7

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.

Extra challenging questions

Connect several ideas, explore supplied data, and compare your reasoning with a worked solution.