# Stiff Differential Equations - Occidental College Stiff Differential Equations Numerical Approaches by Thayer Fisher and Riley James 1 Outline Intro A simple example Proper definition Real world example Solutions Runge-Kutta, Dormond-Prince/ode23s Conclusion

2 What is a Stiff Differential Equation? A differential equation Numerically unstable, requiring a small step size to solve using traditional methods Includes a term that leads to rapid variation in the slope Often this is variation around a stable solution as t gets large The problem caused by stiffness is the time it takes to solve Extremely simple ODEs can fail under traditional numerical methods 3 A Simple Example

Consider the simple ODE: We know that the solution to this ODE is: However, the numerical solution using Eulers Method runs into some problems... 4 A Simple Example 300 250 200 150 y(t)

100 50 0 0 0.5 1 1.5 2

2.5 -50 -100 0.125 0.5 t 0.25 5 A-Stability

How do we quantify the stability of the numerical solution? By Induction: Which is convergent for or 6 More A-Stability Generalizing this concept for the test equation = , where The numerical method is called A-Stable if

Note that this region corresponds to the left half-plane, since z can be complex A-Stability tells us that the numerical method is always stable around the origin Further, if it is also the case that as , the numerical method is called Stable. L-Stable methods are good for solving stiff equations. L7

A More In-Depth Example Stiffness can be seen in several differential equations that model the real world: Propagating Flame Model: , where is small (.0001) 8 Runge-Kutta Method 4th order Runge-Kutta, modified version is ode45:

yn is the value of y at the nth timestep and h is the step size Variation on Euler's Method, using the weighted averages of 4 intervals between tn and tn+1 9 Applied to our IVP h=1 10 Plot of flame propagation system using ode45 zoomed around (1,1)

Plot of the flame propagation system using ode45 with = .0001 11 Dormand-Prince Method Matlab ODE Suite has several modifications on the previous methods that work on surpassing the stiffness of a system ode23s

Modified implicit Rosenbrock method of orders 3 and 2 Used to recognize drastic changes in the system at both the beginning and the end of each step New Jacobian formed at each step Components can change in each step, warranting a new Jacobian

Relatively quick to compute the Jacobian, which is what we care about in the first place 12 hawks Matlabs ode23s When going from tn,yn to = : where 13

Its Just an IVP , 14 Flame propagation system plotted using ode23s, zoomed around (1,1) Flame propagation system plotted using ode23s 15 Finding an Exact Solution

The exact solution for the system of a propagating flame can be expressed: where a = 1/ -1. The function -1. The function W(z), the Lambert W function, is the solution to The graph of the exact solution is shown here: 16 Conclusion From this we can conclude: Stiff equations can be solved without being computationally expensive

Implicit methods are superior to explicit methods Adjust for drastic changes around equilibrium Explicit methods are more expensive, and require smaller step sizes, but have a higher degree of accuracy than implicit methods for non-stiff ODEs 17 References

Ashino, Ryuichi, Michihiro Nagase, and Remi Vaillancourt. "Behind and Beyond the MATLAB ODE Suite." Behind and Beyond the MATLAB ODE Suite (n.d.): n. pag. Web. Dahlquist, Germund (1963), "A special stability problem for linear multistep methods", BIT 3 (1): 2743 Frank, Jason. "Optimal Implicit SSP RungeKutta Methods." Strong Stability Preserving Runge-Kutta and Multistep Time Discretizations (2011): 91-107. Utrecht University. Utrecht University. Web.

Moler, Cleve. "Ordinary Differential Equations, Stiffness 3." Cleves Corner Cleve Moler on Mathematics and Computing Ordinary Differential Equations Stiffness Comments. MATLAB, n.d. Web. 12 Nov. 2015. Shampine, Lawrence F., and Mark W. Reichelt. "The Matlab ODE Suite." THE MATLAB ODE SUITE (n.d.): n. pag. Mathworks. Mathworks. Web. Weisstein, Eric W. "Runge-Kutta Method." From MathWorld--A Wolfram Web Resource. 18