Solution to the Diffusion Equation for Triangles

Solution to the Diffusion Equation for Triangles
Jan C. Myland and Keith B. Oldham*
Electrochemical Laboratory, Trent University, Peterborough, Ontario K9J 7B8, Canada
Abstract
A version of the image method for solving the two-dimensional diffusion equation has been explored
and applied to triangular domains. The images are sinks and sources which, in shape and size, replicate
the domain. It transpires that only three triangles are amenable to this procedure. Each of these triangles,
with their images, tile the entire plane. The diffusion equation under Dirichlet conditions has been solved
for those triangles and the results have been shown to concur with other treatments.
*
corresponding author: phone 1-705-748-1011x1336; fax 1-705-748-1625; email KOldham@TrentU.CA
Page 2 of 12
Introduction
This study will be concerned with a search for solutions to the diffusion equation
 2 u  2 u 1 u


x 2 y 2   t
(1)
under prescribed conditions. In equation (1), u(x,y,t) represents a time-dependent intensity distribution
existing in some two-dimensional domain, with  being the diffusivity. Our interest will be mainly
confined to circumstances in which the intensity has a uniform value U within some finite domain prior
to time t = 0 but, at this instant, the boundaries of the domain are brought, instantaneously and
permanently, to zero intensity. This is a very standard problem, a so-called Dirichlet problem, in applied
mathematics, with an abundant literature addressed to its solution by a variety of methods. Most of this
literature, however, concerns domains shaped in congruence with systems of orthogonal coordinates.
Triangular domains lack this simplifying feature and, in consequence, the problem is difficult to solve
analytically. We are aware of only two such solutions. One of these[1] treats the right-angled isosceles
triangle by cleverly modifying the eigenfunction solution for the square. The other[2] uses a Green
function approach to solve the equilateral triangle.
The “image method”[3, 4] is a popular method of solving equation (1), particularly in the context
of Green functions[5]. The Green function for a source of infinitesimal dimensions dy×dx in an
unbounded two-dimensional domain is
d 2 u ( x, y , t ) 
 ( x  x ) 2  ( y  y ) 2 
dx 'dy 
exp 

4t
4 t


(2)
This equation gives the intensity at point x,y (which may be inside or outside the domain) caused by the
source of unit strength at x,y. The classical Green function relates to such a point source and, when the
image method is employed to derive the function, the images are also points. Here we shall employ a
triangular source and triangular images.
Page 3 of 12
The Problem
Figure 1(a) depicts a triangle ABC with one of its vertices, A, positioned at the origin of a cartesian
coordinate system and oriented such that the side BC is parallel to the x-axis and separated from it by the
distance Y. This triangle constitutes the domain under study and it is therefore occupied, at t = 0, by a
uniform intensity of the diffusant. There is no renewal of the diffusant which therefore disperses at a rate
dependent on the magnitude of the diffusivity . We may formally state the problem as requiring the
solution to equation (1) subject to the initial condition
u ( x , y , 0)  U
at all points within triangle ABC
(3)
and the boundary conditions
u ( x, y , t )  0
at all points on lines AB , BC and CA
(4)
We require an expression for u(x,y,t) valid at all points within the triangle at all positive times.
Integration of equation (2) over the triangular domain, produces the expression
U
u ( x, y , t ) 
4 t
Y xB y / Y
  ( x  x ) 2  ( y  y ) 2 
exp
 dx dy 
0 x y / Y 
4

t

