0% found this document useful (0 votes)
6 views

Notes 788

25

Uploaded by

kgizachewy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Notes 788

25

Uploaded by

kgizachewy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

Lecture Notes for Phys/MtSE 788 ”Applied computational

methods...”

Vitaly A. Shneidman
Department of Physics, New Jersey Institute of Technology, Newark, NJ 07102
(Dated: November 4, 2012)

Abstract
We will first review the origin of the main special functions, their classification, physical origin
and applications, and realization in Mathematica. It will take about 2-3 classes. The Mathematica
files (with extension .m or .nb) will be given separately. Note: do not get scared with all the math,
since some of it is included for the purpose of completeness, and will not be discussed in class.
This especially refers to non-numbered equations. During the class, you will be given more explicit
instructions as to what can be skipped, and additional explanations also will be added.
I will place a marker ”=======” at the end of the latest update so you know where to termi-
nate the printout for the coming class. Please do not print out notes for future lectures in advance
since most of them will be updated.

1
Contents

I Introduction

I. Physics, Analytics and Computations 2

II. An oscillator with vanishing mass: ideas of boundary layer and


singular perturbations 3

II Some special functions and their applications

III. Introduction 4

IV. General properties of the solutions 5


A. Linear independence 5
B. Oscillatory behavior 6
C. Singular points and classification of the solutions 6
D. Asymptotics, and the WKB approximation 7

V. Airy functions 8

VI. Applications of Airy functions: the WKB 9

VII. Repeated error integral in erfc and its applications 11


A. Integer n 11
B. Arbitrary n 11
C. Asymptotes 12
1. z → −∞ 12
2. z → +∞ 12
D. A Mathematica intermission 12

VIII. Applications to the nucleation problem 14


A. The equation 14
B. Preliminaries: Steady-state solution 16

0
IX. Orthogonal Polynomials 17
A. Examples 18

X. Overview of other special functions 21


A. Why special functions in Physics? 23

XI. Bessel functions 24


A. Asymptotes 25
B. Small x 25
C. Integer vs. non-integer n, generating function, recurrence relations and
integral representation 26
D. Fraunhofer diffraction 26
E. Small projects with Bessel functions 28
F. Modified Bessel functions 28
G. Diffusion of neutrons 30

XII. Electrostatics and Legendre polynomials 32


A. Field of point charges and the generating function for Legendre polynomials
(LP) 32
B. Explicit expressions and recurrence relations 33
C. Relation to Laplacian 34
D. The other solution 35
E. Physical applications 35
1. Gravitational field 35
~0
2. Conducting sphere in uniform field E 36
3. Dielectric sphere 37

III Diffusion

XIII. The diffusion approximation to random walk 39


A. Biased diffusion 39
B. Limitations of the diffusion description 40

1
XIV. Diffusion in free space for D = 1, 2, 3 41

XV. The diffusion equation in 1 D 42


A. Free boundaries 42
B. Problems with boundaries 42
1. Semi-infinite: fixed concentration 42
2. Semi-infinite: reflecting 43
3. semi-infinite: absorbing 43
C. Two absorbing boundaries: Fourier expansion 43
1. Formulation of the problem 43
2. Analytical solution 44
D. Numerical 45
E. Laplace Transform 45

XVI. Project 1 46

XVII. Higher dimensions. Steady-state 46


A. d = 1 47
B. d = 2 47
C. d = 3 48

XVIII. Time-dependent, d = 2 48

XIX. Separation of variables 48


A. Small time: Laplace 49

XX. Project : An applied problem with non-linear boundary conditions


for the diffusion equation 50
A. Introduction 50
B. Formulation of the problem 50
C. Mathematical formulation 50
D. Diffusion in iron 50
E. Pressure Drop 51
F. Overview 52

2
G. Analytics: Quasi-steady-state 53
1. The thin-wall approximation 53
2. Thick wall 53
H. Numerical 54

XXI. Variable D = D(c) 55

XXII. Numerical solutions 56


A. Discretization in space. Exponential solution. 56
B. Discretization in t 56
C. von Neumann stability analysis 57
D. Backward (implicit) scheme 57

XXIII. Laplace equation in a semi-infinite stripe 59


A. Separation of variables 59
B. Edge 61
C. Corner 61
D. Relaxation method 61
E. Project: Relation to complex variables - 2D only! 61
1. Cauchy-Riemann conditions 62
2. Complex potential 62
3. Conformal mapping and solution of the problem 63

XXIV. Schrödinger equation 65


A. 1D - analytic 65
1. Resonant levels 65
2. Energy levels: WKB approximation 66
3. Bands 66
B. Dirac comb 67
C. Numerical - matrix 68
D. Numerical - shooting 68
E. Numerics - variational 68
F. Variational - 3D 69

3
XXV. Monte Carlo integration 69

XXVI. Simulated annealing 70


A. Travelling salesman problem 70

XXVII. Non-equilibrium Ising model 71


A. Overview 71
1. Definitions 71
2. Dynamics 72
3. Equivalence to a lattice gas 72
B. Equilibrium (some analytics) 72
1. Interfacial tension 75
C. Non-equilibrium: simulations 76

4
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 1st Lecture

Part I

Introduction
I. PHYSICS, ANALYTICS AND COMPUTATIONS

• Physics: very diverse scales; dimensionless parameter(s) ρ1 , ρ2 , . . . can span a huge


domain from small to large values

• Analytics: dimensionless parameter(s) → ∞ (or, → 0)

• Computations: ρ1 , ρ2 , . . . ∼ 1

• Symbolic computations: more accurate analytics, less restrictions on parameters.


Overlap with computations!

Example: Electrostatics. Distribution of fixed charges q1 , q2 , . . . located at ~r1 , ~r2 , . . ..


Origin of coordinates inside the domain. Need field (potential) everywhere.

• Physics: dimensionless parameter(s):

ρ ∼ R/d À 1

R - distance from origin to the observation point. Or, for the observation point ~r close
to charge No.1,
ρ1 = |~r − ~r1 | /d ¿ 1

• Analytics:
φ ∼ Q/R , Q = q1 + q2 + . . . , R À d

φ ∼ q1 / |~r − ~r1 | + const , const = q2 / |~r2 − ~r1 | + q3 / |~r3 − ~r1 | + . . . , |~r − ~r1 | ¿ d

• Computations: can be done not too far from the system and not too close to charges
(infinities!)

2
v
t
1 2 3 4

-0.1

-0.2

-0.3

-0.4

-0.5

FIG. 1: Exact solution (red) and outer solution (blue) for m = 0.1. The blue dashed line is the
”inner” solution - it is irrelevant for large times but accurately describes transient behavior for
small t ∼ m (the ”boundary layer”). Note that the large-t limit of the inner solution (horizontal
dashed) and the small-t limit of the outer solution −1/2 are identical.

• Symbolic computations (Mathematica): systematic extension of the above expansions


for a large number of terms (in terms of Legendre polynomials or in terms of multipoles
- will not be discussed at the moment). Very useful if understand how many terms is
needed.

• Graphics: needed for connection with physics. Small and large scales must be covered,
and good graphics is possible if one understands the relation between them

II. AN OSCILLATOR WITH VANISHING MASS: IDEAS OF BOUNDARY


LAYER AND SINGULAR PERTURBATIONS

Consider

mẍ + 2ẋ + x = 0 (1)

with x(0) = 1, ẋ(0) = 0 and m → 0. Could write

x = e−t/2

but what about velocity?? - ẋ = −(1/2)e−t/2 does not satisfy the initial condition. We can
compare with exact solution and detect a ”boundary layer” - see Fig. 1.
To understand velocity better, write an explicit equation

mv̈ + 2v̇ + v = 0 (2)

3
with v(0) = 0, mv̇(0) = −1 (from original equation). Neglect of m gives the ”outer” solution

1
v out = − e−t/2 (3)
2

which cannot satisfy both boundary conditions. To describe small times introduce a
”stretched variable”
T = t/mα

and select α to have both terms with derivatives have the same order as m → 0. This gives
α = 1 and

d2 v dv
2
+2 =0 (4)
dT dT

which is an ”inner” equation with solution

v in (T ) = e−2T /2 − 1/2

Inner solution accurately describes the small times for a selected small (non-zero) m - see
Fig. 1. Note that

v in (T → ∞) = v out (t → 0) (5)

This is the basic principle of ”matched asymptotic expansions”.

Part II

Some special functions and their


applications
III. INTRODUCTION

We know well elementary functions. sin, cos, exp. Where do special functions come from
and what is their connection to elementary?
Consider
u00 + I(x)u = 0 (6)

4
Now if I(x) = const ≡ I, one has for solutions u(x)
³√ ´ ³√ ´
sin Ix , cos Ix , I > 0
³ √ ´
exp ± −Ix , I < 0

For I(x) 6= const we have special functions.


Now what’s qualitatively new (besides the special functions being harder to compute or
sometimes even imagine)? New is the fact that I(x) can change sign (!!!), leading to a
transition from an oscillatory to exponential-type structure of the same solution in different
domains of x. Already the simplest, Airy function described below has this property.
The other novelty is the possibility of I (x0 ) = ∞ at some x0 called a singular point. Now
instead of the pair of independent solutions of type sin and cos which look extremely similar
to each other, one will have two solutions with very different structure, depending on their
behavior near x0 .
Near both types of points, zero and ∞ for I(x), very interesting physics is expected. In
this sense special functions are much more exciting than the elementary, which are somewhat
dull in having the same behavior for all x (and an excursion into the complex plain will not
make things much more exciting).

IV. GENERAL PROPERTIES OF THE SOLUTIONS

Since eq. (6) is a linear differential equation of the 2nd order, there are general properties
which are equally applicable to sin, cos and to any of the special functions. For a specific
non-elementary example, however, we will consider an equation

y 00 − xy = 0 (7)

which, leads to, in a sense the simplest non-elementary solutions - the Airy functions, see
below.

A. Linear independence

First, there exist two linearly independent solutions, φ1 (x) and φ2 (x), which form a
fundamental system of solutions. Any solution can be represented as

y(x) = C1 φ1 (x) + C2 φ2 (x) (8)

5
with C1 , C2 being arbitrary constants. Linear independence is tested by non-zero values of
the Wronskian
W = φ1 φ02 − φ01 φ2 6= 0 (9)

In particular, if the original equation is already in the normal form (no 1st derivative),
one has
W = const (10)

HW: Find Wronskian to the two Airy functions, and check eq.(10)[if you are good with Math-
ematica, write a pure function] . HW: (optional). Find an analog of eq. (10) for a full form of
a general 2nd order equation. Hint: find dW/dx

B. Oscillatory behavior

For I(x) > 0 in eq. (6), there will be oscillations in each of the fundamental solution see
e.g., Fig. 2, similarly to sin and cos. Moreover, there exist a theorem that zeros of φ 1 and
φ2 alternate with each other, making the similarity even stronger. [In this context note that
both φ1 , φ2 oscillate, or both do not, as for x > 0 in Fig. 2)].
2

1.5

0.5

-5 -4 -3 -2 -1 1 2

-0.5

FIG. 2: Airy functions, Ai (red) and Bi (blue).

C. Singular points and classification of the solutions

If for x → x0 , one has I(x) → ∞, such a point x0 is called singular. x0 = ∞ is also a


possibility (and this is the only singular point for the Airy equation above). There is a more
fine classification based on how fast the ∞ is approached, but we will not use it now.

6
Remarkably, the solution does not always have to diverge at x0 . If φ (x0 ) is finite, it is
called the special function of the first kind. If it diverges, it is called of the second kind.

