Ordinary differential equations
This chapter surveys the ordinary differential equations (ODEs) that occur in classical and quantum mechanics, and describes both numerical algorithms and appropriate software design for solving them. Systems of ordinary differential equations, together with a few constants of integration, can in most cases be regarded as a means of defining a function (the “solution”). In this chapter, we develop an object-oriented architecture that applies integrators of the Runge-Kutta family to create these functions. Together with an automatic derivative system for generating partial derivatives from functions of one or more variables, the differential equation solver becomes a powerful tool for solving a variety of few-body problems in classical Hamiltonian systems. This chapter presents a blend of numerical algorithms, physics, and computing techniques. The phenomenon of energy drift is discussed and used to motivate symplectic solvers. Techniques such as adaptive step size and possible problems with stability and multiple scales are also discussed.