C
(5)
for the intensity at point x,y caused by the triangular source, where xB,Y and xC,Y are the cartesian
coordinates of vertices B and C. Of course, equation (5) does not solve our problem because, as yet, we
have taken no measures to ensure zero intensity on the sides of the triangle.
Triangular Images
In Figure 1(b), a second triangle CBD, has been juxtaposed to triangle ABC. This new feature
represents a “sink” that resembles the source ABC in strength and behaviour except that it liberates
negative, rather than positive, intensity. Being the site of perfect inverse symmetry, the line BC (and its
extensions) is guaranteed to have zero intensity, as desired. This is the principle of a popular method of
Page 4 of 12
solving differential equations. The language of optics is borrowed and the triangle CBD is said to be the
“image” of the original triangle, being obtained by “reflection” in the “mirror” line BC.
Similarly, it is useful to reflect triangle ABC across mirror lines AB and CA, and thereby create
fictitious sinks at the image locations represented by triangles BAE and ACF in Figure 1(c). However,
though triangle BAE is successful in nullifying the effect on line AB of triangle ABC, it destroys the perfect
conditions that previously existed on line BC by creating an excess of negative intensity on that line. The
proximity of triangle ACF likewise is beneficial in reducing the intensity on line CA but at the expense of
deleterious effects on lines BC and AB.
Return attention to line BC and note that a condition of perfect mirror symmetry can be restored to
this line by adding two more triangles, CDG and DBH in Figure 1(d), and making these into fictitious
sources of diffusant, behaving as perfect replicas of triangle ABC. But as we go on to apply the same ploy
to the other sides of ABC by adding triangular sources adjacent to triangles BAE and ACF, we again upset
the balance on line BC. Correction requires compensatory sinks. And so on, adding sinks and sources
alternately, and doubling the number each time. This procedure of adding fictitious positive and negative
elements successively is familiar in electrostatics, where it generally leads to a satisfactory convergent
solution. In our case, however, geometric constraints arise, that must be examined in detail.
If pitfalls can be avoided and a set (in fact an infinite set) of triangular images can be created that
together successfully nullify the intensity on the lines AB, BC and CA, then a solution to our problem is
available by combining terms resembling equation (5), thus:
Y
 ( x  x ) 2  ( y  y ) 2 
U  B
   exp 
 dx dy 
4t  0 xC y / Y
4 t


x y /Y
u ( x, y , t ) 

 ( x  xi ) 2  ( y  yi ) 2 
 ( x  xi )2  ( y  yi )2 
   exp 
d
x
d
y

exp
 i i  

 dxi dyi 
4 t
4 t
sin ks 
sources 





where xi,yi denotes a point within a triangular image and


(6)
denotes integration over all points within the
Page 5 of 12
triangular image.
Image Words
It is useful to adopt an alphabetical designation of the triangular images. Let a denote reflection in
line BC, b denote reflection in line CA and c denote reflection in line BC. Then, because triangle CBD is
formed by reflection of the original triangle in line BC, it may be represented by a. Likewise triangles ACF
and BAE are named b and c respectively. Triangle CDG arises by reflection of the original triangle first
in line CA and then in line BC, so it can be allocated the “word” ba. Likewise, as indicated in Figure 1(d),
ca is the word of triangle DBH.
As the nullification procedure described in the previous section is continued, the number of triangular
images proliferates, so that images with words such as cb, bca and acbc are encountered. In fact, all words
that can be formed from the three-letter alphabet represent valid triangular images, except those (such as
bb, cca and baac) that have consecutive identical letters. Such double letters are excluded because
consecutive reflections in the same line uselessly reproduce the starting triangle.
The number of letters in an image’s word reveals the “order” p of the image – that is, the number of
reflections that went into the formation of that triangular image. There are three triangular images of order
1, six of order 2, twelve of order 3 and generally 3×2p1 of order p. Words of odd order correspond to
sinks, even-ordered images are sources. If we make the logical allocation of an order of zero to the original
triangle, then equation (6) may be condensed to
u ( x, y , t ) 
 ( x  xi ) 2  ( y  yi ) 2 
U
p
(

)
exp
 d xi d y i
  
4t i  0,1
4

t



(7)
where i is a serial designation of the triangular images and x0,y0  x,y.
In optics the size, and hence the importance, of an image lessens with multiple reflections because
the path length of the light ray lengthens. There is no comparable effect of path length here. The
Page 6 of 12
importance of a high-order triangular image is not necessarily less than one of low order. Equation (7)
shows that it is only the distances between points in the image and the “observation point” x,y that matter,
the latter point lying somewhere within the triangle ABC.
The Importance of Angles
Triangular images cluster around the vertices of triangle ABC. Figure 2(a) shows the situation
around vertex C when the angle  is 36o. The geometry in the immediate vicinity of this vertex is
independent of angles  and . The clustering images are all formed by reflections in lines BC and CA and
their words therefore contain only the letters a and b, as the figure reveals. The segment diametrically
opposite to triangle ABC, left blank in the diagram, becomes occupied when triangle baba is reflected in
line CA, or when triangle abab is reflected in line BC. Thus the triangular images babab and ababa occupy
the same space: they are said to be “collocated”.
When two sinks, or two sources, are collocated, one of the images is redundant, because a single
emission of diffusant will serve the purpose for which each image was designed. Collocation is
widespread. For example, in Figure 2(a), bababab would collocate with bab and abababab with ba.
Images bababababa and ababababab even collocate with the original triangle ABC. These collocations
are of no consequence, provided that our bookkeeping avoids allocating more than one triangle to any point
in space.
Figure 2(b) differs from 2(a) in having  = 40o. This time words can be allocated to all the clustering
segments without incurring collocation. Note, however that (the extension of) line BC traverses triangle
abab. We have said nothing yet about the magnitudes of angles  and , but, if they are equal, line BC will
symmetrically bisect the triangle. In that event, reflection of abab in line BC will yield a triangular image
ababa that collocates with its progenitor. However, abab and ababa have orders of opposite parity; one
is a source, the other a sink. There is no question of redundancy with this variety of collocation: the two
Page 7 of 12
would annihilate each other and neither triangular image could perform the task for which it was intended.
This problem is not limited to abab; babab collocates antithetically with baba. No successful imaging is
possible if  = 40o.
The distinction between the 36o and 40o cases arises because 36o is an even submultiple of 360o,
whereas 40o is an odd submultiple. Had we chosen a  angle equal to, say 38o, of which 360o is not a
multiple, then a confusing and unsatisfactory overlapping of triangular images would have occurred. We
conclude that, for the present technique to be successful,  must be an even submultiple of 360o. And, of
course, the other two angles,  and , must satisfy the same criterion.
The three angles must sum to 180o, each being a submultiple of 180o. That is, we seek three integers
, m and n such that
1 1 1
  1
 m n