D. Asymptotics, and the WKB approximation

Let I(x) in eq.(6) be large. Let us write it as I(x) = −ρ2 q(x) with ρ À 1 and make a
substitution: ½ Z ¾
u(x) = exp +ρ v(x)dx

which leads to
ρv 0 + ρ2 v 2 − ρ2 q = 0 (11)

HW: (optional) show this . Now solve by iterations:


v0 = ± q

next
1 v00
v1 = −
ρ 2v0
Now ½ · Z ¸ ¾
√ √
u(x) ∝ exp ρ ± qdx − 1/2 ln | q|

or ½ Z ¾
1 p
u(x) ∝ exp ± −I(x)dx
|I|1/4
More explicitly, for I(x) > 0,
½Z ¾
1 1/2
u(x) ∝ sin I dx + α (12)
I 1/4

(α can have two values since 2 solutions), and for I(x) < 0
½ Z ¾
1 1/2
u(x) ∝ exp ± (−I) dx (13)
(−I)1/4

[small project (optional): write a Mathematica program for WKB (more than 2 iterations),
apply to some known special function, and check the accuracy].

7
V. AIRY FUNCTIONS

Let us try to apply asymptotic analysis to Airy functions with I(x) = −x. It becomes
large for x → ±∞. One has
2
Z
x1/2 dx = x3/2
3
which should be the argument in both the exponential and the oscillatory parts. This
corresponds to the known asymptotics
1 2 3/2
Ai[x À 1] ∼ √ 1/4 e− 3 x (14)
2 πx
½ ¾
1 2 3/2 π
Ai[x → −∞] ∼ √ sin (−x) + (15)
π(−x)1/4 3 4
(and similarly for Bi ”+” in the exp, and cos instead of sin). The exact proportionality
factors come from the integral representation. The value of the constant in sin is selected to
ensure transition to the decaying exponent on the other side of x = 0. [HW: plot asymptotes
together with the Airy functions].
We know practically everything: the differential equation, the picture and the asymp-
totes. What can be added, is the integral representation and the physical problem where it
appeared.
One has

z3
µ ¶
1
Z
Ai(x) = cos + zx dz (16)
π 0 3
As to physics, the above ”rainbow integral” was introduced by Airy in the context of
rainbow formation, beyond the geometrical optics. Recall that geometrical optics can predict
the angle at which we see the rainbow via formation of a ”caustic” - see Fig. 3, but it predicts
an infinite intensity of scattered light directly at the rainbow, and strictly zero intensity on
the dark side. The Airy integral gives the amplitude (and its square the intensity) near any
caustic, including the rainbow. We will discuss this, and some other physical applications
in class.
[HW: use the file rain.m to study the dependence on the refraction index, n. When
increasing n, when does the rainbow disappear?]

(this is approximately the end of class 1 on special functions)

8
FIG. 3: Formation of a rainbow (geometrical optics). The outgoing arrow indicates the caustic, a
direction with infinite intensity. The incoming arrow indicates the rays with the impact parameter
of about 0.86R (R being the droplet radius), which will form the caustic. A refraction index
n = 4/3 was used.

Dr. Vitaly A. Shneidman, Phys/MtSE 788, 2nd Lecture

VI. APPLICATIONS OF AIRY FUNCTIONS: THE WKB

Consider the stationary Schrödinger equation


p p
u00xx + k 2 (x)u = 0 , k = , p = E − U (x) (17)
~
with 2m = 1. Let
E > U (x) for a < x < b

(”classically allowed region”). Let

u1 (x), u2 (x), u3 (x)

represent solutions for x < a, a < x < b and x > b, respectively. From previous class,
µ Z a ¶
C1
u1 (x) = p exp − |k(y)| dy (18)
|p| x
·Z x ¸
C2
u2 = √ cos |k| dx + φ
p a
µ Z x ¶
C3
u3 (x) = p exp − |k(y)| dy
|p| b

9
Near a with force F = −U 0 (a) > 0

E − U ' F (x − a) , |x − a| ¿ b − a (19)

The integral is evaluated explicitly and one has

2√
· ¸
C1
u1 (x) ' √ exp − F (a − x)3/2 (20)
F (a − x)1/4 3~

This is the asymptote of the left ”outer” solution.


To get the inner solution consider

1
u00xx + F (x − a)u = 0 (21)
~2

Introducing the stretched variable

F 1/3
z= (x − a)
~2/3

one gets

u00zz + zu = 0 (22)

with a solution

uin (z) ∝ Ai(−z) (23)

(the other solution, Bi(−z) has a ”wrong” asymptote).


Now we match the inner asymptote as z → −∞ with eq.(20). This will give a constant
- do not find it yet explicitly. Then, the other inner asymptote as z → ∞ will determine
u2 . Consider the asymptotes from the first class. Note that the prefactors at z → ±∞ look
similar, with an extra ”2” in denominator. Thus,

C2 = 2C1 , φ = −π/4 (24)

(Kramers’26).
The above relation is general whether the motion is finite or not (i.e. if b is finite or not).
For a finite motion similar arguments can be repeater from the right, giving
·Z b ¸
2C3 π
u2 = √ cos |k| dx −
p x 4

10
This must be the same function, thus C1 = ±C3 and
Z b
π
k dx − = nπ
a 2

or
µ ¶
1
I
p dx = 2π~ n + (25)
2

(Bohr-Zommerfeld)
Small Project: consider a harmonic oscillator. Write down the WKB approximation
explicitly and compare with exact.
Small Project: consider in detail motion in linear potential (when the Airy function so-
lution will be exact). Discuss applications to an electron in a uniform electric field and/or
neutrons in gravitational field

VII. REPEATED ERROR INTEGRAL in erfc AND ITS APPLICATIONS

Less know but extremely important special function used both in boundary layer problems
(soon) and in solution of the time-dependent diffusion equation.

A. Integer n

Definiton:
Z ∞
n
i erfc(z) = in−1 erfc(t) dt (26)
z
2 2
i−1 erfc = √ e−z , i0 erfc(z) = erfc(z)
π

Recurrence relations:

z 1 n−2
in erfc(z) = − in−1 erfc(z) + i erfc(z) (27)
n 2n

B. Arbitrary n

Differential equation

00
yzz + 2zy 0 − 2ny = 0 (28)

11
y = Ain erfc(z) + Bin erfc(−z) (29)

Or

2
Z
(t − z)n e−t dt
n 2
i erfc(z) = √ (30)
n! π z

with n! ≡ Γ(n + 1).

C. Asymptotes

1. z → −∞

Consider eq.(30). One can neglect t compared to z in (t − z). The remainig integral

evaluates to π. Thus,
2
in erfc(z) ∼ (−z)n , z → −∞ (31)
n!

2. z → +∞

In eq.(30) the lower limit gives the main contribution. Replacing t by z + u with t 2 '
z 2 + 2uz one gets
2
n 2 e−z
i erfc(z) ∼ √ , z→∞ (32)
π (2z)n+1
Note: there is no in erfc(z) function in Mathematica, but it can be expresses through
confluent hypergeometric functions in Mathematica 5.2. It is done automatically if the
general integral in eq.(30) is evaluated. In later Mathematica 6, 7 and 8 the i n erfc can be
£ √ ¤
expressed through a parabolic cylinder function Dν z 2 - see inerfc7.pdf .

D. A Mathematica intermission

we will need a ”pure function” - one of the most elegant constructions in Mathematica,
similar to an operator in real math. Will introduce in class. In particular, (from previous
homeworks) can construct a Wronskian

