Professional Documents
Culture Documents
(Download PDF) Basic Concepts in Computational Physics 2Nd Edition Benjamin A Stickler Online Ebook All Chapter PDF
(Download PDF) Basic Concepts in Computational Physics 2Nd Edition Benjamin A Stickler Online Ebook All Chapter PDF
https://textbookfull.com/product/basic-concepts-of-inorganic-
chemistry-2nd-edition-d-n-singh/
https://textbookfull.com/product/basic-chemical-concepts-and-
tables-2nd-edition-steven-l-hoenig/
https://textbookfull.com/product/solid-state-physics-essential-
concepts-2nd-edition-david-w-snoke/
https://textbookfull.com/product/computational-methods-in-
physics-simon-sirca/
Computational Physics A Practical Introduction to
Computational Physics and Scientific Computing using C
Konstantinos N. Anagnostopoulos
https://textbookfull.com/product/computational-physics-a-
practical-introduction-to-computational-physics-and-scientific-
computing-using-c-konstantinos-n-anagnostopoulos/
https://textbookfull.com/product/theoretical-and-computational-
physics-of-gas-discharge-phenomena-a-mathematical-
introduction-2nd-edition-sergej-t-surzikov/
https://textbookfull.com/product/a-basic-course-in-probability-
theory-2nd-edition-rabi-bhattacharya/
https://textbookfull.com/product/basic-semiconductor-physics-3rd-
edition-chihiro-hamaguchi/
https://textbookfull.com/product/statistical-methods-an-
introduction-to-basic-statistical-concepts-and-analysis-2nd-
edition-cheryl-ann-willard/
Benjamin A. Stickler · Ewald Schachinger
Basic
Concepts in
Computational
Physics
Second Edition
Basic Concepts in Computational Physics
Benjamin A. Stickler • Ewald Schachinger
Basic Concepts
in Computational Physics
Second Edition
123
Benjamin A. Stickler Ewald Schachinger
Faculty of Physics Institute of Theoretical and Computational
University of Duisburg-Essen Physics
Duisburg Graz University of Technology
Germany Graz, Austria
Traditionally physics is divided into two fields of activities: theoretical and experi-
mental. As a consequence of the stunning increase in computer power and of the
development of more powerful numerical techniques, a new branch of physics
was established over the last decades: Computational Physics. This new branch
was introduced as a spin-off of what nowadays is commonly called computer
simulations. They play an increasingly important role in physics and in related
sciences as well as in industrial applications and serve two purposes, namely:
• Direct simulation of physical processes such as
ı Molecular dynamics or
ı Monte Carlo simulation of physical processes
• Solution of complex mathematical problems such as
ı Differential equations
ı Minimization problems
ı High-dimensional integrals or sums
This book addresses all these scenarios on a very basic level. It is addressed
to lecturers who will have to teach a basic course/basic courses in Computational
Physics or numerical methods and to students as a companion in their first steps into
the realm of this fascinating field of modern research. Following these intentions
this book was divided into two parts. Part I deals with deterministic methods in
Computational Physics. We discuss, in particular, numerical differentiation and
integration, the treatment of ordinary differential equations, and we present some
notes on the numerics of partial differential equations. Each section within this part
of the book is complemented by numerous applications. Part II of this book provides
an introduction to stochastic methods in Computational Physics. In particular, we
will examine how to generate random numbers following a given distribution,
summarize the basics of stochastics in order to establish the necessary background
to understand techniques like MARKOV-Chain Monte Carlo. Finally, algorithms of
stochastic optimization are discussed. Again, numerous examples out of physics like
v
vi Preface
diffusion processes or the POTTS model are investigated exhaustively. Finally, this
book contains an appendix that augments the main parts of the book with a detailed
discussion of supplementary topics.
This book is not meant to be just a collection of algorithms which can
immediately be applied to various problems which may arise in Computational
Physics. On the contrary, the scope of this book is to provide the reader with a
mathematically well-founded glance behind the scene of Computational Physics.
Thus, particular emphasis is on a clear analysis of the various topics and to even
provide in some cases the necessary means to understand the very background
of these methods. Although there is a barely comprehensible amount of excellent
literature on Computational Physics, most of these books seem to concentrate either
on deterministic methods or on stochastic methods. It is not our goal to compete with
these rather specific works. On the contrary, it is the particular focus of this book to
discuss deterministic methods on par with stochastic methods and to motivate these
methods by concrete examples out of physics and/or engineering.
Nevertheless, a certain overlap with existing literature was unavoidable and we
apologize if we were not able to cite appropriately all existing works which are of
importance and which influenced this book. However, we believe that by putting the
emphasis on an exact mathematical analysis of both, deterministic and stochastic
methods, we created a stimulating presentation of the basic concepts applied in
Computational Physics.
If we assume two basic courses in Computational Physics to be part of the cur-
riculum, nicknamed here Computational Physics 101 and Computational Physics
102, then we would like to suggest to present/study the various topics of this book
according to the following syllabus:
• Computational Physics 101:
– Chapter 1: Some Basic Remarks
– Chapter 2: Numerical Differentiation
– Chapter 3: Numerical Integration
– Chapter 4: The KEPLER Problem
– Chapter 5: Ordinary Differential Equations: Initial Value Problems
– Chapter 6: The Double Pendulum
– Chapter 7: Molecular Dynamics
– Chapter 8: Numerics of Ordinary Differential Equations: Boundary Value
Problems
– Chapter 9: The One-Dimensional Stationary Heat Equation
– Chapter 10: The One-Dimensional Stationary SCHRÖDINGER Equation
– Chapter 12: Pseudo-random Number Generators
• Computational Physics 102:
– Chapter 11: Partial Differential Equations
– Chapter 13: Random Sampling Methods
– Chapter 14: A Brief Introduction to Monte Carlo Methods
– Chapter 15: The ISING Model
Preface vii
The authors are grateful to Profs. Dr. C. Lang and Dr. C. Gattringer (Karl-Franzens
Universität, Graz, Austria) and to Profs. Dr. W. von der Linden, Dr. H.-G. Evertz,
and Dr. H. Sormann (Graz University of Technology, Austria). They inspired this
book with their lectures on various topics of Computational Physics, computer sim-
ulation, and numerical analysis. Last but not least, the authors thank Dr. Chris Theis
(CERN) for meticulously reading the manuscript, for pointing out inconsistencies,
and for suggestions to improve the text.
ix
Contents
xi
xii Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 137
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 137
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 138
10 The One-Dimensional Stationary SCHRÖDINGER
Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 139
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 139
10.2 A Simple Example: The Particle in a Box . . . . . .. . . . . . . . . . . . . . . . . . . . 143
10.3 Numerical Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 147
10.4 Another Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 151
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 155
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 155
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 155
11 Partial Differential Equations . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 157
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 157
11.2 The POISSON Equation . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 158
11.3 The Time-Dependent Heat Equation .. . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 163
11.4 The Wave Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 167
11.5 The Time-Dependent SCHRÖDINGER Equation .. . . . . . . . . . . . . . . . . . . 170
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 178
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 179
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 179
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 222
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 223
15 The ISING Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 225
15.1 The Model .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 225
15.2 Numerics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 236
15.3 Selected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 240
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 245
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 245
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 246
16 Some Basics of Stochastic Processes . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 247
16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 247
16.2 Stochastic Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 248
16.3 MARKOV Processes .. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 251
16.4 MARKOV-Chains. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 259
16.5 Continuous-Time MARKOV-Chains . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 266
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 268
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 269
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 269
17 The Random Walk and Diffusion Theory . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 271
17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 271
17.2 The Random Walk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 273
17.3 The WIENER Process and Brownian Motion . . .. . . . . . . . . . . . . . . . . . . . 279
17.4 Generalized Diffusion Models . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 285
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 293
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 294
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 294
18 MARKOV-Chain Monte Carlo and the POTTS Model . . . . . . . . . . . . . . . . . 297
18.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 297
18.2 MARKOV-Chain Monte Carlo Methods . . . . . . . .. . . . . . . . . . . . . . . . . . . . 298
18.3 The POTTS Model.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 302
18.4 Advanced Algorithms for the POTTS Model . . .. . . . . . . . . . . . . . . . . . . . 306
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 308
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 309
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 309
19 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 311
19.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 311
19.2 Calculation of Errors .. . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 311
19.3 Auto-Correlations .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 315
19.4 The Histogram Technique . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 319
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 320
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 321
References .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 321
Contents xv
Index . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 401
Chapter 1
Some Basic Remarks
1.1 Motivation
which, for instance, may occur when it is required to calculate the probability that
an event following a normal distribution takes on a value within the interval Œa; b,
where a; b 2 R. In contrast to the much simpler integral
Z b
dx exp .x/ D exp .b/ exp .a/ ; (1.2)
a
simple at first glance may need a closer inspection when a numerical estimate
for the expression is required. In fact, most numerical methods we will encounter
within this book have been designed before the invention of modern computers or
calculators. However, the applicability of these methods has increased and is still
increasing drastically with the development of even more powerful machines. We
give another example, namely the oscillation of a pendulum. We know from basic
mechanics [4–8] that the time evolution of a frictionless pendulum of mass m and
length ` in a gravitational field is modeled by the differential equation
g
R C sin ./ D 0 : (1.3)
`
The solution of this equation describes the oscillatory motion of the pendulum
around the origin O within a two-dimensional plane (Fig. 1.1). Here is the angular
displacement and g is the acceleration due to gravity. Furthermore, a common
situation is described by initial conditions of the form:
(
.0/ D 0 ;
(1.4)
P
.0/ D0:
For small initial angular displacements, 0 1, we set in Eq. (1.3) sin ./
and obtain the differential equation of the harmonic oscillator:
g
R C D 0 : (1.5)
`
Together with the initial conditions (1.4) we arrive at the solution
p
with ! D g=`. The period of the pendulum follows immediately:
s
`
D 2 : (1.7)
g
1 2 1
ED mv C mg` Œ1 cos ./ D mv02 C mg` Œ1 cos .0 / : (1.8)
2 2
Here v is the velocity of the point mass m and v0 and 0 are defined by the initial
P
conditions (1.4). Since .0/ D 0 we have
where we made use of the relation: 1 cos.x/ D 2 sin2 .x=2/. We use this result in
Eq. (1.8) and arrive at:
1 2 0
v D 2g` sin2 sin2 : (1.10)
2 2 2
Since v 2 D `2 P 2 we have
r s
P g 2 0 2
D2 sin sin : (1.11)
` 2 2
with k D sin .0 =2/ : For t D we have D 0 and we obtain for the period
s Z
2 ` 0 d'
D q : (1.13)
k g 0 1 k12 sin2 '2
Chapter 2
Numerical Differentiation
2.1 Introduction
This chapter is the first of two systematic introductions to the numerical treatment
of differential equations. Differential equations and, thus, derivatives and integrals
are of eminent importance in the modern formulation of natural sciences and
in particular of physics. Very often the complexity of the expressions involved
does not allow an analytical approach, although modern symbolic software can
ease a physicists life significantly. Thus, in many cases a numerical treatment is
unavoidable and one should be prepared.
We introduce here the notion of finite differences as a basic concept of numerical
differentiation [1–3]. In contrast, the next chapter will deal with the concepts
of numerical quadrature. Together, these two chapters will set the stage for a
comprehensive discussion of algorithms designed to solve numerically differential
equations. In particular, the solution of ordinary differential equations will always
be based on an integration.
This chapter is composed of four sections. The first repeats some basic concepts
of calculus and introduces formally finite differences. The second formulates
approximates to derivatives based on finite differences, while the third section
includes a more systematic approach based on an operator technique. It allows
an arbitrarily close approximation of derivatives with the advantage that the
expressions discussed in this section can immediately be applied to the problems
at hand. The chapter is concluded with a discussion of some additional aspects.
Illustrator: L. J. Bridgman
Language: English
BY AMY E. BLANCHARD
Illustrated by
L. J. BRIDGMAN
BOSTON
DANA ESTES & COMPANY
PUBLISHERS
Copyright, 1909
By Dana Estes & Company
"I seem to have made an impression," she said as her aunt came up.
"I didn't know strangers were such a rarity here that people stared at
them the way that man did at me. I wonder who he is and what made
him look so taken by surprise."
"Oh, I suppose he didn't know that any of the summer residents had
arrived," returned Miss Elliott, "and he wondered who you were and
where you came from. There aren't usually any summer visitors here
before the middle of June."
"I suppose that must have been it," returned Gwen, at the same time
feeling that it did not quite explain matters.
At the side door, by which it seemed they were expected to enter,
they met Ora. She turned away her head and hurried around to the
kitchen.
"What a pretty girl," said Gwen, looking after her. "Such a lovely
complexion. But, oh dear, why does she lace so painfully? Doesn't
she know wasp waists are all out of style? That they belong to the
early Victorian age and passed out with ringlets and high
foreheads?"
"She probably doesn't know," returned Miss Elliott. "I notice that
many of the girls up here still cling to the traditions of their
grandmothers in more than one direction. I have heard that one, at
least, died from the effects of tight lacing."
"Then they need a missionary as much as the heathen Chinee
does," observed Gwen as she entered the house.
She had gone out bareheaded but she tossed aside the golf-cape,
which was none too warm for out-door wear, and sat down by the
window. Miss Phenie, established in a comfortable rocking-chair,
was quite ready for a chat while she knitted a "sweaterette" as she
called it. Miss Phosie was in the kitchen getting supper, but Miss
Phenie felt that it was due to her position as elder sister to entertain
the guests rather than to give a hand to the evening's work. It was
always her attitude and one of which no one had ever heard Miss
Phosie complain. The most that she had ever done was to remark to
Almira Green: "It's very easy to be hospitable when you do the
entertaining and some one else does the work." But that was under
great provocation when the minister, the surveyor, the doctor and the
editor of The Zephyr had all arrived on the island in one day and all
had been entertained at Cap'n Ben's house because there seemed
nowhere else for them to go. On that occasion Miss Phenie, as
usual, had asserted her right to the position of hostess, and had left
Miss Phosie alone to wash the dishes as well as to get the dinner,
Ora having gone to Portland for the day.
"Well," said Almira Green to whom Miss Phosie's remark was made,
"there was Cap'n Ben to do the talking, and as they was all men I
don't see why Phenie was called upon to set with them all the time."
"I guess she thought she had to," Miss Phosie had returned with the
feeling that perhaps she had said too much.
To-day, however, there was not much reason for Miss Phenie's
presence in the kitchen, for, while Miss Phosie made the soda
biscuits Ora could be setting the table. The lobsters had been boiled
that morning, so there were only the fish and potatoes to fry, and the
preserves to be set on the table with the cake. Miss Phenie, in tight
fitting black alpaca, rocked comfortably and asked questions till
Gwen, by the window, saw Luther Williams pass. "Who is that, Miss
Phenie?" she asked. "That tall man with the serious face and the
kind eyes?"
"I guess you mean Mr. Williams. I presume he is taking his after
supper smoke. He boards with us, you know."
"Oh!" Gwen wondered why he had not appeared at the table. "Is he
a relative of yours?"
"None in the world, and we never heard that he had any. He gets a
daily paper and advertising letters sometimes, but I never knew him
to get any other mail. He's real well educated, and reads everything
he can lay his hands on, but he is a very quiet man. He never talks
much to anybody, but there ain't a kinder man living. If anybody's in
trouble he's the first on hand, and the first to put his hand in his
pocket."
"Is he a fisherman?"
"Yes. His pound is just off your point. He's been real lucky and it's
said he's right well off."
"Has he boarded with you long?"
"Ever since he came to the island; that's about twenty years now. He
came for a week's fishing, he said, and he's stayed ever since. I
never heard a word against Mr. Williams. Everybody likes him, and if
he is rather close-mouthed you don't hear him speak ill of anyone.