(8)
Sadly, there are only three sets of integers, as tabulated in
Table I, that satisfy this equation, and therefore only three
Table I The three triangles to which
our treatment applies.
triangles to which our treatment applies. This is a disappointing
Triangle
I
II
III
result; we had hoped for greater generality. Moreover, of the
three triangles to which our approach is applicable, two –

2
2
3
m
3
4
3
n
6
4
3
Angles
90o, 60o, 30o
90o, 45o, 45o
60o, 60o, 60o
Triangle II and Triangle III – have solutions that are already known[1, 2]. Therefore we concentrate below
on Triangle I, for which we believe no prior solution exists. This is the most complicated of the three,
because it lacks the valuable symmetry present in isosceles and equilateral triangles.
Triangle I
Figure 3 shows the original source triangle and (some of ) the images formed therefrom by
successive reflections in the triangle’s sides. This “map” has the following features: (i) It fills the entire
Page 8 of 12
x,y plane with no gaps and no overlaps other than collocations which we discount. (ii) The sides of each
triangle are common with those of three other triangles, all of which have orders that differ in parity from
its own. That is, sources adjoin sinks and vice versa. (iii) At points where more than two triangles meet,
the junction is the meeting point of an even number of triangles. In fact the numbers that meet are
invariably 2, 2m and 2n. These features apply equally to Triangles II and III.
Where space allows, the triangles in Figure 3 have been labelled with their words. In cases of
collocation, the label is that of lowest order and/or the first when arranged alphabetically. Though all
triangles are of the same size and shape, they have varied orientations and come in two “senses”. By this
we mean that as one proceeds counterclockwise around the triangle, the angles are encountered in the
sequence 90-60-30 in the case of sources, but the sequence is 90-30-60 for sinks.
One can discern hexagonal symmetry in the map, which is a
honeycomb of regular hexagons, each of area 8 3 Y 2 , and composed of
twelve triangles. The hexagons have translational symmetry with
respect to each other; that is: one hexagon may be brought into
congruence with another hexagon by a sliding motion alone, without
rotation or “flipping”.
Table II provides a list of the cartesian
coordinates of the centres of the hexagons. The list is organized in order
of proximity to the source triangle. From an infinite array, only ten
hexagons are listed, but this number is ample for our purpose.
Table II Coordinates of
hexagon centres
Hexagon
number
0
1
2
3
4
5
6
7
8
9
xh
Y
 3
3
3
 3
 3
 3 3
3 3
3 3
3
3 3
yh
Y
1
1
3
3
5
1
1
3
5
3
The coordinates of the vertices of the twelve triangles are related in a consistent way to the
coordinates of the hexagon’s centre. Making use of this regularity, Table III provides a listing of the
coordinates of the vertices of all the triangles. The original triangle ABC is triangle number 0 of hexagon
number 0. Let  denote the triangle number ( = 0,1,2,...10,11) then, since the parity of  is identical with
the parity of the order,  can replace p in formula (7), which may now be rewritten as
Page 9 of 12
Table III Coordinates of the vertices of the twelve triangles that constitute one hexagon.
Triangle
number, 
Vertex of angle 
Vertex of angle 
Vertex of angle 
x
x
x
y
yh  Y
0
xh  3 Y
1
2
3
xh
4
5
yh + Y
yh + 2Y
yh + Y
6
xh  3 Y
7
yh  Y
8
9
10
11
u ( x, y , t ) 
xh
yh  2Y
xh  3 Y
yh  Y
xh  4Y
y
3
yh
xh
xh  2Y
3
yh + 2Y
xh
xh  2Y
yh
3
yh +2Y
xh
xh  4Y
yh
xh
xh  2Y
xh  4Y
3
yh  2Y
yh
3
yh  2Y
xh
  ( x  xi ) 2  ( y  yi ) 2 
