Monday 29 June 2009

A problem that keeps me up at night

What is the resistance of a square laminar when measured from the corners? More precisely, assume you have a square slice of material with conductivity σ of side length L and thickness τ ≪ L. If you connect an ohmmeter between two diagonally opposite corners, what resistance will you measure?


Position the slab of material so that it occupies the space [-L,L]⨉[-L,L]⨉[-τ,τ]. We will connect the contacts of the ohmmeter to the vertical edges x=y=-L and x=y=L. Let V(x) be the electrostatic potential and E = -∇V be the electic field. According to Ohm's law, the current density is J = σE.

Since there is no net charge density in the material, the potential obeys the Laplace equation:
    ∇2 V = 0.

No current can flow past the material boundaries. This gives the boundary condition
    dV/dn = 0, when x=±L, y=±L or z=±τ,
where dV/dn is the derivative of the potential in the direction of the face normal.

The resistance is a ratio R=ΔV/I. Therefore, we can assume that there is a constant potential difference across the terminals. This gives another boundary condition:
    V(-L,-L,z) = -1 and V(L,L,z) = 1.

Given V(x), we can calculate the current through the material:

I = \int_S {\bf J} \cdot {\rm d}{\bf a} = -\sigma \int_S \nabla V \cdot {\rm d}{\bf a},where S is a surface inside the material enclosing (-L,-L,z). The resistance is then given by R = 2/I.

The first problem then is to solve for V(x). Some observations:

  1. We can always set L = 1 by rescaling x and y.

  2. The boundary conditions are independent of z. Therefore we can assume V(x,y,z) = V(x,y) which reduces the problem to two dimensions.

  3. The problem is symmetric under reflection about the line y = x. This means that V(x,y) = V(y,x).

  4. The problem is antisymmetric under reflection about the line y = -x. This means that V(x,y) = -V(-y,-x). In particular, when y = -x, V(x,-x) = -V(x,-x) and so V(x,-x) = 0.

The equipotential curves are perpendicular to the edges due to the first boundary conditions. It's easy to sketch a qualitative solution:

Quantitative sketch of the V(x,y) equipotential curves

I found this problem in [1]. There, they calculated the resistance to be R = 4/π 1/(τσ) using an infinite number of image charges. However, I want to check this answer numerically.

[1] Lawrence R. Mead, Resistance of a square lamina by the method of images, American Journal of Physics, 77 (3), (2009). Abstract

Saturday 20 June 2009

A discrete version of the divergence theorem

The divergence theorem (Gauss's theorem) from vector calculus says
   \int_V (\nabla \cdot {\bf F}) {\rm d}V = \int_{\partial V} {\bf F} \cdot {\rm d}{\bf a}
I am interested in the case where the vector field is derived from a scalar potential F = ∇u:
   

This theorem is for a continuous system in ℝ3. However, numerical algorithms often operate on discrete grids in ℤd where d = 2 or 3. I will now derive a discrete version of this theorem.

Definitions:

Let u be a scalar field on the grid u: ℤd → ℝ, x ↦ ux.

Let x, y ∈ ℤd. We'll use the Manhattan metric |x - y| = Σi |xi - yi|. Cells x and y are called adjacent if and only if |x - y| = 1. Note that diagonal cells are not adjacent.

Let V be a subset of ℤd. V' is the complement of V in ℤd.

Let nx be the number of cells adjacent to x in V. Therefore, nx = ΣyV, |x-y|=1 1.

Let the second-order finite difference Laplacian be given by Lx = - 2d ux + Σy, |x-y|=1 uy.

Theorem:

   \sum_{{\bf x} \in V} L_{\bf x} = \sum_{{\bf x} \in V, {\bf y} \in V', |{\bf x}-{\bf y}|=1}(u_{\bf y}-u_{\bf x})

Note that right-hand side involves only points on the boundary of V. These correspond to first-order finite difference derivatives. There is one term for each arrow in this diagram:

Diagram showing the volume V on the grid.

Proof:

Starting from the left-hand side, expand the Laplacian to get a sum of field terms:
   ΣxV Lx = Σx cx ux,
where cx are constant coefficients. From the definition of the Laplacian, we can see that cx = nx - 2d if xV, or cx = nx if xV':
   = ΣxV ux (nx - 2d) + ΣxV' ux nx.   (1)

Since each cell is adjacent to 2d others,
   2d = Σy, |x-y|=1 1
     = ΣyV, |x-y|=1 1 + ΣyV', |x-y|=1 1
     = nx + ΣyV', |x-y|=1 1
   2d - nx = ΣyV', |x-y|=1 1.

Now put this into (1):
   ΣxV Lx
   = - ΣxV, yV', |x-y|=1 ux + ΣxV', yV, |x-y|=1 ux
   = ΣxV, yV', |x-y|=1 (uy - ux). ■