Vous êtes sur la page 1sur 15

J. M.

Williams

Diffusion Equation

Calculus of the Diffusion Equation

by John Michael Williams


jmmwill@comcast.net 2013-05-17

The diffusion equation is explained in general, and two specific solutions are presented.

Copyright (c) 2013 by John Michael Williams. All rights reserved.

J. M. Williams

Diffusion Equation

Preface
This is an updated rewrite of a handout originally presented by the author in the spring of 1980, as part of a Psychology 585 course presentation moderated by Professor Alfred Lit at Southern Illinois University, Carbondale, Illinois.

J. M. Williams

Diffusion Equation

Diffusion Equation Basics


An algebraic equation expresses a relationship among variables x, y, z, . . .. The solution of such an equation may be used to define a specific function of those variables. For example, given yx = x /( 2 y)
n 2 1/ 2 n

(1)

it is possible to define a function y = (1 x ) + 1 = f (x) (2)

consistent with the original equation (1). Only a finite number of such functions will be found. In the present case,
y = 1 (1 x
n 2 1 /2

g (x )

(2')

also happens to satisfy (1). A differential equation expresses a relation among the derivatives of some function. The solution of a differential equation is defined by an infinite set of functions; this solution allows no single, specific statement about any particular continuous relationship among the independent variables appearing in the differential equation. For example, let y = f(x) be defined consistent with the following differential equation:

dy / dx
Then,

= yx .
( for y 0) .

(3) (4)

dy / y = x dx
2

Integrating both sides of (4), we obtain ln y = x / 2 + c ' . (4')

The constant of integration c' appears in (4'), whereas it was not given in (3) or (4). If we now exponentiate both sides of (4'), we get y = c exp [ x / 2] = f ( x ; c ) , for c a parameter of the solution. The point here is that (4'') defines a family of continuous functions, not just one function. The parameter c may assume any of an infinite set of real values; so, the set of solutions of (3) is infinite. In any specific problem, the value of c must be specified by the problem conditions (initial conditions; boundary conditions) and is not implied by the differential equation (3) itself. The diffusion equation which concerns us here is a partial differential equation because it contains partial derivatives, and it is linear because derivatives of each kind (and order) appear only in their own, special terms, all such terms being combined solely by addition (superposition).
2

(4'')

J. M. Williams

Diffusion Equation

The fundamental second-order linear partial differential equation may be represented as given by Broman (1970, p. 135) as a 11 ( u u u u u ) + 2 a 12( ) + a 22( 2 ) + b1 ( ) + b2 ( ) + cu 2 xy x y x y
2 2 2

f ( x , y ) . (5)

The function to be found in (5) is u(x, y), not f(x, y) -- which latter is given as part of the problem (the "input") to be solved. Notice that no term in (5) contains more than one derivative of a given order, so, equation (5) is linear. The highest order in (5) is two (the second-derivative terms to the left), so, the equation is of second order. Because the function to be found is u(x, y) and no partial derivatives appear, the equation in (5) is described as an ordinary differential equation (ODE). The diffusion equation is a special case of (5) in which coefficients a22, a12, and b1 all are equal to 0; in which b2 is negative; and, most commonly, f(x, y) and c also are given as 0. For the variant of the diffusion equation of our present interest, c will not be set to 0; so, we shall have, relabelling y in (5) as time t and letting x represent a location in onedimensional space, u ( x ,t ) D u (x , t) = 2 x
2

u (x , t) . t

(6)

The Diffusion Explained


To explain the conventional meaning of (6), the coefficient D of the spatial derivative is called the diffusivity coefficient, and it weights the effect on the system of the divergence of the spatial concentration denoted by this derivative. The loss factor weights the rate of inactivation or loss of the diffusing particles and here is set proportional to the concentration u(x, y), a simple condition analogous to Hooke's law in mechanics. This loss factor reduces the effect of the rate of entry (divergence) of particles at every given point in space; this is why it is given in (6) as being subtractive on the left. The temporal derivative on the right in (6) has no coefficient; such a coefficient would be superfluous, because the entire equation (6) only has three terms and thus only two degrees of freedom. The unknown function u, the concentration of the substance which is diffusing, appears in each term in (6), making (6) a homogeneous differential equation.

The Equation Explained


Equation (6) above can be solved as a general statement as given, but obtaining a particular solution u(x, y) depends upon specifying the various parameters which will appear in the course of calculating the solution; the reader here may recall c in (4'') above. Furthermore, the functional form of the solution of (6) which is obtained will depend upon the geometry of the space through which the diffusion is assumed to be taking place. Thus, the specification of any functional solution which will be both well-defined and

J. M. Williams

Diffusion Equation

continuous requires that the problem be stated carefully, with the given set of boundary conditions consistent with the physics of the expected solution (see Broman, 1970, 8.2.5 ff.). Both Ives (1922) and Veringa (1961) have provided solutions of (6) using slightly different boundary conditions. Kelly (1969) simplified (6) by eliminating the loss factor , thereby obtaining the equation most often treated in text-books such as those cited in the Bibliography of this presentation. As Kelly (1969) points out, both Ives (1922) and Veringa (1961) solved the whole equation (6); however, Ives arrived at a considerable simplification by using a stimulus input (given as one of the boundary conditions) which consisted only of the first periodic term of the Fourier series decomposition of the actual stimulus temporal waveform. This approximation of Ives's subsequently has been found to be too crude to explain the data for low-Hz flicker fusion, as explained by Kelly (1969).

Plan of this Presentation


What I will do in the present work is to show how the diffusion equation (6) above, rewritten as u ( x ,t ) D 2 x
2

u ( x ,t ) u (x , t) t

0 ,

(7)

can be solved for two different kinds of boundary condition. The diffusion will be treated in both cases as though occurring in a narrow cylinder, effectively one-dimensional, with some arbitrary input at one end of the cylinder, the end with spatial coordinate x = 0. Distance along the cylinder will be measured as distance x, with x always greater than 0.

First Solution
In the first solution to follow, a boundary condition will be assumed such that the concentration is held permanently at 0 at some point x0. This boundary condition may be described as u ( x0 ,t ) = 0 , u ( 0, t ) = 0 , t >0 . (8a)

For the first solution, a second condition temporarily will be imposed such that t >0 ; (8b) which is to say, that there be no input. This second condition will be used merely to specify the value of one of the constants of integration and will not affect the generality of the ultimate first solution.

J. M. Williams

Diffusion Equation

Second Solution
In the second solution to follow, boundary condition (8a) above will be removed, so that the cylinder will be effectively semiinfinite in length:

J. M. Williams

Diffusion Equation

First Solution
As mentioned above in (8a), this solution will assume that u(x0, t) = 0. We also assume here that u(x, t) may be separated. This assumption is consistent with the nature of u under boundary condition (8a), because at x0 it is certain that t varies independently of x. So, we may write u ( x ,t ) = X ( x ) T ( t ) . Keeping in mind that x and t are independent, the differential equation (7) becomes D XT 2 x
2

(9)

XT t

XT

0 .

(10)

Using primes to indicate ordinary differentiation, from (10), D X ' ' (x ) T (t) X T ' (t) X T D X ' ' ( x ) T (t) = X T ' ( t) + X T D X ' ' ( x) T ' (t ) + T ( t ) = . X ( x) T (t) = 0 (11) (12) (13)

The variables thus explicitly are separated and, being independent, make each side of 2 (13) equal to some constant which we shall write as . Equation (13) then may be written as two ordinary differential equations: D X ' ' ( x) = 2 ; and, X ( x) (14) (15)

T ' (t) + T ( t) 2 = . T (t ) Equation (14) now is solved easily:


D X ' ' ( x ) = X ( x ) ; or,
2

D X ' ' (x) + X ( x) = 0 .


rx

(16)

By standard methods, we know that any solution of (16) will be of the form C e , rx 2 2 with e ( Dr + ) 0; so, we will have, r =
2

=> r 1 =

1 2

= j D 2 ; r2 = = j D 2 . D D

All solutions of (16) therefore will be of the form X ( x ) = C 1 cos ( D x ) + C 2 sin ( D


1 2

x) .

(17)

This spatial periodicity depends upon assumption (8a).

J. M. Williams

Diffusion Equation

Now solving equation (15), we obtain


T ' (t ) + T ( t ) = T ( t )
2

T ' (t) = ( 2 + ) ; which yields, using elementary methods, T ( t) ln T ( t ) = ( +) T (t ) + C ' 3 ; or, T (t ) = C 3 e


( 2+ )t 2

(18)

The general solution for the homogeneous case now is obtained by putting the results of (17) and (18) into (9). We then find u ( x , t ) = C 3 e
( 2 +) t

[ C 1 cos ( D
( 2+ )t

1 2

x ) + C 2 sin ( D

1 2

x) ] .

(19)

The temporal condition (8b) now may be applied to determine 0 = u ( 0, t ) = C 1 C 3 e which requires that C 1 0 . For this reason, from (19) we must have u ( x , t ) = C 2 C 3 e
( 2+ )t 1 2

(20)

sin ( D

x) .

(21)

This may be rewritten with residual differentiation constants combined, resulting in u ( x , t ) = C sin ( D
1 2

x) e

( 2 +)t

.
1 2

(22) x 0) = 0 .

