We describe the application of adaptive (variable time step) integrators to stiff differential equations encountered in many applications. Linear harmonic oscillators subject to nonlinear thermal constraints can exhibit either stiff or smooth dynamics. Two closely related examples, Nosé's dynamics and Nosé–Hoover dynamics, are both based on Hamiltonian mechanics and generate microstates consistent with Gibbs' canonical ensemble. Nosé's dynamics is stiff and can present severe numerical difficulties. Nosé–Hoover dynamics, although it follows exactly the same trajectory, is smooth and relatively trouble-free. We emphasize the power of adaptive integrators to resolve stiff problems such as the Nosé dynamics for the harmonic oscillator. The solutions also illustrate the power of computer graphics to enrich numerical solutions.
References
See, for example, <en.wikipedia.org/wiki/Runge-Kutta-Fehlberg_method> for a discussion of the Runge–Kutta-Fehlberg method.
The Fortran compiler from the GNU Project is routinely used in numerical work with double precision arithmetic (about 16 decimal digits). For stiff problems quadruple precision (with about 34 decimal digits) is useful. To invoke the latter (which is about fifty times slower), the program producing the executable code should be compiled as rather than .
Piotr Pieranski's personal website is located at <etacar.put.poznan.pl/piotr.pieranski/Personal.html>.