wronsk := F ullSimplif y[#1 ∗ D[#2, x] − D[#1, x] ∗ #2]&

12
inerfcHzL

2.0

1.5

1.0

0.5

z
-2 -1 0 1 2

FIG. 4: The in erfc(z) functions for n = −1 (bell-shaped), n = 0 (sigmoidal) and n = 1, 2, 3 (from


top to bottom). For all n > −1 note a transition from a power-law asymptote (−z) n at z < 0 to
2
an exponential e−z /z n+1 at z > 0.

(will discuss in class all symbols here).


Now you can try for each pair of linearly independent solutions from the Table:

wronsk[Cos[x], Sin[x]]

wronsk[E x , E (−x) ]

wronsk[AiryAi[x], AiryBi[x]]

wronsk[BesselJ[n, x], BesselY [n, x]]

Later in the class we will study a package VectorAnalysis, and see that the pure function
is really helpful, and is exactly in the spirit of the relevant regular math.

13
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 3rd Lecture

VIII. APPLICATIONS TO THE NUCLEATION PROBLEM

A. The equation

Thermodynamics:

W(R)
W∗
µ2

µ1
R∗ R‘

FIG. 5: A nucleus in a supersaturated system with µ1 > µ2 (left) and the minimal work W (R)
required to create such a nucleus. The maximum W∗ due to excessive interfacial energy determines
the barrier to nucleation.

Gibbs: Work to form a nucleus (1878):

4π 2
W (R) = 4πR2 σ − n (µ1 − µ2 ) , W∗ = R σ
3 ∗

σ - interfacial free energy, n ∝ R3 - number of monomers


µ1 , µ2 - chemical potentials, (µ1 − µ2 ) /kb T > 0 - ”supersaturation”.
KINETICS:

βn
αn

n∗ n−1 n n+1

FIG. 6: Classical view of nucleation kinetics. A nucleus performs a random walk in the space of
its sizes, n. The gain βn and loss αn are size-dependent. Gain ”wins” for n > n∗ , the critical size.

14
In class:

• Derivation of the kinetic equation

• Connection between random walk and diffusion

Main kinetic (”Becker-Döring”) equation:

dfn
= jn − jn+1 , jn = βn−1 fn−1 − αn fn
dt

Gain βn -from simple kinetic model (e.g., β ∝ n2/3 ). The loss αn =


βn−1 exp [(Wn − Wn−1 ) /kB T ] follows from detailed balance.
Continuos approximation:
µ ¶
∂f ∂j eq ∂ f
=− , j = −βf (33)
∂t ∂n ∂n f eq
½ ¾
eq W (n)
fn ∝ exp −
kb T
Macroscopic evaluation of β (Zeldovich (1942)):

¯
β dW −1 dṅ ¯¯
ṅ = − , τ =
kb T d n dn ¯∗
Footnote: Historically, a discrete equation for random walk in the above picture was written
first. That equation, however, is somewhat harder to solve and we discuss it after we solve the
Zeldovich equation.

We are going to solve the nucleation equation, firts steady-state and then time-dependent
using matched asymptotic (singular perturbation) technique. Note: change of variables,
both the independent and dependent is an inevitable aspect of the approach. One needs to
get used...
Notations:
1 d2 W ¯¯
¯
f −2
v(n) = eq , ∆ = −
f 2kb T dn2 ¯n=n∗
We will need the function v since it is smooth (unlike f ) at n < n∗ . The original equation
now takes the form

∂v ∂ ∂v ∂v
= β + ṅ (34)
∂t ∂n ∂n ∂n

15
Note that we explicitly identified the deterministic growth rate ṅ which will be crucial for
subsequent solution. [Footnote: Alternatively, one could write equation for f in terms of ṅ:
∂f ∂j ∂f
+ = 0 , j = −β + ṅf
∂t ∂n ∂n
but this is inconvenient for n < n∗ where f changes rapidly; f will be more appropriate for the
growth region n > n∗ ]

B. Preliminaries: Steady-state solution

This is not the fastest way to get the result, but a good way to introduce ideas of matched
asymptotics and to know what to expect on every step of future time-dependent treatment
in appropriate limits. [see also the background section in VS, J. Chem. Phys. 115, 8181
(2001)].
One has an ODE:
d dv dv
0= β + ṅ (35)
dn dn dn
with boundary conditions:

v(0) = 1 , v (n > n∗ ) → 0 (36)

Note: it could be tempting to write a ”more accurate” v(1) = 1, implying at least 1 molecule in a
nucleus. At this point, however, this would be an overkill since a continuous description anyway
should not be too sensitive to such triffles, and discreteness effects will be discussed separately.
More generally, the ”0” in v(0) can be understood as any lower boundary n min , and the asymptotic
treatment is valid as long as nmin is well below n∗ . This can be important, e.g. when comparing
with precise numerical solutions of the Becker-Döring equation, where the boundary is often placed
at nmin which makes up an appreciable fraction of n∗ - see e.g. Kelton, Greer and Thompson,
J.Chem. Phys. v. 79, p. 6261 (1983).
Left outer solution n < n∗ :
v(n) = 1

Boundary layer:
n − n∗ n − n∗ z∆
z= , ṅ ' =
∆ τ τ
00
vzz + 2zvz0 = 0 (37)

16
so that
1
v in (z) = erfc(z)
2
with 1/2 from matching with the outer solution.
Right-hand outer solution: Note that v (z → ∞) decays too fast. It will be inconvenient
to match asymptotes. Thus, switch back to smooth f (n) (see previous footnote) One has

j = const ≡ jst , fst (n) = jst /ṅ (38)

2
Flux: from inner solution with f eq ' f∗eq ez

2 1 0 β∗ f eq
j = −βf eq vn0 ' −β∗ f∗eq ez vz = √∗ (39)
∆ ∆ π

Note:
∆2
β∗ =

Thus,


jst = √ f∗eq (40)
2τ π

(Zeldovich).
Small project. For steady-state flux can be found exactly. Do that, and evaluate the exact
integral asymptotically, as done by Zeldovich. Make a comparative picture
R
Footnote: Note that the total mass nfst (n) dn diverges on upper limit. This implies that
pure steady-state is impossible at all sizes (particles grow to infinite sizes) and one does need time-
dependence. Thus, more accurately, one talks about ”quasi-steady-state” before particles grow
so big that they start interacting with each other either directly or via depletion of the pool of
monomers.
(use a separate handout for a more detailed description and for the transient solution)

IX. ORTHOGONAL POLYNOMIALS

pn (x) for −1 ≤ x ≤ 1 (will not discuss exceptions, like Hermite). w(x) ≥ 0 - ”weight”
(density). ”Orthogonality”
Z 1
pn (x)pm (x)w(x) dx = 0 , m 6= n
−1

17
Norm Z 1
2
||pn || = p2n (x)w(x) dx
−1

Approximation of a function:
∞ 1
1
X Z
f (x) = an pn (x) , an = f (x)pn (x)w(x) dx
n=0
||pn ||2 −1

k
X
fkapp (x) = an pn (x)
n=0
Z 1
lim dx (f − fkapp )2 w = 0
k→∞ −1

(”complete set”).

A. Examples

Legendre: Pn (x), with w(x) ≡ 1.


Norm
||Pn ||2 = 2/(2n + 1)

First five:
1
x
1
2
(3x2 − 1)
1
2
(5x3 − 3x)
1
8
(35x4 − 30x2 + 3)
1
8
(63x5 − 70x3 + 15x)


Chebyshev: Tn (x) with w(x) = 1/ 1 − x2 .
Norm
π
||Tn ||2 = , n 6= 0 ; ||T0 ||2 = π
2

18
1.0

0.5

-1.0 -0.5 0.5 1.0

-0.5

-1.0

FIG. 7: First 5 Legendre polynomials

First 5:
1
x
2x2 − 1
4x3 − 3x
8x4 − 8x2 + 1
16x5 − 20x3 + 5x

1.0

0.5

-1.0 -0.5 0.5 1.0

-0.5

-1.0

FIG. 8: First 5 Chebyshev polynomials

19
Differential equation and trigonometric representation:

1 − x2 T 00 − xT 0 + n2 T = 0
¡ ¢

Let
d 1 d
x = cos θ , =−
dx sin θ dθ
then
d2 T
+ n2 T = 0
dθ2
and
Tn = cos(nθ) = cos(n arccos x)

Error
ek (x) = f (x) − fkapp (x)

see 788− orthog.pdf for f = sin πx.

0.000015

0.00001

5. ´ 10-6

-1.0 -0.5 0.5 1.0

-5. ´ 10-6

-0.00001

-0.000015

FIG. 9: Error of 10-term approximation of sin πx. Red - with Legendre polynomials, blue - with
Chebyshev. Note that Legendre is worse near the edges.

20
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 4th Lecture

X. OVERVIEW OF OTHER SPECIAL FUNCTIONS

Easier to classify for a full form of ODE:

f (x)y 00 + g(x)y 0 + h(x)y = 0

[Transformation to ”normal” form of a differential equation is achieved by changing variables


in order to get rid of the 1st derivative:
½ Z ¾
1
u(x) = y(x) exp (g/f )dx
2

will give µ ¶2 µ ¶0
00 h 1 g 1 g
u + I(x)u = 0 , I(x) = − −
f 4 f 2 f
HW: check this. If you are good with Mathematica write a pure function which calculates
I(x) for any f, g, h ]
Wronskian W . Taking the derivative of the definition of W and replacing the 2nd deriva-
tives using the original differential equation, one obtains

W 0 = −(g/f )W

Then: ½ Z ¾
W = exp − (g/f )dx

Note: for a full form of ODE generally

W (x) 6= const

Classification: number of free parameters in f (x), g(x), h(x) - see next page.

21
Name f (x) g(x) h(x) Applications Mathematica
sin, cos 1 0 1 everywhere Sin, Cos
exp (±x) 1 0 -1 everywhere Exp
Airy 1 0 -x Optics (caustics), QM: transi- AiryAi, AiryBi
tion to classically forbidden re-
gion; motion in constant field
in erfc(±x) 1 2x −2n diffusion-type (heat conductiv- -
ity)
Bessel x2 x ±x2 − n2 (mostly) problems with cylin- BesselJ, BesselY
(modified drical symmetry (−) or BesselI,
Bessel) BesselK (+)
Legendre 1 − x2 −2x n(n + 1) problems with symmetry close LegendreP, Leg-
to spherical endreQ
Hermite 1 −2x 2n QM: harmonic oscillator HermiteH
Chebyshev 1 − x2 −x n2 approximating polynomials ChebyshevT,
ChebyshevU
Confluent x c−x −a very broad see Hypergeo-
hypergeo- metric
metric
Mathiew 1 0 a − q cos(2x) parametric resonance, stability MathieuC,
of non-linear oscillations MathieuS
Hypergeo- x(x − 1) c − (a + −ab TOO broad see Hypergeo-
metric b + 1)x metric
HW: Bring the equation for Chebyshev polynomials to a normal form. Plot a few polynomials
Tn (x) on a single plot.
HW: using the fact that Tn (x) are orthogonal on the interval [−1, 1] with a weight function

w(x) = 1/ 1 − x2 , expand f (x) = sin(πx) as f app ' N
P
0 an Tn (x) for some modest N . Plot the

error f − f app . Do a similar expansion (same N ) using Legendre polynomials and compare the
error plots.

22
A. Why special functions in Physics?

Laplace operator:

∂2 ∂2 ∂2 ∂2f ∂2f ∂2f


∆= + + , i.e. ∆f = + +
∂x2 ∂y 2 ∂z 2 ∂x2 ∂y 2 ∂z 2
Main equations with ∆:

• Laplace equation
∆φ = 0

φ - electrostatic potential (in empty space), gravitational potential, etc.

• Poisson equation
∆φ = −ρ/²0 , ρ − charge density

• Diffusion equation
∂φ
∆φ = D−1
∂t
φ - concentration (or temperature in heat conductivity problem), D- diffusion coeffi-
cient

• Wave equation
1 ∂2φ
∆φ = , c − wave speed
c2 ∂t2

• Schrödinger equation

~2 ∂Ψ
− ∆Ψ + V Ψ = i~ , Ψ − wave function
2m ∂t

If all PDE why talk ODE? - Separation of variables. For example, look for a solution

φ = Φ (~r) e−λt

(diffusion) or
φ = Φeiωt

(wave equation). Both will give a Helmgolz equation

∆Φ + k 2 Φ = 0

23
with k 2 = λ (diffusion) and k 2 = ω 2 /c2 (wave). Similarly, the Shrödinger equation, k 2 =
(E − V )2m~2 .
Now still a PDE (x, y, z), but if symmetry Φ depends only on r. For spherical (d = 3),
circular (d = 2) etc. systems of coordinates

1 ∂ d−1 ∂
∆= r + angul.part
rd−1 ∂r ∂r

Now for d = 2 and only r-dependence

d2 Φ 1 dΦ
∆Φ(r) = +
dr2 r dR

typical Bessel.
On the o.h., for d = 3 the angular part leads to Legendre polynomials.

XI. BESSEL FUNCTIONS

Bessel functions are the most ”popular” in physics, but we will also use them to illustrate
some general features of the special functions which were not seen in the simpler, Airy
functions.
The singular point is x = 0. So, y1 (x) = Jn (x) -first kind, and y2 (x) = Yn (x) - second
kind, see Fig. 10. [HW: using Mathematica, calculate the Wronskian, W [Jn (x), Yn (x)];
compare with general predictions]. Let us transform to normal form:
½ Z ¾
1 2
u(x) = y(x) exp (x/x )dx
2

or

u(x) = y(x) x

and
I(x) = 1 − n2 /x2 + 1/4x2

Note that for large x the function I(x) approaches 1. Thus, according to WKB, u(x) for
x À 1 is oscillatory, with period 2π and constant amplitude, while y(x) oscillates with

amplitude decaying as 1/ x. Indeed, one has:

24
A. Asymptotes

r µ ¶
2 1 π
Jn (x) ∼ cos x − nπ − (41)
πx 2 4
and r µ ¶
2 1 π
Yn (x) ∼ sin x − nπ − (42)
πx 2 4
[HW: plot a few Bessel functions together with their asymptotes].
For large n the Bessel function will be non-oscillatory for a large interval of x (since I(x)
will be negative). For large n and finite x one can use the small-x expressions described
below. More interesting is the case when both x and n are large, when transition to oscilla-
tions is expected for x ∼ n. Here one recovers a relation between the Bessel functions and
the Airy functions - see Abramowitz, 9.3.4, etc.
[HW: Plot Jn (x), Yn (x) for a reasonably large n. Note: in some cases you will need some
finite interval of x around the ”transition value” of x = n, otherwise the relative value of
the function can be too large or too small to plot on the same scale.
Small project: plot on the same scale the Airy-function approximation from Abramowitz]

B. Small x

Near the singular point and for n 6= 0 one can neglect x2 in the free term. This leads to
what is known as a homogeneous equation which can be solved by a power-law. We look for
a solution y(x) ∝ xµ , and get
µ(µ − 1) + µ − n2 = 0

or
µ = ±n

Indeed, one has for x → 0


³ x ´n 1
Jn ∼ , n≥0 (43)
2 Γ(n + 1)
and
1 ³ x ´−n
Yn ∼ − Γ(n) , n > 0 (44)
π 2
A special case is
2h z i
Y0 (x) ∼ ln + γ , γ = 0.5772... (45)
π 2

25
Why logarithmic singularity? - from Wronskian!

C. Integer vs. non-integer n, generating function, recurrence relations and inte-


gral representation

For non-integer n = ν the solution J−ν is linearly independent from Jν . In particular,


there exists a formula expressing Yν through Jν and J−ν (see, e.g., Abramowitz, 9.1.2). For
integer n such solutions are not independent:

J−n (x) = (−1)n Jn (x) (46)

This follows from the so-called generating function


n=∞
X
x/2(t−1/t)
e = Jn (x)tn (47)
n=−∞

(note: here n are strictly integer!). Many recurrence relations which can be obtained directly
from the above equation, e.g.
Jn−1 − Jn+1 = 2Jn0 (48)

From here, and from the symmetry relation, one gets

J00 = −J1

. Another relation is Z x
−n
Jn (x) = x z n Jn−1 (z)dz (49)

There are several integral representations, the ”best” is


Z 2π
1
J0 (x) = eix sin θ dθ (50)
2π 0
which is famous for optics applications. (A similar expression for any n is available - see
Abramowitz).

D. Fraunhofer diffraction

Physics will be discussed in class. A circular aperture of diameter D = 2a is considered,


and the amplitude Φ is evaluated in the direction α from the center of the apperture for
small α. The field intensity is proportional to |Φ|2 .

26
From Huygens principle one needs and integral over the opening of the apperture (~r being
the vector from the center to any point in the plane of the apperture)
Z
exp (−ikR) d~r

~ is the vector connecting the point and the observation point.


R
~ 0 is the vector from the center to the observation point, one has
If R

~ =R
~r + R ~0

and for r ¿ R0
~ 0 · ~r
R
R ' R0 −
R0
If θ is the angle ~r makes in the plane of the apperture, then

~ 0 · ~r = R0 sin αr cos θ
R

thus
R ' R0 − r cos θ sin α

The constant in the phase does not matter (Why?) and one has
a 2π a ak sin α

Z Z Z Z
Ψ (α) ∝ rdr exp (−ikr cos θ sin α) dθ = 2π J0 (rk sin α) rdr = 2 2 J0 (x)xdx
0 0 0 k sin α 0

This is

J1 (ak sin α) · (ak sin α)
k2 sin2 α
For intensity one thus gets (λ = 2π/k):
· ¸
2 1 2 πD sin α
Φ ∝ J (51)
sin2 α 1 λ

(λ is the wavelength). For small α one can replace sin α by α, and the result is shown in
Fig. 11.
HW: Compare the numerical values of intensities at the 1st and 2nd maximum relative to the
primary maximum at α = 0

27
1 0.5

0.8
2 4 6 8
0.6
-0.5
0.4

0.2 -1

2 4 6 8
-1.5
-0.2

-0.4 -2

FIG. 10: Bessel functions Jn (x) (1st kind) and Yn (x) (2nd kind) for n = 0 (red), n = 1 (green)
and n = 2 (blue).

E. Small projects with Bessel functions

(optional - ask for references) :

1. examine the vibration eigenmodes of a circular membrane; see figures below, and the
788− BesselDrum.nb; some physics will be discussed in class

2. examine wave propagation in a cylindrical waveguide

3. study the spherical Bessel functions, Jn+1/2 , etc., and consider a quantum particle in
a spherical box.]