U  11

(

)
exp
 d xi d y i
   
4 t h  0,1  0,1
4 t



yh
3
yh
3
yh +2Y
xh
xh  2Y
xh
yh
3
yh +2Y
3
yh
3
yh 2Y
xh
xh  4Y
xh
xh  2Y
xh
xh  2Y
3
y
xh
xh  2Y
xh
xh  2Y
yh
3
yh 2Y
(9)
where h represents the hexagon number (h = 0,1,2,...). Recall that in equation (9) xi,yi are the coordinates
of a point that wanders over the ith triangle. That triangle is now indexed by the pair of integers  and h,
which henceforth take over the role of i.
Unfortunately, the integrations in (9) cannot be carried out analytically, but they are easily enacted
numerically. The procedure we followed was to “fill” the triangle with a large number of points evenly
and closely spaced in two dimensions. Symbolically, the double integral was replaced by the double
summation
Y2
J2
J

j 1,2
 [ x  x ( j , k )]2  [ y  y ( j , k )]2 
exp



4 t
k  k min


kmax
(10)
Page 10 of 12
where J is an arbitrary large integer. We used J = 100 after ascertaining that larger values produced no
significant improvement. Another integer is represented by k, which takes values k = kmin, kmin+1, ..., 1,
0, 1, ..., kmax, where kmin is the smallest (most negative) integer greater than
 j  12 
x  x   ( y  y )
(11)
 ( x  x )  y  y
