Computational Physics

(Rick Simeone) #1
568 Appendix A
approximants can be fitted to a polynomial and the value for this polynomial at
h = 0 is a very accurate approximation to the exact value. This is called the
Romberg method.
The famous Gauss integration method works essentially the same way as the
polynomial methods for equidistant points described above, but for the grid points
xnthe zeroes of the Legendre polynomials are taken, and on the interval[a,b]the
functionf is approximated by Legendre polynomials. Legendre polynomialsPl
have the property of being orthonormal on the interval[−1, 1]:
∫ 1

− 1

Pl(x)Pl′(x)dx=δll′. (A.31)

The advantage of the Gauss–Legendre method is that its accuracy is much better
than that of other methods using the same number of integration points: the accuracy
of anN-point Gauss–Legendre method is equivalent to that of an equidistant-point
method using 2Npoints!
We give no derivations but just present the resulting algorithm on the interval
[−1, 1]:
∫ 1

− 1

dxf(x)=

∑N


n= 1

wnf(xn)+O(h^2 N). (A.32)

Here,xnare the zeroes of the Legendre polynomialPN,his 2/N,xnandwncan be
foundinmanybooks.Moreover,thereexistprogramstogeneratethem[ 1 ].
ThereexistotherGaussintegrationmethodsfornonboundedintervals[ 1 ].

A7 Differential equations


Many physical theories boil down to one or more differential equations: for example
Newton’s second law, the Schrödinger equation or Maxwell’s equations. It is there-
fore of primary importance to the computational physicist to have available reliable
and efficient methods for solving such equations. As we have seen in Chapter 3 of
this book, we can often determine the stationary functions of a functional instead
of solving the differential equations directly (these equations can even be derived
using such a stationarity condition), but here we restrict ourselves to the direct solu-
tion of the differential equations. In the field of numerical analysis, many methods
have been developed to solve differential equations. Here we shall not treat these
methods in great detail, but review the most common ones and their properties.
What makes a method ‘good’ depends on the problem at hand, and a number of
criteria can be distinguished:


  • Precision and speed. Higher precision will generally cost more time, higher
    speed will yield less precise results.

Free download pdf