computational physics problem solving with computers wiley
TRANSCRIPT
Computational Physics
Problem Solving with
Computers
Wiley: 2005 2nd Ed
RUBIN H. LANDAU
Oregon State University
MANUEL JOSE PAEZ MEJI A
University of Antioquia
November 2, 2004
1
5. Deterministic Randomness
Random r1, r2, . . . no correlations
0 50 100 150 200 250x
0
50
100
150
200
250
y
0 50 100 150 200 250x
(Left) “bad” generator; (right) drand48
-Random-Number Generators
linear congruent, power residue method
ridef= remainder
(a ri−1 + c
M
).
E.G.: c = 1, a = 4, M = 9
drand48: M = 248, c = B16a =
5DEECE66D16
2
5.2 Problem: A Random Walk: R �√N
N
R
1
23
4
−30 −20 −10 0 10x
−20
−10
0
10
y
0.0 100.0 200.0 300.0N
0.0
100.0
200.0
300.0
Rtheory
simulationstartfinish
(Left) simulated walk; (right) distance
versus N steps
3
6. MC Applications
Radioactive, Spontaneous Decay
0.0 200.0 400.0 600.0 800.0 1000.0 1200.0time
0.0
1.0
2.0
3.0
4.0
5.0lo
g (
N)
N0 =10
N0 =100
N0 =1000
N0 =10000
N0 =100000
exponential stochastic
Input N(0), λ N = Nleft = N(0) InitializeDo till Nleft = 0 all gone
Do for N 1 period0 ≤ r ≤ 1 random #if r ≤ λ, Nleft = Nleft -1 ALGORITHM
Endoprint N, λ*(N-Nleft)N = NleftEndo
4
Rejection Integration
Stone Throwing
von Neumann Weighted Random
Pond
Npond
Npond + Nbox=
Apond
Abox
10-D Integration
I =∫ 1
0dx1 · · ·
∫ 1
0dx10 (x1 + · · · + x10)
2 = 1556
5
24 Fractals
Problem: Fractal Dimensions
Not simple geometric shapes, simple math-
ematical rules: plants, sea shells, poly-
mers, thin films, colloids, and aerosols
15,000 pts Sierpinski gasket, df � 1.585
Hausdorf dimension DH: OK; 1D, 2D,
3D:
M(L)def= ALdf .
6
Self-Affine Connection of Points
(x′, y′) = s(x, y) scaling,
(x′, y′) = (x, y) + (ax, ay), translation,
x′ = x cos θ − y sin θ, rotation
y′ = x sin θ + y cos θ
⇒ self-similar
child : parent :: parent: ancestors
All scales
7
Problem 2: Barnsley’s Fern
Random, beauty, similarity, symmetry
30,000 iterations; each frond similar
(x, y)n+1 =
(0.5,0.27yn),
(−0.139xn + 0.263yn + 0.57
0.246xn + 0.224yn − 0.036), ,
(0.17xn − 0.215yn + 0.408
0.222xn + 0.176yn + 0.0893),
(0.781xn + 0.034yn + 0.1075
−0.032xn + 0.739yn + 0.27),
P =
2%, if r < 0.02,
15%, if 0.02 ≤ r ≤ 0.17,
13%, if 0.17 < r ≤ 0.3,
70%, if 0.3 < r < 1.
8
Problem 3: Ballistic Deposition
Thermal evaporate particles (random),deposit on surface film. <Height>∝ T ,surface = fractal
0.0 50.0 100.0 150.0 200.00.0
50.0
100.0
150.0
200.0
250.0
20,000 particles
Random v ⇒ random sites; sticks wherehit, fills holes:
1. Choose a random site r.
2. hr = height of at site r
3.hr =
{hr + 1, if hr ≥ hr−1, hr+1
max[hr−1, hr+1]
9
Prob 4: Length Coastline via df
r
L2r
Number boxes size r that covers object
N =L
r∝ 1
r∝ lim
r→0
1
rdf
df = limr→0
logN(r)
log(1/r).
0 20 40 60 80 1000
20
40
60
80
100
df = 1.23 via box counting
10
Problem 5: Correlated Growth, Forests
and Films
Plants: increased growth if others nearby;
deposition + P ∝ distance−2
d
particle i
particle i+1
11
Globular Cluster: Diffusion-Limited
Aggregation
1. seed in the middle
2. release second particle random lo-
cation on circle
3. random walk + discrete x/y jumps
(Brownian motion: diffusion)
4. step length: random Gaussian
5. particle stick to other is within 1
12
22 Quantum Monte Carlo:Feynman Path Integrals
Wavefunction ← Classical Trajectory
Hamilton’s principle of least action:
S[x(t)] =∫ tb
tadt [KE(x(t)) − PE(x(t))]
bxa
t a
t b
xx
B
A
t
Huygen’s wavelet principle
ψ(xb, tb) =∫
dxa G(xb, tb;xa, ta)ψ(xa, ta)
Feynman QM postulate: path integral
G(b, a) =∑
pathseiS[b,a]/h, S/h � ∞
13
0.0 4.0 8.0 12.0 t
−2.0
0.0
2.0
x(t
)
−2.0 −1.0 0.0 1.0 2.0 x
0
1000
2000
ψ2 (x
) (c
ount
s)
Long timeShort time
The ground-state wave function of the
harmonic oscillator as determined with
a path-integral calculation.
14