F. Modified Bessel functions

Note that going from x2 to −x2 in the Bessel equation can be achieved by going from
x to ix. Strictly speaking, great care must be shown since we (i.e., us) do not know well
enough analytical properties in the complex plain. Nevertheless,

In (x) = (−i)n Jn (ix) (52)

will be a real-value function, with the same asymptotes as Jn for x → 0, but with an
exponential growth as x → ∞

In (x) ∼ ex / 2πx (53)

One can expect that a similar construction will be used starting from Yn (x). Unfor-
tunately, there is an extra factor π/2 (you can notice it by comparing wronskians). The

28
10
0.25

5
0.2

0 0.15

-5 0.1

-10 0.05

-10 -5 0 5 10 2 4 6 8 10 12 14

FIG. 11: Fraunhofer diffraction from a circular aperture with diameter D. The arguments are
απD/λ with α ¿ 1 being the angle and λ the wavelength. The angle to see the first minimum is
called the angular resolution, θ ≈ 1.21967λ/D. Note that the intensity is very small beyond the
first minimum (right figure), but still can be easily picked up by the eye (left figure). [Also, note:
in optics literature this circular pattern is sometimes called ”Airy disc” - has nothing to do with
Airy functions. The bright spot at the center is called the ”Poisson spot”.]
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1

FIG. 12: Normal modes for a vibrating membrane of radius 1.

29
power-law asymptotes of Kn (x) (n 6= 0) as x → 0 remain similar to those of Yn (x), but with
this extra factor. For n = 0 one has

K0 (x) ∼ − ln(x/2) − γ , x → 0 (54)

Alternatively, for x → ∞ and any n one has



Kn (x) ∼ e−x / 2πx · π/2 (55)

The general structure of the functions is shown in Fig. 13. Note that all functions are now
positive. Unlike the regular Bessel case, there are now no ”good” functions which remain
finite for both x = 0 and x → ∞. But this can be quite ”physical” , see the example below.
HW: Calculate the Wronskian of In , Kn using Mathematica for several different n
HW: Plot a few modified Bessel functions together with their asymptotes .

G. Diffusion of neutrons

Physics will be discussed in class. Consider a stationary problem

D∆φ − σφ = 0 (56)

with cylindrical symmetry. We now switch to cylindrical coordinates where expect depen-
dence on r only:
r2 φ00 + rφ0 − r2 k 2 φ = 0 , k 2 = σ/D (57)

[You can check this with Mathematica:

<<”Calculus‘VectorAnalysis‘”

F ullSimplif y[Laplacian[u[r], Cylindrical[r, t, z]]]

(with t standing for theta, but since we neglect the dependence on t and z it does not matter
anyway)
HW: try this]
The equation (57) is solved as

c1 I0 (kr) + c2 K0 (kr)