From the boundary condition (8a), in (22) it must hold that sin ( D
1/ 2

Therefore, for fixed x0, it also must hold that D x 0 = 0, , 2 , . .. , n , . .. , for n an integer. This in turn requires that a general solution of (7) based upon (22) and with boundary condition (8a) must be a superposition of terms which ( a) are of form (22); and (b) which differ only in the values of their coefficients C ; which, in turn, differ in the corresponding allowable values of . Given all this, we then may write the general solution of (7) as u ( x ,t ) =

u ( x , t ) =

u ( x ,t ) =

n=0

C n sin

( ( ) [(
C n sin
x=0

n D 1 /2 x e 1/ 2 x0 D
2 2

[( ) ]
n 1 / 2 x0 D
2

+ t

; or,

2n x n D exp + t x0 x0

)]

(23)

To summarize and expand the preceding calculations, one should notice that, purely by

J. M. Williams

Diffusion Equation

coincidence, each corresponding n-th harmonic term and coefficient Cn, combined, are the same as the general terms defining a Fourier sine series. Thus, any initial spatial distribution of concentration u(x, 0) which can be expressed as a Fourier sine series can be matched term-by-term by some subset of the solution terms in (23). But, the exponential terms at the right in (23) all are identically equal to 1 at t = 0; thus, the Fourier coefficients of any given spatial initial distribution of concentration correspond one-to-one and therefore uniquely specify the coefficients Cn in (23), all other terms in (23) vanishing. Therefore, by expressing the spatial initial conditions as a Fourier sine series, (23) may be used as a general solution of differential equation (7) with boundary condition u ( x0 ,t ) = 0 . (24)

To generalize the result here, it easily may be seen that if a given problem required u (0, t ) 0, one or more cosine terms in (19) could be added in (23), it always being required that (8a) be satisfied.

J. M. Williams

Diffusion Equation

10

Second Solution
For our second solution, it probably is best to arrange our approach according to that of Broman (1970). First, we assume an initial condition of u ( x , 0 ) = 0, x > 0,
j t + 2

(25)

and we put the input into a format more convenient for later computation: f ( t ) = u (0, t ) = e

),

t > 0 .

(26)

In (26), it is notable that the input is periodic and is equal to 0 in its real part at t = 0. A series of such inputs can be superposed to express any periodic temporal variation in the input. Using Broman's (1970, 8.4.5) approach in the following, we assume that u(x, t) exists and is a solution of (7); we also assume that a pair of temporal Laplace transforms exists such that u ( x ,t ) U ( x , s ) f ( t) F (s ) ; Specifically, which is to say numerically, bounding the terms with the integration variable on the right, we have L [ u ( x ,t )]( s ) = U ( x , s ) = L [ f ( t )]( s ) = F (s) = (27) (28)

est u ( x ,t ) dt
0

, and

(29)

es t f (t ) dt
0

, or

= Integrating (30), we obtain F (s) = e


j 2

e
0

st

j t + 2

) dt

