We use cookies to distinguish you from other users and to provide you with a better experience on our websites. Close this message to accept cookies or find out how to manage your cookie settings.
To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Chapter 5 starts out with a physics motivation, as well as a mathematical statement of the problems that will be tackled in later sections. Several methods are introduced to solve a single nonlinear equation in one variable: fixed-point iteration, the bisection method, Newton’s method, the secant method, and Ridders’ method. After providing some advice about advantages and disadvantages of each approach, the text then studies how to find zeros of polynomials, employing two different techniques. The sophistication is then increased, by tackling systems of nonlinear equations and examining the corresponding challenges; in addition to Newton’s method, the text derives the equations behind Broyden’s method. A related subject is then broached, minimization in one or several dimensions; this includes the gradient-descent method, as well as detailed analysis of critical points; the second edition includes extensive new material on derivative-free optimization (golden-section search and Powell’s method).The chapter is rounded out by a physics project, the extremization of the action in classical mechanics, and a problem set. The physics project shows Hamilton’s principle in... action, translated into a multidimensional minimization problem.
Chapter 7 starts out with a physics motivation, as well as a mathematical statement of the problems that will be tackled in later sections. Newton-Cotes integration methods are first studied ad hoc, via Taylor expansions and, second, building on the interpolation machinery of the previous chapter. Standard techniques like the trapezoid rule and Simpson’s rule are introduced, including the Euler-Maclaurin summation formula. The error behavior is employed to produce an adaptive-integration routine and also, separately, to introduce the topic of Romberg integration. The theme of integration from interpolation continues, when Gauss-Legendre quadrature is explicitly derived, including the integration abscissas, weights, and error behavior. Emphasis is placed on analytic manipulations that can help the numerical evaluation of integrals. The chapter then turns to Monte Carlo, namely stochastic integration: this is painstakingly introduced for one-dimensional problems, and then generalized to the real-world problem of multidimensional integration. The chapter is rounded out by a physics project, on variational Monte Carlo for many-particle quantum mechanics, and a problem set.
Chapter 3 starts out with a physics motivation, as well as a mathematical statement of the problem that will be tackled in later sections. After a brief discussion of analytical differentiation, the bulk of the chapter is devoted to increasingly better finite-difference approximations, like the forward difference and the central difference. These are explicitly derived using Taylor expansions, and also applied to second derivatives and to points on a grid. A section introduces the useful tool of Richardson extrapolation, which reappears in later chapters. The chapter also includes an original discussion of automatic differentiation, which is built up from the concept of dual numbers. The chapter is rounded out by a physics project, which studies the kinetic energy in single-particle quantum mechanics, and a problem set. The physics project involves different wave functions and provides the groundwork for the project in the integrals chapter.
Chapter 2 starts out with a physics motivation, chosen to be the experimental study of the photoelectric effect by Millikan. It then discusses the concepts of absolute and relative error, as well as eror propagation in general. It then goes on to discuss the representation of real numbers on the computer, touching on topics like overflow, machine precision, and catastrophic cancellation. It then addresses a variety of problems where rounding error becomes significant: compensated summation, analytic manipulation, Taylor series, and recursion. The chapter is rounded out by a physics project, which studies the multipole expansion in electromagnetism, and a problem set. The physics project provides an opportunity to introduce Legendre polynomials, which play an important role in the following chapters.
Chapter 8 starts out with a physics motivation, as well as a mathematical statement of the problems that will be tackled in later sections. Starting from differential-equation initial-value problems, the text introduces both explicit and implicit methods, like backward Euler and the fourth-order Runge-Kutta method. Emphasis is placed on the interplay between method stability and problem conditioning (stiffness). The chapter then discusses boundary-value problems, first, via a combination of the earlier machinery on initial-value problems along with root-finding techniques and, second, via a finite-difference/matrix approach, which converts the problem to a linear system of equations. Next, the chapter tackles eigenvalue problems, again, via either rootfinding plus earlier tools, or a finite-difference approach; this time, the latter turns into a matrix eigenvalue problem. The second edition discussesfinite-difference approaches to solving the diffusion equation. The chapter is rounded out by a physics project, on Poisson’s equation in two dimensions, and a problem set. The physics project introduces and uses the two-dimensional fast Fourier transform, as part of a spectral method applied to the solution of a partial differential equation.
Chapter 6 starts out with a physics motivation, as well as a mathematical statement of the problems that will be tackled in later sections. First, polynomial interpolation is carried out using both the monomial basis and the Lagrange-interpolation formalism, sped up via the barycentric formula. This includes a derivation of the error and an emphasis on using unequally spaced points (Chebyshev nodes). Second, cubic-spline interpolation is introduced. Third, a section is dedicated to trigonometric interpolation, carefully working through the conventions and formalism needed to implement one of the most successful algorithms ever, the fast Fourier transform (FFT). Fourth, the topic of linear least-squares fitting is tackled, including the general formalism of the normal equations. The second edition includes a substantive new section on statistical inference, covering both frequentist and Bayesian approaches to linear regression. Nonlinear least-squares fitting is covered next, including the Gauss-Newton method and artificial neural networks. The chapter is rounded out by a physics project, on the experimental verification of the Stefan-Boltzmann law, and a problem set. In addition to providing a historical background on black-body radiation, the physics project shows an example of nonlinear least-squares fitting.
Chapter 4 starts out with a physics motivation, as well as a mathematical statement of the problems that will be tackled in later sections. An extensive section discusses the conditioning of linear-algebra problems: borrowing ideas and examples from matrix perturbation theory, this teaches students what to look out for. Roughly half of the remaining chapter is dedicated to the solution of linear systems of equations, employing methods of varying sophistication: Gaussian elimination, LU decomposiion, pivoting, and the Jacobi iterative method. The second half addresses the eigenvalue problem, again with a variety of methods, including the power method, eigenvalue shifting, and the QR method. Crucially, this includes explicit mathematical derivations of these approaches. A brief introduction to the singular value decomposition is also given, including both an existence proof and a programming implementation. The chapter is rounded out by an extensive physics project, which studies the eigenvalue problem of interacting spins, and a problem set. The physics project patiently builds up matrix quantum mechanics, allowing students to tackle problems of increasing difficulty.
After a discussion of best programming practices and a brief summary of basic features of the Python programming language, chapter 1 discusses several modern idioms. These include the use of list comprehensions, dictionaries, the for-else idiom, as well as other ways to iterate Pythonically. Throughout, the focus is on programming in a way which feels natural, i.e., working with the language (as opposed to working against the language). The chapter also includes basic information on how to make figures using Matplotlib, as well as advice on how to effectively use the NumPy library, with an emphasis on slicing, vectorization, and broadcasting. The chapter is rounded out by a physics project, which studies the visualization of electric fields, and a problem set.