30
(again, if you need help, use Mathematica:

l := r2 ∗ D[#, r, r] + rD[#, r] − k 2 r2 #&

gives the operator and


DSolve[l[u[r]] == 0, u[r], r]

gives the above general solution - try this!)


Now you can see, that whatever we try, there will be an infinity. What that means? Will
discuss in class - the infinity at r = 0 does matter, see Fig. 14. Also note, cannot use σ = 0,
i.e. in 2-dimensions (and in 1-dim.) there is NO steady-state diffusion in infinite space. 3D
is different, however.
5

0.5 1 1.5 2 2.5 3

FIG. 13: Modified Bessel functions of the 1st kind , In (x) (ascending lines) and 2nd kind, Kn (x)
(descending lines) for n = 0 (red), n = 1 (green) and n = 2 (blue).

What infinity at r = 0 means? Need a source! Flux (density):

dφ dK0 (kr)
j = −D = −c2
dr dr

Total flux (per unit length in the z-direction)

J(r) = 2πrj(r)

and the intensity of source:


S0 = lim J(r) = 2πDc2
r→0

which gives c2 if source is known.

31
1

0.5

-0.5

-1
-1 -0.5 0 0.5 1

FIG. 14: Concentration profiles for the steady-state diffusion of neutrons. Note a singularity (red
cented) near r = 0.

Dr. Vitaly A. Shneidman, Phys/MtSE 788, 6th Lecture

XII. ELECTROSTATICS AND LEGENDRE POLYNOMIALS

The Legendre polynomials are related to the Laplace operator in spherical coordinates
(its angular part - see below ) and thus have an enormous amount of applications in Physics.
However, electrostatics provides a very natural way to introduce them, and provides us with
important intuition.

A. Field of point charges and the generating function for Legendre polynomials
(LP)

Consider a point charge q placed on the z-axes at a distance a from the origin (figure will
be shown in class). We are interested in the electrostatic potential produced by this charge
at an observation point at a distance r from the the origin (not from this charge!), which is
seen at an angle θ. If the distance from the charge is r1 , then the potential is

φ = kq/r1 , k ≈ 9 · 109 N m2 /C 2 ≡ 1/ (4π²0 )

32
From geometry,
r12 = r2 + a2 − 2ar cos θ

Consider now r À a and perform a series expansion of the potential in powers of a/r. The
coefficients of this expansion are functions of cos θ and by definition they correspond to
Legendre polynomials. More precisely:

1 1X ³ a ´n
√ = Pn (cos θ)
r2 + a2 − 2ar cos θ r n=0 r

Here Pn are known are the ”Legendre polynomials” (LP), and the function on the left is the
”generating function”. (Of course we can replace cos θ by x, but it is useful to remember
the connection).
[HW: use the Series command in Mathematica to get the first 5 LP]
Consider now a dipole with charges ±q at ±a. The even terms of the expansions get
cancelled, while the odd double. One has
½ ¾
2kq ³a´ ³ a ´3
φ(r, θ) = P1 (cos θ) + P3 (cos θ) + ...
r r r

Here 2aq = d is the dipole moment, so that for r → ∞

kdP1 (cos θ)
φ≈
r2

Similarly, the procedure can be continued by making a more symmetric distribution of


charges with d = 0 (e.g., +q at ±a and −2q at 0), and considering the leading term for
r À a which is due to the quadrupole moment, etc.

B. Explicit expressions and recurrence relations

For small n LP are simple:

P0 (x) = 1 , P1 (x) = x , P2 (x) = 3x2 − 1 /2 . . .


¡ ¢

(see section on Orthogonal polynomials for more). There are many recurrence relations
which allow to generate LP fast, without the actual series expansion, e.g.

(n + 1)Pn+1 (x) = x(2n + 1)Pn (x) − nPn−1 (x)

33
[HW: Use the above recurrence relation, and start with P0 , P1 to obtain other LP. For
some reasonably large n compare with standard LegendreP in Mathematica, and compare
the evaluation time using the Timing command. Do not try to view the polynomial on the
screen for large n !].
Note that
Pn (1) = 1 , Pn (−1) = (−1)n

this follows, e.g. from the recurrence relation [HW (optional) show this]. Also

P−n (x) = Pn−1 (x)

[HW: check this using FullSimlify]

C. Relation to Laplacian

In spherical coordinates one has

ˆ R − 1 ˆl2
ˆ =∆

r2

with l2 given by
1 ∂2
µ ¶
ˆl2 = − 1 ∂ sin θ


sin θ ∂θ ∂θ sin2 θ ∂φ2
[HW: (optional) check this using Calculus‘VectorAnalysis‘) Making a substitution

x = cos θ , sin2 θ = 1 − x2

one gets an equation


∂2
· ¸
ˆ2 ∂ ¡ 2
¢ ∂ 1
l =− 1−x −
∂x ∂x 1 − x2 ∂φ2
∂2
which leads for LP in x (or in cos θ) if ∂φ2
= 0.
Another relation
ˆ n Pn (cos θ) = 0 for any n
∆r

[HW (optional): check this using Calculus‘VectorAnalysis‘] I.e. in problems with no depen-
dence on φ an expansion in r n Pn (cos θ) with −∞ < n < ∞ is possible. We will use it in the
problem of a conducting sphere in a uniform field.

34
1.5 3

1 2

0.5 1

-1 -0.5 0.5 1 -1 -0.5 0.5 1

-0.5 -1

-1 -2

FIG. 15: Legendre polynomials Pn (x) (left) and Legendre functions of the 2d kind, Qn (x) (right)
for n = 0, 1, 2

D. The other solution

Consider now the differential equation for the LP - see Table. There are singular points
at x = ±1. The LP are solutions of the 1st kind, which are regular. The other solutions
are the Legendre function of the 2d kind, Qn (x). They are not polynomials (why?), and are
given by LegendreQ in Mathematica. Both types of solutions are shown in Fig. 15. The
functions Qn (x) have logarithmic singularities, e.g.

1 1+x 1 1+x
Q0 (x) = ln , Q1 (x) = x ln − 1 ,...
2 1−x 2 1−x

[HW (optional): using Mathematica check for some n, or in general, that Qn satisfy the
same recurrence relation as Pn .]

E. Physical applications

1. Gravitational field

" ∞ µ ¶n+1 #
GM R X R
U (r, θ) = − an Pn (cos θ)
R r n=2
r
Why no a1 ?
a2 ∼ 10−3 , a3 ∼ 2.5 · 10−6 . . .

Will discuss in class the non-spherical corrections to gravitational field of Earth. [Small
project: Plot the direction of ~g compared to the ”vertical” as a function of r, θ.]

35
[Large project: Study the motion of a satellite. Note: will need to integrate Newtons
equations in spherical coordinates, ask for references].

2. ~0
Conducting sphere in uniform field E

Small project. Physics will be discussed in class.

rn Pn (cos θ)

is the solution of the Laplce equation for any n. From the recurrence relations

P−n (x) = Pn−1 (x)

Thus
∞ ½ ¾
X
n Pn (cos θ)
V (r, θ) = an r Pn (cos θ) + bn
rn+1
n=0

Boundary condition (1st one):

V (r → ±∞) = ∓E0 r cos θ

Thus,
a1 = −E0 , an = 0 for n 6= 1

2nd BC:
V (r = R) = 0

(uncharged sphere). Thus


µ ¶ ∞
b1 X Pn (cos θ)
b0 /R + 2
+ a1 R P1 (cos θ) + bn =0
R rn+1
n=2

Thus,
b1 = −a1 R3 = E0 R3 , bn = 0 for n 6= 1

or
V (r, θ) = −E0 rP1 (cos θ) 1 − (R/r)3
¡ ¢

Charged sphere: V (R) = Q/R (CGS). Thus, b0 = Q and Q/r is added to previous solution at
r ≥ R (superposition!)
Plotting of lines is in condSphere.m. The result is in Fig. 16
[Small projects (optional): reproduce the plots using StreamLine plot]

36
2
2
1.5
1.5
1 1
0.5 0.5

-2 -1 1 2 -3 -2 -1 1 2 3
-0.5 -0.5

-1 -1

-1.5 -1.5

-2 -2

FIG. 16: Left: Electric field lines (blue) and equipotential surfaces (red) for a conducting sphere
in a uniform field. Right: same, when the sphere is charged wit a positive charge

3. Dielectric sphere

The expansion (??) is the same, but now out and in (use capital An and Bn to distinguish).
Out, the same BC at r → ∞. Thus,

Aout out
1 = −E0 , An = 0 for n 6= 1

Inside - no singularity at r = 0:
Bnin = 0

~ || continuous (otherwise circulation 6= 0)


Boundary conditions on the surface: E
~ in,out = κ1,2 E
Dnormal continuous; D ~ in,out .

Thus
1 ∂V in (R, θ) 1 ∂V out (R, θ)
− =−
R ∂θ R ∂θ
and
∂V in (r = R, θ) ∂V out (r = R, θ)
−κ1 = −κ2
∂r ∂r
From these BC:
Ain out out
1 = A1 + B1 /R
3

and
κ1 Ain
¡ out out 3
¢
1 = κ2 A1 − 2B1 /R

(linear system of equations). Thus,

3κ2 κ1 − κ2
Ain
1 =− E0 , B1out =
2κ2 + κ1 κ1 + 2κ2

37
2 2 2

1.5 1.5 1.5

1 1 1

0.5 0.5 0.5

-3 -2 -1 1 2 3 -3 -2 -1 1 2 3 -3 -2 -1 1 2 3
-0.5 -0.5 -0.5

-1 -1 -1

-1.5 -1.5 -1.5

-2 -2 -2
2

1.5

0.5

-3 -2 -1 1 2 3
-0.5

-1

-1.5

-2

FIG. 17: Electric field lines (blue) and equipotential surfaces (red) for a dielectric sphere in a
uniform field. ² ≡ κin /κout ; from top left, clockwise: ² = 1 (test); ² = 2, ² = 4 and ² = 0.33 (cavity
~ rather than E.
in a dielectric). Note that the field lines better represent the vector D, ~ (Think

why?)

and
3κ2
V in = − E0 r cos θ
2κ2 + κ1
κ1 − κ2 R3
V out = −E0 r cos θ + E0 2 cos θ
κ1 + 2κ2 r
Checkpoint1: κ1 = κ2 :
V in = V out = −E0 r cos θ

Checkpoint2: κ1 /κ2 → ∞:

R3
µ ¶
in out
V =0, V = −E0 r cos θ 1 − 3
r

(conductor).
General:
3κ2
E in = E0
2κ2 + κ1
Uniform field!!!

38
Dr. Vitaly A. Shneidman, Phys/MtSE 788

Part III

Diffusion
XIII. THE DIFFUSION APPROXIMATION TO RANDOM WALK

Consider a ”distribution function” fk with k = 0, ±1, ±2, . . . (analog of 2m − n) which


changes with ”time” t, analog of n. One has
1 1
fk (t + 1) = fk (t) + fk−1 (t) + fk+1 (t) − fk
2 2
= fk (t) + D [fk−1 (t) + fk+1 (t) − 2fk (t)] , D = 1/2 (58)

Considering fk (t) as a smooth function of both t and k, one has (with k replaced by x):
∂f ∂2f
=D 2 (59)
∂t ∂x
The solution (”Greens function”) is given by
x2
½ ¾
1
G(x, t) = √ exp − (60)
2 πDt 4Dt
Correspondence with the exact solution is excellent - see Fig. 18.

A. Biased diffusion

Consider a biased random walk with probability p going right, and q = 1 − p going left
on every step.
∂f ∂2f ∂f
=D 2 +v , v =p−q (61)
∂t ∂x ∂x
HW: derive this, an generalize the exact expression.
The Green’s function just drifts with time

Gb (x, t) = G(x − vt, t)

HW: check this


Again, correspondence is excellent - see Fig. 19.

39
0.1

0.08

0.06

0.04

0.02

-60 -40 -20 20 40 60

FIG. 18: Non-biased random walk (points) and the diffusion approximation

0.1

0.08

0.06

0.04

0.02

-60 -40 -20 20 40 60

FIG. 19: Same, for a biased random walk.

B. Limitations of the diffusion description

Note that the exact expression is strictly zero for 2m − n > n, but the diffusion gives a
finite (albeit an incredibly small value) for any x. Thus, difference on tails can be expected
-see Fig. 20.
Project Think how this can be cured and construct a better approximation.

40
-60 -40 -20 -10 20 40 60

-20

-30

-40

FIG. 20: Non-biased random walk and the diffusion approximation on a log scale

Dr. Vitaly A. Shneidman, Phys/MtSE 788, 8th Lec-


ture

XIV. DIFFUSION IN FREE SPACE FOR D = 1, 2, 3

will be discussed in class.

r2
· ¸
1
G[r, t] = exp −
{4πt}d/2 4t

(the Green’s function for any d = 1, 2, 3 )


Normalization: Z
dd rG[r, t] = 1

with d2 r = 2πrdr and d3 r = 4πr2 dr (HW: verify the above and verify that G satisfies the
diffusion equation for any d)
Constant source:

1
Z
G[r, t]dt = π −d/2 r2−d Γ[d/2 − 1] , d > 2
0 4

No steady-state for d ≤ 2(!)

41
1

0.8

0.6

0.4

0.2

-4 -2 2 4

FIG. 21: Diffusion of an initially constant distribution in free space

XV. THE DIFFUSION EQUATION IN 1 D

A. Free boundaries

General solution (1d): Z ∞


c(x, t) = dyG[x − y, t]c0 (y)
−∞
the above is general for initial distribution c0 ; below is an example of a localized intial
distribution between x = 0 and −∞:
· ¸
1 x
can [x, t] := erfc √
2 2 t
(see diffusion2.nb)
Another example: c0 = 1 for 0 < x < 1. From superposition principle:

cbox [x, t] = (can [x − 1, t] − can [x + 1, t])/2

B. Problems with boundaries

1. Semi-infinite: fixed concentration

c(0, t) ≡ 1
· ¸
x
c(x, t) = 2can [x, t] = erfc √
2 t
guessed !! (yes, guessing is legal!); same figure as before, only now the region x < 0 is
”unphysical”

42
2. Semi-infinite: reflecting

point source at x = 1 and reflecting boundary at x = 0. j = 0, thus ∂c/∂x = 0 at the


reflecting boundary.

cmir [x, t] := G[x − 1, t] + G[x + 1, t]

3. semi-infinite: absorbing

Absorbing boundary at x = 0 and point source at x = 1.

cabs [x, t] := G[x − 1, t] − G[x + 1, t]

Note : do not care about negative concentration at x < 0

C. Two absorbing boundaries: Fourier expansion

1. Formulation of the problem

A. Solve the equation


∂c ∂2c
=D 2 (62)
∂t ∂x
in the interval
0≤x≤l

with l = 1cm, D = 10−8 m2 /s and the boundary conditions (BC)

c(0, t) = c(l, t) = 0

The initial condition is


c(x, 0) = f (x)

Select any simple function f (x) (e.g., a linear function f (x) = ax + b, or a boxed function
f(x)=1 for l/2 − h/2 ≤ x ≤ l2 + h/2 - Appendix A for Mathematica hints).
B. Plot graphs for concentrations at different points for t = 1h, t = 2h, t = 4h, t = 6h
and compare analytical and numerical results.

43
Start: Dimensionalization: Switch to new time

t0 = Dt/l2

so that
∂c ∂2c
= (63)
∂t0 ∂x2
In that form the equation is ready to be passed to a mathematician (we do not scale x since
l is 1cm).

2. Analytical solution

Below the method of separation of variables is applied; other methods (Laplace transform,
reflection etc.) also can be used. Primes will not be indicated further in eq.(75).
We look for a solution

X
An exp −λ2n t sin(nπx)
¡ ¢
c(x, t) = (64)
n=1

[Note: In each term of the sum the x- and t-dependencies are separated. A simple exponential
dependence on t is expected since there is only a first derivative in t and coefficients are
t-independent. The function sin(nπx) for integer n = 1, 2, 3... satisfies the diffusion equation
(75) and the BC.]
Substituting the above expansion in eq.(75) and comparing coefficients at each sin(nπx),
one obtains:
λ2n = π 2 n2

for the eigenvalues. To obtain the expansion coefficients, An , we note that


Z 1
sin(nπx) sin(mπx)dx = 0
0

for m 6= n and equals 1/2 for m = n. Then, we consider eq.(64) at t = 0 with c(x, 0) = f (x).
Multiplying the expansion by sin(mπx) and integrating from 0 to 1, one obtains
Z 1
1
dxf (x) sin(nπx) = An (65)
0 2
For simple f (x) the integral can be evaluated analytically (e.g, with Mathematica help).
After this, the expansion (64) gives the full analytical solution. If the time is not too small,
the solution is accurately approximated by the first few terms. It can be plotted easily using
any program; Mathematica is one of the possibilities.

44
1

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1

FIG. 22: Diffusion of an initially constant distribution between two absorbing boundaries

D. Numerical

Let us break the x-interval into N segments with δx = 1/N . There is now an array of
N +1 concentrations cj (t) with j = 0, 1, 2, ..., N and with c0 = cN = 0. The simplest method
is to replace the second derivative in eq.(75) by the second difference:
∂ 2 c ¯¯
¯
→ [cj+1 + cj−1 − 2cj ] /(δx)2
∂x2 ¯x=xj

where xj = j · δx is the discrete coordinate.


Thus one gets a system of ordinary differential equations
dcj
= [cj+1 + cj−1 − 2cj ] /(δx)2 , 1 ≤ j ≤ N − 1 (66)
dt
with initial conditions
cj (0) = f (xj )

Various ways to solve the resulting equations wil be discussed later in the course.

E. Laplace Transform

The same problem. See the Mathematica notebook. After switching to the LT, the
diffusion equation becomes an ordinary differential equation, and can be solved in elementary
functions. Further, we expand the denominator assuming large s to emphasize the role of
small t (and to simplify inversion). One obtains
√ √ √ ∞
1 + e− s
− e− sx
− e− s(1−x) X √
W [x, s] = (−1)m e−m s
s m=0

45
Inverse of

e− s(x+m)
/s

is · ¸
m+x
im [x, t] ≡ erfc √
2 t
Thus,

X
c[x, t] = (im [0, t] + im [1, t] − im [x, t] − im [1 − x, t])
m=0

For a given accuracy, ² ¿ 1 one has an estimation



m ∼ 2 t ln(1/²)

which is a modes number (for a computer) for not too large t. With such a cut-off on m
evaluation of the sum (and plotting) are fast on any platform.

XVI. PROJECT 1

• describe in detail the full solution of the 1-dimensional problem with 2 absorbing
boundaries, using both Fourier and Laplace

• estimate the minimal number of terms in each expansion to reach a given accuracy
(say, 10−16 )

• make a single expression which would automatically select the expansion with less
terms (depending on time)

• make a good plot

• Extra: consider a different, say linear, initial distribution

XVII. HIGHER DIMENSIONS. STEADY-STATE

∆c = 0

46
A. d=1

Consider boundary conditions c(0, t) = c0 , c(l, t) = 0 which lead to steady-state concen-


tration
c = ax + b = c0 (1 − x/l)

(cannot take l → ∞).


Flux
j = Dc0 /l = const

(typical for 1d)

B. d=2

Two coaxial cylinders, c(a) = c0 , c(b) = 0

0
(rc0 ) = 0

ln(b/r)
c = A + B ln r = c0
ln(b/a)
Again, need boundaries: cannot take a → 0 or b → ∞. Can consider, however,

a → 0 , c0 / ln(1/a) = const

Flux:
1
j(r) = Dc0
r ln(b/a)
Total flux:
1
J = 2πrj = 2πDc0 = const
ln(b/a)
HW: consider evaporative BC

dc/dr + h (c − ceq ) = 0

find flux and study it as a function of b/a

47
C. d=3

Two concentric spheres, c(a) = c0 , c(b) = 0

¡ 2 0 ¢0
r c =0
a(b − r)
C = B + A/r = c0
r(b − a)
For b → ∞
c = ac0 /r

(no problem).

XVIII. TIME-DEPENDENT, d = 2

Diffusin with D = 1 inside a cylinder with R = 1, c(R, t) ≡ c0 , c(r, 0) = 0.


New variable to get zero BC:

f (r, t) = c(r, t) − c0 , f (r, 0 = −c0

XIX. SEPARATION OF VARIABLES

Look for
u(r) exp −λ2 t
¡ ¢

with
1 0
(ru0 ) + λ2 u = 0 (67)
r
with solution
J0 (λr)

(the other solution is infinite at r = 0). From the BC:

J0 (λ) = 0

i.e. λ = λn , the n-th root of J0 .


Thus,

X 2
f (r, t) = bn J0 (λn r) e−λn t
n=1

48
with ∞
X
f (r, 0) = bn J0 (λn r)
n=1

Using Z 1
rJ0 (λn r) J0 (λm r) dr = 0 , m 6= n
0

and
1
1
Z
rJ02 (λn r) dr = J12 (λn )
0 2
one obtains bn ( see below).
HW check the above identities

Z 1 Z 1
bn f (r, 0)J02 (λn r) rdr = − J02 (λn r) rdr = −J1 (λn r) /λn
0 0

(HW - check the last relation from books or Mathematica) Thus,

2
bn =
λn J1 (λn )

see the Mathematica handout with graphics and the Bessel package.

A. Small time: Laplace

Equation for LT is similar to the one which follows from separation of variables but with
−s instead of λ2 . Thus, modified Bessel. With c0 = 1, solution

I0 (r s)
C(r, s) = √
sI0 ( s)

Expanding for s → ∞, one gets an expansion in terms of


µ ¶
n x
i erfc √
2 t
(see Mathematica handout). The 1st term,
µ ¶
x
erfc √
2 t
is similar to the flat case.

49
XX. PROJECT : AN APPLIED PROBLEM WITH NON-LINEAR BOUNDARY
CONDITIONS FOR THE DIFFUSION EQUATION

A. Introduction

This research project is part of the Phys 788/MtSE 788 course. The goal is to introduce
students to a delicate interplay of analytics and numerics when studying a close-to-life
applied problem.
The problem is from the book by P. Shewmon ”Diffusion in Solids”, but with variable
parameters and with additional tasks.

B. Formulation of the problem

Hydrogen at 1 MPa is to be stored at 400o C in outer space, in a spherical iron tank


with an inner radius a and an outer radius b. You are a) to calculate the rate of pressure
drop (MPa/s) as a result of diffusion of hydrogen through the wall and b) to calculate the
relative concentration of hydrogen in iron (in gmH/gmFe) as a function of time.
Take the diffusion coefficient D = 10−8 m2 /s, and assume that the concentration of
hydrogen in the iron at either side of the wall is the equilibrium solubility given by the
equation
C(P ) = 10−5 (p)1/2 gmH/gmF e (P in MPa) (68)