(30)

( s j )

(31)

If we now differentiate twice in (29), we obtain, formally, 2 U ( x , s ) = x2 2 [ e s t u ( x ,t ) dt ] 2 u ( x , t ) = L (s ) . x2 x2 0

(32)

J. M. Williams

Diffusion Equation

11

Returning to the original problem in (7), we may write its term-by-term Laplace transform as De
0 st

u (x , t) dt 2 x

e
0

st

u ( x ,t ) dt t

est u ( x ,t ) dt
0

= 0;

(33)

we then may use (32) to rearrange (33) as U ( x , s) D 2 x


2

est
0

u ( x ,t ) dt t

est u ( x , t ) dt
0

(34)

But, the rightmost term is U ( x , s ) , and the middle term may be integrated by parts, with the resulting simplification of (34) becoming D U ( x , s) = ( s + ) U ( x , s ) . 2 x
x 0 2

(35)

At this point, we may recall that (26) above requires that lim U ( x , s) = F ( s ) ; so, we have an ordinary differential equation in x: D d U s( x) dx
2 2

= ( s + ) U s ( x ) .

(36)

Equation (36) will have an input boundary condition of U s (0 ) F s (0 ) , for F(s) as in (31) above. Using standard methods, (36) may be solved as follows: The roots of solutions of (36) will be such that e [ D r ( s+)] 0 , which requires r 2 = ( s+) ; or, r 1 = D
rx 2

