Test the continuum equation with a constant
On \(0<x<1\) take a unit conductivity, positive rightward flux \(q=-u'\), and a steady source f with \(q'=f\). Prescribe the rightward flux at both endpoints as \(q_L,q_R\). Integrating the divergence equation gives
The outward unit normal is negative at the left endpoint, so the net outward flow is \(q_R-q_L\), even when both recorded sensor values are positive. In several dimensions the same requirement follows by integrating the divergence and applying the divergence theorem.
Testing the weak equation with \(v=1\) makes its left side identically zero. This recovers the flux balance without differentiating an approximate field. For every compatible right-hand side, adding any constant to u leaves its gradient and both prescribed fluxes unchanged. The magnitude of a potential is undetermined, while potential differences and flux can be well defined. Each disconnected region with pure-flux boundaries has its own compatibility equation and arbitrary constant.
Background · Compatibility condition
For minus the Laplacian of u equal to f with pure Neumann data, this integral condition is required. A constant still has to be fixed separately.
Separate the left nullspace test from the gauge condition
Take cell-centred finite volumes with equal width h and face flux \(q_{i+1/2}=-(u_{i+1}-u_i)/h\). The balance of each cell is \(q_{i+1/2}-q_{i-1/2}=h f_i\), with prescribed values replacing the two exterior faces. Add all rows. Interior face contributions cancel in equal and opposite pairs. The resulting symmetric matrix A has a constant right null vector and its range is orthogonal to that vector. Let b be the integrated loads including boundary terms and \(w_i=h\) the integration weights. A mean value \(\bar u\) on this unit interval can be imposed by the augmented system
For compatible data \(\lambda=0\). For incompatible data the first block solves for a deliberately modified source \(f_i-\lambda\). Choosing a mean makes the augmented system solvable either way; checking the multiplier identifies what it solved. Pinning a node and silently dropping one conservation equation can conceal the same mismatch as an artificial reaction at the pin.
Predict four cell values and audit an inconsistent measurement
Set \(f=2,\ q_L=0,\ q_R=2\). Exact integration gives
For a continuous mean of zero \(C=1/3\). With four equal cells the centre coordinates are 1/8, 3/8, 5/8 and 7/8. The centroid samples of \(-x^2\) have mean −0.328125, so the discrete mean-zero solution is \(0.3125,0.1875,-0.0625,-0.4375\). Adjacent differences give interior face fluxes 0.5, 1.0 and 1.5. The difference between the discrete centre values and the continuous mean-zero samples is the constant \(-h^2/12\); every interior face gradient is exact.
Now change only the recorded right flux to 2.4. The original source supplies 2 units per unit time and the boundaries demand 2.4. Thus \(\lambda=-0.40\) and the augmented system supplies an effective uniform source of 2.4. Alternatively, keeping the original source and the left measurement forces a right flux of 2. The plot shows both reconstructions and tells which data were modified. Adjusting only the mean translates either field without changing its slope. In a transient storage model, imbalance would change the mean in time instead of permitting a steady solution.
Set a nonzero flux mismatch, then vary the mean and the cell count independently. Observe which differences can be removed by a vertical translation. Check that the integrated imbalance remains the same under refinement.
Tutorial · locate the bias and choose a comparison observable
A unit-length domain receives \(f(x)=1+2x\). A left sensor reports rightward flux 0.3 and a right sensor reports 2.1. Compute the integrated residual. If both flux sensors are trusted, find the constant source adjustment implied by the augmented system. If only the source and left sensor are trusted, predict the right measurement. What quantity can two solvers compare without agreeing on a gauge?
Show the diagnostic
The source integral is 2 and net outflow is
Their difference is +0.2. The multiplier is +0.2, so the adjusted source would be \(0.8+2x\). Keeping the original source instead predicts
Differences \(u(x_b)-u(x_a)\), gradients and fluxes are gauge independent. A single imbalance equation cannot tell which instrument is wrong. Independent source or flux measurements are needed to choose between these reconstructions.
Further reading · FEniCS Project · Poisson equation with pure Neumann boundary conditions and a mean-value multiplier
Study the full derivation
A Fourier Poisson solver and the trouble caused by unresolved products · Spatial discretisation and field equations
In a periodic medium the constant part of a source decides whether a Poisson problem has any solution. Derive the Fourier solver, separate spectral and finite-difference symbols, and see how a nonlinear product can inject a false low-frequency source.