Plot results for a = .1m and b = 0.101m, b = 0.2m, b = ∞.


Extra credit. The same problem, but for a long cylindrical tank.

C. Mathematical formulation

D. Diffusion in iron

One has for the concentration c (~r, t)


∂c (~r, t)
= D∇2 c (~r, t) (69)
∂t
Since the problem is spherically symmetric, one has
µ ¶
∂c(r, t) 1 ∂ 2 ∂
=D 2 r c(r, t) (70)
∂t r ∂r ∂r

50
The boundary conditions to this equation are given by eq.(68).

E. Pressure Drop

Pressure drop results from leakage of hydrogen into iron. The flux density of hydrogen
inside iron (at any r ) is given by

j(r, t) = −D∂c(r, t)/∂r

Thus, the full flux into iron is given by


¯
∂c(r, t)
I(t) = 4πa2 j(a, t) = − 4πa2 D
¯
¯ (71)
∂r ¯r=a

If the dimension of c (for the moment at least) is # of molecules per m3 , then the rate
at which molecules are lost from the gas is given by

dN
= −I (72)
dt

The ideal gas law


P = N/(4/3 πa3 ) · kT

(T being absolute temperature and k Boltzmann constant) relates N to pressure; a factor


10−6 should be introduced if P is in MPa, and all the rest in SI units.
If concentration c is relative to iron, eq.(71) is to be multiplied by nF e , the concentration
of Fe atoms. Further, as usual for the diffusion problem, we will use a
new ”time” = ”old time” · D.
(No new notations will be used, but the final time should be divided by D if one wants to
get it in seconds). Similarly, to we will use a concentration multiplied by 10 5 in order to get
rid of a small factor in boundary conditions; again we will still use c, but the final answer
should be reduced by 105 to get gmH/gmFe.
One thus has

¯
dP α ∂c(r, t) ¯¯
(in MPa/s) = (73)
dt a ∂r ¯r=a
with
α = 3 · 10−11 knF e T (74)

51
and µ ¶
∂c(r, t) 1 ∂ 2 ∂
= 2 r c(r, t) (75)
∂t r ∂r ∂r
(Task 1. Calculate the number for α at the given temperature.)
Equations (73) and (75) together with the initial condition P (0) = 1 and the boundary
conditions
√ p
c(a) = P , c(b) = Patm (76)

give a full description of the problem. Note that Patm is the partial pressure of hydrogen
in atmosphere in MPa.
(Task 2. Find out the value of Patm .)

F. Overview

We succeeded in casting the equations in a form convenient for mathematical study.


There is now a single parameter α which (together with a and b) determines the solution.
The system of equations (73, 75,76) cannot be solved exactly due to the non-linear bound-
ary condition, eq.(76). We can thus choose two ways. The first is a reasonable analytical
approximation. The second is a full numerical solution of the problem.
What is the reason to expect an accurate analytical approximation? - It is is the small
value of α. Note that for α = 0 the pressure and concentration equations become decoupled
from each other. Here the diffusion equation can be solved exactly, approaching a steady
state. For non-zero but small α one can expect that concentration still remains close to
steady state, but with a factor which slowly drifts with time. This is called ”quasi-steady-
state”. Accuracy of the approximation will depend on whether indeed the time to establish
steady-state inside the iron is smaller than the characteristic time scale of pressure drop.
Intuitively, this will happen for reasonably thin walls (a more precise criterion can be estab-
lished a posteriori). The quasi-steady-state approximation will not work for b → ∞ (cavity
with hydrogen in bulk iron) when describing concentration, but still can work to determine
dP/dt.

52
G. Analytics: Quasi-steady-state

1. The thin-wall approximation

Consider
d≡b−a¿a,

a ”thin wall”. There is not much difference now from a flat membrane. The gradient of
concentration is approximately constant given by

dc/dr ≈ − [c(a) − c(b)] /d

Neglecting c(b) and using the condition (73) one obtains

dP α√
=− P
dt ad

which gives
p p αt
P (t) = P (0) −
2ad
(Task 3. Find P (t) not neglecting Patm . Compare with above).

2. Thick wall

Using a substitution
c(r, t) = χ(r, t)/r

the spherically symmetric diffusion equation is reduced to a one-dimensional form

∂χ ∂2χ
= 2 (77)
∂t ∂r

(Note: there is no similar simple trick for cylindrical problem!)


We are interested in steady-state with

χ(r) = A + Br

A and B are determined by boundary conditions. E.g., for an infinite wall one should have
B = 0 and A = ac(a). Thus,
c∞ (r) = c(a)a/r

53
and one has
dP α√
=− 2 P
dt a
The rest is similar to the thin-wall case.
(Task 5. Do the general case, b < ∞). Plot graphs and compare.
(Task 6. Try to establish the limits of applicability of the quasi-steady-state approxima-
tion; the thin-wall case is the simplest).

H. Numerical

Since eq. (77) looks 1-dimensional, we use the same ideas as described before project
1. The interval between a and b is broken into a large number (M ) of small intervals with
width
δ = (b − a)/M

This gives a set of ordinary differential equations for χ1 , χ2 , etc., which can be solved using
standard approaches. There is a difference in boundary conditions
p
χ0 (t) = a P (t)

with an extra differential equation


½ ¾
dP α dχ χ
= 2 −
dt a dr r

(Task 7. Re-write the above in terms of discrete χ0 , χ1 . Write a full system of equations
you will be solving).
(Task 8. Write a program (any language), compare with analytics).

54
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 9th Lecture

XXI. VARIABLE D = D(c)

Consider 1-d and steady state with

D = D0 [1 + f (c)]

