Stiffness and Nonstiff Differential Equation Solvers, II: Detecting Stiffness with Runge-Kutta Methods

In [4], hereafter referred to as I, we considered the question: "What happens when a good code written to solve nonstiff ordinary differential equations is applied to a stiff problem?" Using simple models, we predicted some striking behavior, which was amply verified by experiment. One aspect of the behavior was used to devise a test for stiffness applicable to some variable order, variable step Adams codes. In this paper we develop a similar test applicable to most (explicit) Runge-Kutta formulas and exemplify it for the (4, 5) formulas of Fehlberg [6]. The test of I is implemented in the Adams code DE, which has seen considerable use in academic and industrial computing environments. That test and the one developed here behave in much the same way. Neither is perfect, but even an imperfect test can be quite useful, as we can show from experience with DE. The casual user of a code for solving differential equations is a primary beneficiary. For example, such a user solving a set of equations describing a wind turbine got a stiffness indication from DE. The word "stiff" meant nothing to him, but the instruction to switch to another code did, and resulted in the effective solution of his problem. The sophisticated user can benefit from the diagnostic capability. One such user found that the modeling of an acceleration-actuated switch using a Runge-Kutta code exhibited numerical difficulties. There were a number of possible explanations, a likely one being a driving function formed by interpolated telemetry data. Advised by an analyst (not the author) to try DE because of its superior