( s+) ( s +) and r 2 = . D D

Therefore, we obtain U s (x ) = C 1s

( ) e

s+ D

1/ 2

+ C2s

( ) e

s+ D

1 /2

(37)

The constants in (37) depend upon s just as the C in (22) above depended upon . However, in the present case, C 1 s always may be made to vanish for some choice of x; so, (37) may be reduced to U s (x ) U (s , x) =

( ) C (s )e
1
1/ 2

s+ D

1/ 2

(38)

But, by letting x 0 again in (38), C 1 ( s ) can be seen to be equal to F(s) for all s in (30) above. Thus, from (38),
U (x , s) =

( ) F (s) e

s+ D

= e

( s j )

( ) e

s + D

1 /2

(39)

J. M. Williams

Diffusion Equation

12

We now have obtained the following relation: U (x , s) =

[e

( s j )

] [e ( )
s+ D

1 /2

],

(40)

in which the term on the left is F ( s ) f (t ) , and on the right is G ( s ) g ( t ) . But, by the convolution theorem, F ( s ) G (s ) f ( t) g ( t) ; and, from (26), f (t) = e
j t + j 2

(41)

t > 0 .

(42)

Therefore, to solve it all, we only need to find g(t). The problem is that G(s) in (40) is not found in commonplace tables of Laplace transforms. However, the following pair, e
k s

k 2 t
3

k2 4t

k > 0 ,

(43)

always is tabulated. Using (43), define


1/ 2

k = D

x .

(44)

Thus, as required, k > 0 . Now we may write


1

G (s) = e

k ( s + ) 2

.
1

(45)

We find tabulated that the inverse Laplace transform of (45) is given by 1 g (t) = 2

k ( s + ) 2

st

ds .

(46)

We may substite s+ = s g ( t) =
*

to write
1

1 2

k ( s * )2

s* t

ds .

(47)

Using (43) and the insight of (47), we may substitute the following for (46): g (t) = ke
t 3

2 t

k2 4t

(48)

Applying (44) above, we find g (t) = xe


t 3

2 D t

x2 4D t

(49)

J. M. Williams

Diffusion Equation

13

Having found g(t) from G(s), the final result is obtained from (40), (41) and the definition of convolution:
t

u ( x ,t ) =