In steady-state
dc
−D = j = const = J
dx
Thus, Z
D(c)dc = −Jx + B

or with Z c
F (c) ≡ f (c0 ) dc0
0

D0 [c + F (c)] = −Jx + B (78)

Let
c(0) = c0 , c(l) = 0

From BC at x = 0:
B = D0 [c0 + F (c0 )]

the other BC:


−Jl + B = 0

Thus from eq. (78)


c − c0 + F (c) − F (c0 ) x
=− (79)
c0 + F (c0 ) l
Example: f (c) = ac/c0 , [a] = 1, F (c) = (1/2)ac2 . With y = x/l and z = c/c0

z − 1 + 1/2 · az 2
= −y
1 + a/2

(see the Mathematica printout with plots).


HW - explore the limits of a. For a = 1 find numerically c(x) and make a few plots c(x).

55
XXII. NUMERICAL SOLUTIONS

we consider a one-dimensional equation with D = 1


∂c ∂2c
=
∂t ∂x2
(D will be re-introduced into some of the results for clarity).

A. Discretization in space. Exponential solution.

∂ 2 c ¯¯
¯
→ [cj+1 + cj−1 − 2cj ] /(δx)2
∂x2 ¯x=xj
where xj = j · δx is the discrete coordinate and the dimension is N .
Thus one gets a system of ODE’s
dcj
= [cj+1 + cj−1 − 2cj ] /(δx)2 (80)
dt
If we introduce a matrix m̂ with
1
mik = −1 (i = k) , mik = (i = k ± 1) , mik = 0 otherwise
2
and an N -dimensional vector ~c = (c1 , c2 , . . .) then
d~c 2
= 2 m̂ · ~c
dt δx
The formal solution is ½ ¾
2t
~cexp (t) = exp m̂ · ~c(0)
δx2
Since Mathematica ”knows” the exponential of a matrix, it is possible to test this against
the Green’s function of the exact diffusion equation - see 788− diff4.nb with mat1 correspond-
ing to m̂ and v to c. In practice, however, there is too much strain on computer if N (dim
in 788− diff4.nb) is large.

B. Discretization in t

Let dt be the discrete step in time. Then


2dt
~c(t + dt) = ~c(t) + m̂ · ~c (81)
δx2

56
or with Iˆ being the identity matrix,
dt
~c(t + dt) = M̂r · ~c(t) , M̂r = Iˆ + 2rm̂ , r ≡ (82)
δx2
If n steps in time are made,
~cpow (ndt) = M̂rn · ~c(0) (83)

(note that exponential solution appears for r → 0).


The solution is accurate and fast, but becomes unstable for larger dt. Why? Note the
the problem is identical to random walk with r being the probability to step right or left.
Then, 1 − 2r is the probability to stay, or
D dt 1
r≡ 2
≤ (84)
δx 2
One can test that absolute values of some eigenvalues of M̂r are larger than 1 for r > 1/2
(see 788− diff4.nb). More formally, criteria of stability are established by the von Neumann
stability analysis:

C. von Neumann stability analysis

Ignore the boundaries, etc. Look for

v (jδx, t) ∼ eikj eλt

one gets
eλ = 1 + 2r(cos(k) − 1) = 1 − 4r sin2 (k/2)

If any k, then for r > 1/2 one has eλ < −1 (λ complex). Thus,

eλ × eλ × eλ . . . − diverges!

D. Backward (implicit) scheme

Instead of eq. (81)


2dt
~c(t + dt) = ~c(t) + m̂ · ~c(t + dt) (85)
δx2
or
~c(t) = M̂−r · ~c(t + dt)

57
Thus,
³ ´−1
~c(t + dt) = M̂−r · ~c(t)

This is stable - see 788− diff4.nb. Or, von Newmann analysis:

eλ = 1 − eλ 4r sin2 (k/2)

with
1
eλ =
1 + 4r sin2 (k/2)
Thus, for any r > 0
¯ λ¯
¯e ¯ < 1

(yes!)
Alternative - Crank-Nicholson.

58
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 9th Lecture

XXIII. LAPLACE EQUATION IN A SEMI-INFINITE STRIPE

Consider the following 2D problem:


two parallel conducting planes are separated by a distance a = 1 in the x-direction and are
at zero potential. Between the planes there is a semi-infinite conducting slab with thickness
a − 0 which down extends from y = 0 and which is at potential V . Find the distribution of
potential in the stripe 0 < x < a and 0 < y < ∞.
This is a rich problem which will allow us to

• consider the solution via separation of variables

• examin singularities near the corners and discuss the dimensional analysis

• briefly consider relation to the theory of analytic functions (complex variables) where
the problem does have a closed solution (though, lets forget about it for the moment

• introduce numerical methods of solving the Laplace equation

A. Separation of variables

Since we have rectangular geometry, natural to consider Cartesian coordinates. Look for
a solution
X
V (x, y) = ak Xk (x)Yk (y) (86)
k

(can do this because the Laplace equation is linear). Consider now a term in the above sum
(drop the k-index for the moment)

ˆ d2 X d2 Y
∆ (X(x)Y (y)) = Y +X 2 =0
dx2 dy

or

1 d2 X 1 d2 Y
= − = −λ2 (87)
X dx2 Y dy 2

Now
Y (y) ∝ e−λy

59
thus λ > 0. Next,
X(x) ∝ sin (λx)

and from X(1) = 0


λn = nπ , n = 1, 2, . . .

To get coefficients in eq. (86) consider y = 0:


X
V = an sin (λn x)
n

multiply by sin (λm x) and integrate. From orthogonality (HW - check!)


Z 1
an = 2V sin(nπx)dx
0

which is 4V /(πn) for n odd and 0 for n even (HW - check). Thus,

4V X 1
V (x, y) = exp {−(2k + 1)πy} sin {(2k + 1)πx} (88)
π k=0 2k + 1

This is a formally exact solution. In practice need to know, how many terms contribute?
The extereme is k = 0 with

4V
V (x, y) ' exp {−πy} sin {πx} y → ∞
π

More general, suppose we fix the desired relative accuracy, ². Then,

ln(1/²)
n∼
πy

this is weakly sensitive to ², and because of π gives a small n for finite y. Thus, for y & 1 the
leading asymptote is an excellent approximation. But what about y → 0? Need an infinite
number of terms! Any program, including Mathematica, will fail. What to do? Rearrange!

4V X 1
V (x, y) = V + [exp {−(2k + 1)πy} − 1] sin {(2k + 1)πx} (89)
π k 2k + 1
(HW - check that the part of the sum with −1 indeed cancels V ). With just a few k this
should give a good approximation for small y.
HW: write a Fourier series if the stripe is replaced by a finite rectangle with the same zero
potential on the upper side as on the vertical sides. Explore the limits of a ”tall” and ”short”
rectangle.

60
B. Edge

Expand eq. (88) to obtain


X
V (x, y) ' V − 4V y sin {(2k + 1)πx} (90)
k

After summation: · ¸
2y
V (x, y) ' V 1 − , y→0 (91)
sin(πx)
HW: check this (Mathematica is fine)

C. Corner

Hard to get from a series; better start again:

∆V = 0

Look for V = V (r, θ), but no length scale!!!. Thus,

V = V (θ)

Now use
1 d2 V
∆V (θ) = =0
r2 dθ2
or (with BC)
2V ³ π ´
V (θ) = −θ
π 2
In cartesian coordinates (since we use them elsewhere)
2V ³ π y ´ 2V x
V (x, y) ∼ − arctan = arctan (92)
π 2 x π y
For small x this is consistent with the edge expression, which is valid however only for x À y.

D. Relaxation method

In class. See 788− relax.pdf .

E. Project: Relation to complex variables - 2D only!

This is not in Jackson, but allows to solve his problem analytically

61
1. Cauchy-Riemann conditions

If

f (z) = u(x, y) + i v(x, y) (93)

then for the limit


f (z + ∆ z) − f (z)
lim
∆ z →0 ∆z
to be independent of the direction of ∆ z:
∂ ∂ ∂ ∂
u= v, u=− v (94)
∂x ∂y ∂y ∂x
Thus,

∆u = ∆v = 0 (95)

2. Complex potential

We used
ˆ ×E
∇ ~ =0

to introduce V~ = −∇Φ.
ˆ Another condition (with no charges)

ˆ ·E
∇ ~ =0 (96)

~ with
Thus, one can introduce A

~ =∇
E ˆ ×A
~ (97)

~ -for which it is much


(Note: In ch. 6 Jackson does something similar with magnetic field B
more meaningful since ∇ˆ · B is always zero).
~ is not a big help, but if one has a 2D field E(x,
For a 3D space this A ~ y) one can select
~ y) in the z-directions so that
A(x,
∂ ∂ ∂ ∂
Ex = A(x, y) = − Φ(x, y) , Ey = − A(x, y) = − Φ(x, y)
∂y ∂x ∂x ∂y
Comapare this with Cauchy-Riemann! In other words,

φ = Φ − iA (98)

62
is an analytic function of z = x + iy.
~ for a uninform field
HW: Construct A
HW: Show that dφ/dz = −Ex + iEy . Note that you can take the derivative in any convenient
direction, e,g, x or y since w is analytic.
Equation for a field line now reads

dx/Ex = dy/Ey

or

∂ ∂
dx A(x, y) + dy A(x, y) ≡ dA = 0 (99)
∂x ∂y

In other words elctric field lines correspond to −Im[φ] = const and are just as easy to plot
as equipotential surfaces Re[φ] = const.
HW: Plot lines of Re[φ] = const and −Im[φ] = const for (a) φ = z and (b) φ = − ln z. To
which electric fields they correspond?)
READING: (optional) more general features are in Landau-Lifshits, vol.8, Ch. 1.3 and many
practical examples of conformal mapping, both with and without electrostatic context, are in
Kreyszig, Advanced Ehngineering Mathematics

3. Conformal mapping and solution of the problem

Returning to our problem we need the following:

• find a function w(z) which mapps the stripe to a simpler shape with ”good” boundary
conditions (in our case it will be a right angle with potenatial V on one side and 0 on
the other) - see Fig. 23.

