Notes 788
Notes 788
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
III. Introduction 4
V. Airy functions 8
0
IX. Orthogonal Polynomials 17
A. Examples 18
III Diffusion
1
XIV. Diffusion in free space for D = 1, 2, 3 41
XVI. Project 1 46
XVIII. Time-dependent, d = 2 48
2
G. Analytics: Quasi-steady-state 53
1. The thin-wall approximation 53
2. Thick wall 53
H. Numerical 54
3
XXV. Monte Carlo integration 69
4
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 1st Lecture
Part I
Introduction
I. PHYSICS, ANALYTICS AND COMPUTATIONS
• Computations: ρ1 , ρ2 , . . . ∼ 1
ρ ∼ 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.
• 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
Consider
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
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
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)
Part II
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
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
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
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.
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)
√
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?]
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.
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)
2√
· ¸
C1
u1 (x) ' √ exp − F (a − x)3/2 (20)
F (a − x)1/4 3~
1
u00xx + F (x − a)u = 0 (21)
~2
F 1/3
z= (x − a)
~2/3
one gets
u00zz + zu = 0 (22)
with a solution
(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
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
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
12
inerfcHzL
2.0
1.5
1.0
0.5
z
-2 -1 0 1 2
wronsk[Cos[x], Sin[x]]
wronsk[E x , E (−x) ]
wronsk[AiryAi[x], AiryBi[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
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.
4π 2
W (R) = 4πR2 σ − n (µ1 − µ2 ) , W∗ = R σ
3 ∗
β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:
dfn
= jn − jn+1 , jn = βn−1 fn−1 − αn fn
dt
¯
β 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∗ ]
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:
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
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
β∗ =
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)
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
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
-0.5
-1.0
First 5:
1
x
2x2 − 1
4x3 − 3x
8x4 − 8x2 + 1
16x5 − 20x3 + 5x
1.0
0.5
-0.5
-1.0
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)
0.000015
0.00001
5. ´ 10-6
-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
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
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:
• Laplace equation
∆φ = 0
• 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
∆Φ + 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
d2 Φ 1 dΦ
∆Φ(r) = +
dr2 r dR
typical Bessel.
On the o.h., for d = 3 the angular part leads to Legendre polynomials.
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
25
Why logarithmic singularity? - from Wronskian!
(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)
J00 = −J1
. Another relation is Z x
−n
Jn (x) = x z n Jn−1 (z)dz (49)
D. Fraunhofer diffraction
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
~ =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 α
2π
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
2π
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).
1. examine the vibration eigenmodes of a circular membrane; see figures below, and the
788− BesselDrum.nb; some physics will be discussed in class
3. study the spherical Bessel functions, Jn+1/2 , etc., and consider a quantum particle in
a spherical box.]
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,
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
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
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
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)
<<”Calculus‘VectorAnalysis‘”
(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:
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).
dφ dK0 (kr)
j = −D = −c2
dr dr
J(r) = 2πrj(r)
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.
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
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
kdP1 (cos θ)
φ≈
r2
(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.
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
C. Relation to Laplacian
ˆ 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
[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
-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
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
rn Pn (cos θ)
is the solution of the Laplce equation for any n. From the recurrence relations
Thus
∞ ½ ¾
X
n Pn (cos θ)
V (r, θ) = an r Pn (cos θ) + bn
rn+1
n=0
Thus,
a1 = −E0 , an = 0 for n 6= 1
2nd BC:
V (r = R) = 0
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
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
3κ2 κ1 − κ2
Ain
1 =− E0 , B1out =
2κ2 + κ1 κ1 + 2κ2
37
2 2 2
1 1 1
-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
-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
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
39
0.1
0.08
0.06
0.04
0.02
FIG. 18: Non-biased random walk (points) and the diffusion approximation
0.1
0.08
0.06
0.04
0.02
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
r2
· ¸
1
G[r, t] = exp −
{4πt}d/2 4t
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
41
1
0.8
0.6
0.4
0.2
-4 -2 2 4
A. Free boundaries
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
3. semi-infinite: absorbing
c(0, t) = c(l, t) = 0
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 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
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
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
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)
∆c = 0
46
A. d=1
B. d=2
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
47
C. d=3
¡ 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
Look for
u(r) exp −λ2 t
¡ ¢
with
1 0
(ru0 ) + λ2 u = 0 (67)
r
with solution
J0 (λr)
J0 (λ) = 0
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
2
bn =
λn J1 (λn )
see the Mathematica handout with graphics and the Bessel package.
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)
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.
C. Mathematical formulation
D. Diffusion in iron
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
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
¯
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
52
G. Analytics: Quasi-steady-state
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
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
∂χ ∂2χ
= 2 (77)
∂t ∂r
χ(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)
(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
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
Let
c(0) = c0 , c(l) = 0
From BC at x = 0:
B = D0 [c0 + F (c0 )]
z − 1 + 1/2 · az 2
= −y
1 + a/2
55
XXII. NUMERICAL SOLUTIONS
∂ 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
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)
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!
57
Thus,
³ ´−1
~c(t + dt) = M̂−r · ~c(t)
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
• 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
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)
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 → ∞
π
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
After summation: · ¸
2y
V (x, y) ' V 1 − , y→0 (91)
sin(πx)
HW: check this (Mathematica is fine)
C. Corner
∆V = 0
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
61
1. Cauchy-Riemann conditions
If
∆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)
φ = Φ − 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
• 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))
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)
64
Dr. Vitaly A. Shneidman, Phys/MtSE 788, 11th Lecture
Steady-state: Ψ = Ψ (~r)
~2
− ∆Ψ + V Ψ = EΨ (102)
2m
Several formulations:
A. 1D - analytic
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
For a = 1 and
ψ10 (0) = −ωψ1 (0) + ψ20 (0)
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.
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
(Bloch, 1929).
66
0 5
80
80
60
60
40 40
20 20
80 80
60 60
40 40
20 20
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)
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
file MonteCarlo.nb
When to use?
• d≥2
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:
• define functions ”ar” (area) and ”mom” (moment) with zero initial value
• if a points falls under the arc, increase ”ar” and ”mom” accordingly
69
1
0.8
0.6
0.4
0.2
-1 -0.5 0.5 1
µ ¶
E
prob(E) ∝ exp −
kB T
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
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
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).
(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φ
the thermodynamics of the equilibrium lattice gas and of the Ising ferromagnet will be the
same. Furthermore, for ”supersaturation”
µ − µ0 H
S= ⇐⇒ (104)
2φ φ
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.
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
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
√
σ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
3 − e−t cosh t − 1
q(t) = , m(t) = 8 (110)
sinh t (cosh t + 1)2
C. Non-equilibrium: simulations
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
78