and kmax is the largest integer less than an expression similar to (11) with  replacing . The formulas
x ( j , k )  x  
[( j  12 )  k ]Y
J u2 1
and
y ( j , k )  y  
[ j  12  k ]Y
(12)
J u2 1
where  = (yy)/(xx) and  is the sign of xx, were used as coordinates to generate a set of evenly
spaced points throughout each triangle. The formulas in this paragraph are valid for any triangle, provided
that angle sequence  describes a counterclockwise path.
Though it involves four sequential summations, the numerical calculation of u(x,y,t) via equation (9),
using (10) as a replacement for the integral, is no serious
challenge for today’s personal computers. Table IV shows
Hexagon
number
the results for the arbitrarily assigned values
Y
,
2
Y
,
2
Y2
25
Table IV A demonstration of the rapid
convergence of the procedure
u(x,y,t)/U
Term
Partial sum
0
4.056×101
0.4056
1
3.787×103
0.4018
of the parameters. It lists the partial sums after more and
2
7.280×106
0.4018
more hexagons are incorporated and demonstrates a rapid
3
1.571×108
0.4018
4
1.542×1019
0.4018
5
6.662×1024
0.4018
6
1.436×1035
0.4018
a finite element simulation of the diffusion problem. The
7
2.226×1032
0.4018
solution at other points in the triangle is obtained in a
8
5.675×1040
0.4018
similar way. The overall results are presented as a contour
9
3.439×1062
0.4018
x
y
and
t 
(13)
convergence to a final value. The correctness of this value
has been confirmed by its agreement with the result[6] of
Page 11 of 12
diagram in Figure 4.
Triangles II and III
The “maps” for these triangles are presented as Figures 5 and 6. Tabulations analogous to (but
simpler than) Tables II and III were drawn up and processed in a fashion similar to that described in the
previous section. Figures 7 and 8 show the final results.
We found complete agreement between these results and the equation given for Triangle II by Morse
and Feshbach[1], and between our results for Triangle III and those reported by Johnston et al[2].
Extensions
It would be valuable if the method we have developed could be applied to polygons larger than
triangles and, in principle, this is possible. In practice, however, the requirement that the angle at each
vertex be an even submultiple of 360o is very restrictive. We believe that the only polygons, additional
to Triangles I. II and III, to which our method is applicable are the square and the rectangle. Far simpler
methods exist for the solution of the diffusion equation in those quadrilateral domains.
Throughout this article we have addressed the diffusion equation under Dirichlet conditions; that is,
when the boundaries of the domain are held at a specified intensity, in the present case at an intensity of
zero. Though we have not attempted to do so, we believe that null Neumann conditions – in which there
is no flux of diffusant across the boundaries – can be handled in a similar way. The only difference would
be that the primary images, those with words of a, b and c, would become sources rather than sinks, with
corresponding changes for all subsequent images. Of course, the null Neumann problem for a uniform
initial condition is not a problem at all – nothing happens! But an adaptation of our method could be
applied to nonuniform initial conditions.
Page 12 of 12
Acknowledgements
The financial support of the Natural Sciences and Engineering Research Council of Canada is
gratefully acknowledged.
References
1.
P.M. Morse, H. Feshbach, Methods of Theoretical Physics, McGraw-Hill, New York, 1953, 753 et
seq.
2.
M.E. Johnston, J.C. Myland, K.B. Oldham, Zeitschrift für angewandte Mathematik und Physik,
(2004) (in press, ZAMP 3114).
3.
D.R. Corson, P. Lorrain, Introduction to Electromagnetic Fields and Waves, Freeman, San Francisco,
1962, Chap 4.
4.
H.S. Carslaw, J.C. Jaeger, Conduction of Heat in Solids, Clarendon, Oxford, 1959, Chap 10.
5.
P.M. Morse, H. Feshbach, Methods of Theoretical Physics, McGraw-Hill, New York, 1953, Chap
7.
6.
N.P.C. Stevens, private communication. 2003.
Figure Legends
Figure 1: Stages in constructing appropriate images: (a) the original triangle; (b) a fictitious sink triangle
a is added to ensure null conditions on line BC; (c) sink triangles b and c are added to nullify the intensity
on lines AB and CA; (d) source triangles ba and ca are added to counteract the influence of triangles b and
c on line BC.
Figure 2: Clustering of triangles around a vertex of the original triangle when, (a)  = 36o and (b)  =
40o.
Figure 3: The original triangle and its images when  = 90o,  = 60o and  = 30o. In this, and Figure 5
and 6, fictitious sources have a light shading, with fictitious sinks unshaded. The original source triangle
is heavily shaded.
Figure 4: Isotimic contours for Triangle I at time t = Y2/100. The contours are at 0.1 intervals of the
local intensity referenced to the original uniform intensity.
Figure 5: The original triangle and its images when  = 90o,  = 45o and  = 45o.
Figure 6: The original triangle and its images when  = 60o,  = 60o and  = 60o.
Figure 7: as Figure 4 but for Triangle II.
Figure 8: as Figure 4 but for Triangle III.
Table II Coordinates of
hexagon centres
Hexagon
number
0
1
2
3
4
5
6
7
8
9
Table I The three triangles to which
our treatment applies.
Triangle
I
II
III

2
2
3
m
3
4
3
n
6
4
3
Angles
90o, 60o, 30o
90o, 45o, 45o
60o, 60o, 60o
xh
Y
 3
3
3
 3
 3
 3 3
3 3
3 3
3
3 3
yh
Y
1
1
3
3
5
1
1
3
5
3
Table III Coordinates of the vertices of the twelve triangles that constitute one hexagon.
Triangle
number
Vertex of angle 
Vertex of angle 
Vertex of angle 
x
x
x
yh  Y
0
1
xh  3 Y
2
3
4
xh
5
6
7
10
11
yh + Y
yh + 2Y
yh + Y
xh  3 Y
yh  Y
8
9
y
xh
yh  2Y
xh  3 Y
yh  Y
xh  4Y
y
3
xh
xh  2Y
3
xh
xh  2Y
yh
yh + 2Y
yh
3
yh +2Y
xh
xh  4Y
yh
xh
xh  2Y
xh
xh  4Y
3
yh  2Y
yh
3
yh  2Y
yh
3
yh
3
yh +2Y
xh
xh  2Y
xh
yh
3
yh +2Y
3
yh
3
yh 2Y
xh
xh  4Y
xh
xh  2Y
xh
xh  2Y
3
y
xh
xh  2Y
xh
xh  2Y
yh
3
yh 2Y
Table IV A demonstration of the rapid
convergence of the procedure
Hexagon
number
u(x,y,t)/U
Term
Partial sum
0
4.056×101
0.4056
1
3.787×103
0.4018
2
7.280×106
0.4018
3
1.571×108
0.4018
4
1.542×1019
0.4018
5
6.662×1024
0.4018
6
1.436×1035
0.4018
7
2.226×1032
0.4018
8
5.675×1040
0.4018
9
3.439×1062
0.4018