• solve the problem, obtainig φ(w) (note: any analytical function φ(w) will satisfy the
Laplace equation, but the proper one will also satisfy boundary conditions. (in our
case we already solved the problem for the angle, so expect φ ∝ θ = −i ln(w)

• the function
φ (w(z))

will be the solution of the problem.

63
4

4 2
1
3
0.8

2 0.6 1
0.4
1
0.2

-1 -0.5 0.5 1 1.5 2 -1.5 -1 -0.5 0.5 1 1.5 -1 -0.5 0.5 1 1.5 2 2.5

FIG. 23: Transformation from a semi-infite stripe in the z-plane to an angle in the w-plane via an
intermediate semi-circle in the Z-plane. Colors track each side of the stripe. The functions are:
Z(z) = eiπz and w(Z) = (1 + Z)/(1 − Z). Direct conversion from stripe to corner is achieved by
w (Z(z)) = (1 + exp(iπz)) / (1 − exp(iπz)) = i cot(πz/2) - see stripe.nb

0.8

0.6

0.4

0.2

0
0 0.2 0.4 0.6 0.8 1

FIG. 24: Equipotential surfaces (red) and field lines (blue) for a stripe (semi-infinite in y-direction)

For the corner we have


2V
φ=− i ln(w) (100)
π
Thus, in original variables
2V ³ πz ´
φ = − i ln i cot (101)
π 2
which gives Fig. 24.
(THE REST WILL BE DISCUSSED IN CLASS)

64
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 11th Lecture

XXIV. SCHRÖDINGER EQUATION

Steady-state: Ψ = Ψ (~r)
~2
− ∆Ψ + V Ψ = EΨ (102)
2m
Several formulations:

• E − V (∞) > 0 - scattering

• E − V (∞) < 0 - eigenstates

• V (~r) periodic - bands

A. 1D - analytic

In 1D eq. (102) is ODE.

1. Resonant levels

Consider two δ-shaped barriers at x = 0 and x = a = 1 from each other. Outside of the
barriers solutions are
exp (±ikx)

with k = 2mE/~. Barriers determine the discontinuity in 1st derivative.
Look for
ψ1 = exp (+ikx) + b exp (−ikx) , x < 0

ψ2 = c exp (+ikx) + d exp (−ikx) , 0 < x < a

ψ3 = f exp (+ikx) , x > a

For a = 1 and
ψ10 (0) = −ωψ1 (0) + ψ20 (0)

ψ20 (1) = −ωψ2 (1) + ψ30 (1)

one obtains an explicit solution. See Mathematica plot for |f |2 .

65
1.0

0.8

0.6

0.4

0.2

0 2 4 6 8 10

FIG. 25: Transmission coefficient |f |2 through a pair of δ-barriers as a function of k (blue). Di-
mensionless ”non-transparency” of a single barrier is ω = 20. Red line is |f |2 + |b|2 = 1.

2. Energy levels: WKB approximation

p(x) -classical I
S≡ pdx = 2π~ (n + γ) , n = 0, 1, 2, . . .

γ - depends on BC; γ = 1/2 for smooth BC (follows from Airy function matching).
Mathematica realization:
1) calculate S for any energy
2) approximate S(E) by a polynomial
3) solve for WKB condition (integer n), get En
(see the printout)

3. Bands

ψ (~r) = ei~q~r uq~ (~r) , uq~ (~r + ~a) = uq~ (~r)

(Bloch, 1929).

66
0 5
80
80

60
60

40 40

20 20

-7.5 -5 -2.5 2.5 5 7.5 -7.5 -5 -2.5 2.5 5 7.5


10 20

80 80

60 60

40 40

20 20

-7.5 -5 -2.5 2.5 5 7.5 -7.5 -5 -2.5 2.5 5 7.5

FIG. 26: Energy bands for the ”Dirac comb” (Kronig-Penney model) for different values of the
interaction potential.

B. Dirac comb


~2 X
U (x) = Ω δ (x − na)
m n=−∞
Let a = 1. Look for
φ1 (x) = Aeikx + Be−ikx

and
φ2 (x) = eiq φ1 (x − 1)

Have 2 conditions(BC) at x = 1, thus 2 homogeneous equations for A, B. Non-trivial


solutions for
sin k
cos q = cos k + ω
k
See Mathematica printout (Kronig.nb)
This determines bands in ² ≡ ~2 k 2 /2m as a function of q - see Fig. 26.

67
C. Numerical - matrix

Use discrete representation of d2 /dx2 . Construct a matrix ham, discrete analog of Ĥ.
Eigenvalues of this matrix are close to true eigenvalues. See the Mathematica printout for
examples of harmonic potential and box.
Project: try to improve accuracy by using WKB BC; check for harmonic oscillator

D. Numerical - shooting

Idea: select a WKB BC (in ”forbidden region x ¿ −1”). For a selected E integrate the
SE to get ψ(x). For almost any E will have a diverging ψ (x → ∞) = ∞. ”Magic” E will
correspond to small ψ (x → ∞).
Exremely accurate, if know where to look for. [If don’t know -start from a WKB guess
of En .

E. Numerics - variational

Key: select a good (intuitive!) trial function with several parameters. Then, the ”average
energy” Z ∞
ψ ∗ Ĥψdx
−∞

will have an extremum (min or max). This gives an equation for parameters, and will
approximate the eigenfunction. The above integral will then approximate the energy.
We first try for a HO. A trial function

exp −ax2
¡ ¢

will result in a correct a = 1/2. Then, we try a ”bad” function for a box: instead of ısin,
use polynomial.
For lowest level - usually extremely accurate. For higher levels a good guess is extremely
important, otherwise many parameters.

68
F. Variational - 3D

Yukawa potential
1
U (r) = − e−r/a
r
see the Mathematica printout - file yukawa.nb
Project: Study the hydrogen atom; using the variational method and exact; compare

XXV. MONTE CARLO INTEGRATION

file MonteCarlo.nb
When to use?

• d≥2

• complicated (”bad”) boundary

• more-or-less smooth integrand (no peaks in small areas)

• not too high accuracy is ok

Note, sometimes you may have a ”good” boundary but a ”bad” integrand. If change of
variables can reverse this, MC will work much better.
Ideas of MC - see Fig. 27. We want to find an area under the black arc (semicircle in
this case) and to locate its center of gravity. Steps:

• surround by a simple boundary (blue box)

• define functions ”ar” (area) and ”mom” (moment) with zero initial value

• generate N points inside the box randomly

• if a points falls under the arc, increase ”ar” and ”mom” accordingly

• calculate averages ar/N , mom/N



Error decays as 1/ N - not too fast, but algorithm is very simple.

69
1

0.8

0.6

0.4

0.2

-1 -0.5 0.5 1

FIG. 27: Ideas of Monte Carlo integration

FIG. 28: An example of random path. Obviously, not the best.

XXVI. SIMULATED ANNEALING

µ ¶
E
prob(E) ∝ exp −
kB T

A. Travelling salesman problem

(will be discussed in class)

70
FIG. 29: The best path. Can be found exactly for N . 10, but otherwise one needs simulated
annealing.

3000

2500

2000

1500

1000

500

10 20 30 40

FIG. 30: Statistics of path lengths. Obviously, non-Gaussian.

XXVII. NON-EQUILIBRIUM ISING MODEL

A. Overview

1. Definitions

X X
0
H = −J si sk − H si , si = ±1 (103)
i,k i

J > 0 - ferromagnet.
Equilibrium: H = 0. Model exactly solvable for square lattice (λ = 4), triagonal (λ = 6)
and hexagonal (λ = 3), where λ is the number of nearest neighbors (NN).

71
t = 0 : si = −1 , 0 < H < λ (metastability)

2. Dynamics

Probability of a spin flip (Glauber/Metropolis):

1 1
Pi→f = or
exp [(Hf − Hi ) /kb T ] + 1 max {exp [(Hf − Hi ) /kb T ] , 1}

Alternative: Kawasaki dynamics (will not be used). Spin cannot flip but can exchange
places with NN (diffusion).

3. Equivalence to a lattice gas

(Here we discuss square lattice only). Let only up-spins interact with each other (NN
only) with ”bond energy” φ. There is no interaction between up-down and down-down
spins. Then treat down spins as background, individual up spins as ”gas molecules” which
can condense into a ”liquid”.
Input parameters are φ and µ. Gas and liquid are at equilibrium for ”chemical potential”

µ = µ0 = −2φ

Otherwise gas will condense for µ > µ0 .


If
φ = 4J

the thermodynamics of the equilibrium lattice gas and of the Ising ferromagnet will be the
same. Furthermore, for ”supersaturation”

µ − µ0 H
S= ⇐⇒ (104)
2φ φ

the metastable behavior (and dynamics) will be equivalent as well.

B. Equilibrium (some analytics)

We use kB = 1. Temperature is measured in units of J (i.e. J = 1).

72
k
1.2

0.8

0.6

0.4

0.2

T
0.5 1 1.5 2

FIG. 31: The parameter k(T ). k = 1 corresponds to the critical temperature, T c . Note that the
curve is very flat at T . 0.5.

Main parameter (instead of temperature)

k(T ) = sinh (2/T )−2

see Fig. 31. Critical temperature:


k (Tc ) = 1
2
Tc = ¡√ ¢ = 2.26919...
ln 2 + 1
HW: show or check this.
Free energy (per spin):
π
T
Z
f (T ) = − F (k, θ)dθ (105)
2π 0

with
1 1√
½ · ¸¾
F (T, θ) = ln 2 1 + + 2
1 + k − 2k cos 2θ
k k
Energy (per spin):
d(f /T ) d(f /T ) dk
E= =
d(1/T ) dk d(1/T )
Thus, with
∂F (k, θ)
e=
∂k

π
dk 1
Z
E=− e(k, θ)dθ
d(1/T ) 2π 0

From
f = E − Ts

73
E,f
T
1 2 3 4

-0.5

-1

-1.5

-2

-2.5

FIG. 32: Energy (blue) and free energy (red) per spin.

c specific heat

2.5

1.5

0.5

T
0.5 1.5 2 2.5

FIG. 33: ”lambda point” of specific heat

energy and free energy should close at low temperature (small entropy), but E gets larger
when Tc is approached -see Fig. 32.
Specific heat:
dE
cV =
dT
There is a ”lambda-point” (logarithmic singularity) near Tc - see Fig. 33.
Magnetization:
¢1/8
m(T ) = 1 − k 2
¡

Note a very small power (1/8) which makes the curve nearly vertical near Tc - see Fig. 34.

74
m magnetization
1

0.8

0.6

0.4

0.2

T
0.5 1 1.5 2 2.5 3

FIG. 34: Magnetization, m(T ). Note that m(T ) = 0 for T ≥ TC and that m is extremely close to
1 for T . 0.5TC

surface tension
3

2.5

1.5

0.5

T
0.5 1 1.5 2

FIG. 35: The reduced interfacial tension σ in the directions parallel to the lattice (red) and diagonal
(blue). The critical temperature is Tc = 2.269 . . . (this corresponds to J = 1). Note that above
∼ 0.5 Tc there is practically no anizotropy.

1. Interfacial tension

According to Onsager - see Fig. 37 :

σ|| /J = 2 + T /J ln [tanh(J/T )] (106)


σdiag /J = 2(T /J) ln [sinh(2J/T )] (107)

With no anizotropy (higher T < Tc ) a ”droplet” will be practically round with radius R

πR2 ' n

75
n - number of spins. The interfacial energy is given by

2πRσef f (108)

where any of the two values of σ (parallel or diagonal) can be used for σef f .
At higher temperatures one can use the Wulff construction to find the shape of a droplet
- this was done in early 80’s by Rottman and Wortis and by Zia and Avron. The interfacial
energy also can be calculated and used to define σef f . Form results of Zia and Avron one
can obtain - see J. Chem.Phys., 111, 6932 (1999)
sZ
t
2T
σef f = √ dt [1 − q(t)] ∗ K [1 − m(t)] (109)
π tc

with t ≡ 4J/T , K - the elliptic integral, and

3 − e−t cosh t − 1
q(t) = , m(t) = 8 (110)
sinh t (cosh t + 1)2

This is shown by a black line in Fig. 37.

C. Non-equilibrium: simulations

Will be discussed in class.


==============================

76
1000 1000

800 800

600 600

400 400

200 200

0 0
0 200 400 600 800 1000 0 200 400 600 800 1000
1000 1000

800 800

600 600

400 400

200 200

0 0
0 200 400 600 800 1000 0 200 400 600 800 1000

FIG. 36: Patterns of spins in the Ising model slighly above Tc ' 2.269 . . . (top left, T = 2.4) and
below Tc at T = 2.1 at different times t = 3 (top right), t = 13 (lower left) and t = 130 (lower
right).

77
1000 1000

800 800

600 600

400 400

200 200

0 0
0 200 400 600 800 1000 0 200 400 600 800 1000

FIG. 37: Same, but at colder temperature T = 1.1.

78

You might also like