e
0

j ( t ) + j

[
= t = 0

x e

2 D 3
3 2

x2 4D

d ; or,

(50)

u ( x ,t ) =

2 xe 2 D

j ( t +

x 2 ( j + ) 4 D

d .

(51)

The integral in (51) cannot easily be evaluated in closed form, but it may be seen to have at least the qualitative requirements of a correct solution: If input frequency goes to 0, concentration drops off both with space and time according to distance from the input (x = 0). The concentration falls off with distance in any case ( v. Webster, 1955, for some graphs). The dependence also is inverse for loss rate and diffusivity D, in the latter case, provided one only considers distances x close to the origin x = 0. It isn't difficult to use the Fourier transform to prove that the average high-frequency amplitude of any pulse will decrease as the time-duration of the pulse is increased. To show this, consider a unit pulse f(t) with onset at t = 0 and duration . The associated impulse response then may be described by

(52)

Neglecting a factor of a constant, the Fourier transform F f of f(t) is given by F f ( ) =

f ( t)
0

j t

dt .

(53)

Subdividing the domain of the integral in (53) according to (52), F f ( ) = 0 + =

1 e jt

dt + 0

(54) (55)

1 j (1 e ) . j
jx

Using the Euler identity e F f ( ) =

= cos x + j sin x in (55), we get

1 [ 1 cos ( ) j sin () ] j

(56)

J. M. Williams

Diffusion Equation

14

1 1 [ 1 cos ( )] sin ( ) . j

(57)

The real part of (57) shows that F f () = 1 sin () . (58)

Finally, it is easy to see in (58) that for any chosen value of pulse duration , it will hold that F 0 as .

A Note on Terminology
There are several ways of describing various equivalent mathematical statements which at first glance may appear to be distinct. This is particularly true when expressing transformed quantities. We give here just one example, that of the equation(s) representing an impulse response. For example, in Kelly (1969, p. 1670), an expression of the impulse response is written this way: 1 g (t) = 2 1

G ( )

j t

d .

(59)

What is described as the same expression is written by Roufs (1972, p. 281) this way: U (t ) =

P ( )[ cos ( t )

( )] d .

(60)

The expressions differ so much because of the different contexts in which they were obtained. To see that (59) and (60) actually represent the same function, begin by rewriting G ( ) in (59) as a logarithm: g (t) = 1 2
lnG ( ) + j ( ) e

j t

d .

(61)

In this rewrite, recall that the corresponding modulation transfer function requires j ( ) that we have G ( ) = G () e , by definition. Next, recombine exponential terms in (61) to obtain 1 g (t) = 2
lnG ( ) e

j ( t + ( ))

d .

(62)

Then, apply the Euler identity to the right-hand exponential in (62):

J. M. Williams

Diffusion Equation

15

g (t) =

1 2

lnG ( ) e

[ cos ( t + ()) + j sin ( t + ())] d .

(63)

Finally, take the real part, only, in (63): 1 g (t) = 2 =

G ()

[ cos (t + ( ))] d

(64) (65)

1 G ( ) [ cos ( t + ( ))] d , 0

which clearly is the same as (60) above.

Bibliography (of references cited)


Broman, A. Introduction to partial differential equations from Fourier series to boundary-value problems. Reading, MA: Addison-Wesley, 1970. Ives, H. E. A theory of intermittent vision. Journal of the Optical Society of America, 1922, 6, 343 - 361. Kelly, D. H. Diffusion model of linear flicker responses. Journal of the Optical Society of America, 1969, 59, 1665 - 1670. Roufs, J. A. J. Dynamic properties of vision --II. Theoretical relationships between flicker and flash thresholds. Vision Research, 1972, 12, 279 - 292. Veringa, F. On the mechanisms underlying de Lang's results. Koninklijke Nederlandse Akademie van Wetenschappen, 1961, 64, 413 - 416. Webster, A. G. Partial differential equations of mathematical physics. (2nd ed.) New York: Dover, 1955.

Vous aimerez peut-être aussi