The Computable Differential Equation Lecture ... - Bruce E. Shapiro
The Computable Differential Equation Lecture ... - Bruce E. Shapiro The Computable Differential Equation Lecture ... - Bruce E. Shapiro
104 CHAPTER 5. RUNGE-KUTTA METHODS Figure 5.5: The function RungeKuttaOrderConditions in Mathematica. 5.6 Step Size Control for ERK Methods Computing the local truncation error for a Runge-Kutta method is quite unwieldy and requires the analytic calculation of numerous partial derivatives, making it impractical for an efficient implementation. Instead, we are forced to use an approximation of the error. Suppose we have computed two different solutions: y, of order p, and z, of order p + 1. Then y n = y(t n ) + ch p+1 + O(h p+2 ) (5.132) z n = y(t n ) + O(h p+2 ) (5.133) for some constant c that depends on the method but is independent of h. Subtracting, ch p+1 = |y n − z n | (5.134) The idea is that we have some tolerance ɛ that we do not want to exceed, and when |y n − z n | approaches ɛ, we choose a new step size that satisfies |y n − z n | old h p+1 old ≈ c ≈ |y n − z n | new h p+1 new < νɛ h p+1 new (5.135) Math 582B, Spring 2007 California State University Northridge c○2007, B.E.Shapiro Last revised: May 23, 2007
CHAPTER 5. RUNGE-KUTTA METHODS 105 where ν is a safety fraction, say 50%, giving the level of comfort or closeness we want to allow the error estimate to approach ɛ. Then we choose any h new satisfying ( ) 1 νɛ h new < h old |y n − z n | old p+1 (5.136) Again, when the error becomes significantly smaller than νɛ the process can be reversed, and the step size increased. Or the step size can be adjusted at each calculation to equal the right hand side of 5.136. The problem with this technique is that one needs to perform two calculations, one at each of two different orders. This could potentially double the computation time unless we can find an embedded method – that is, one that has a lower-level computation built into it as part of the higher level computation. If the original and embedded methods are given by and c c A b T (5.137) A ˆb T (5.138) respectively, then we use the shorter notation c A b T ˆb T (5.139) to describe them both together. For example, the forward Euler is embedded in the modified trapezoidal: 0 0 0 1 1 0 (5.140) 1 0 1/2 1/2 One frequently implemented method is the six-stage Runge-Kutta-Fehlberg which has a 4-th order method embedded within a fifth-order method: 0 1/4 1/4 3/8 3/32 9/32 12/13 1932/2197 −7200/2197 7296/2197 1 439/216 −8 3680/513 −845/4104 1/2 −8/27 2 −3544/2565 1859/4104 −11/40 25/216 0 1408/2565 2197/4104 −1/5 0 16/135 0 6656/12825 28561/56430 −9/50 2/55 (5.141) c○2007, B.E.Shapiro Last revised: May 23, 2007 Math 582B, Spring 2007 California State University Northridge
- Page 59 and 60: CHAPTER 3. APPROXIMATE SOLUTIONS 53
- Page 61 and 62: CHAPTER 3. APPROXIMATE SOLUTIONS 55
- Page 63 and 64: CHAPTER 3. APPROXIMATE SOLUTIONS 57
- Page 65 and 66: CHAPTER 3. APPROXIMATE SOLUTIONS 59
- Page 67 and 68: CHAPTER 3. APPROXIMATE SOLUTIONS 61
- Page 69 and 70: CHAPTER 3. APPROXIMATE SOLUTIONS 63
- Page 71 and 72: CHAPTER 3. APPROXIMATE SOLUTIONS 65
- Page 73 and 74: CHAPTER 3. APPROXIMATE SOLUTIONS 67
- Page 75 and 76: Chapter 4 Improving on Euler’s Me
- Page 77 and 78: CHAPTER 4. IMPROVING ON EULER’S M
- Page 79 and 80: CHAPTER 4. IMPROVING ON EULER’S M
- Page 81 and 82: CHAPTER 4. IMPROVING ON EULER’S M
- Page 83 and 84: CHAPTER 4. IMPROVING ON EULER’S M
- Page 85 and 86: CHAPTER 4. IMPROVING ON EULER’S M
- Page 87 and 88: CHAPTER 4. IMPROVING ON EULER’S M
- Page 89 and 90: CHAPTER 4. IMPROVING ON EULER’S M
- Page 91 and 92: CHAPTER 4. IMPROVING ON EULER’S M
- Page 93 and 94: CHAPTER 4. IMPROVING ON EULER’S M
- Page 95 and 96: Chapter 5 Runge-Kutta Methods 5.1 T
- Page 97 and 98: CHAPTER 5. RUNGE-KUTTA METHODS 91 w
- Page 99 and 100: CHAPTER 5. RUNGE-KUTTA METHODS 93 w
- Page 101 and 102: CHAPTER 5. RUNGE-KUTTA METHODS 95 5
- Page 103 and 104: CHAPTER 5. RUNGE-KUTTA METHODS 97 F
- Page 105 and 106: CHAPTER 5. RUNGE-KUTTA METHODS 99 T
- Page 107 and 108: CHAPTER 5. RUNGE-KUTTA METHODS 101
- Page 109: CHAPTER 5. RUNGE-KUTTA METHODS 103
- Page 113 and 114: CHAPTER 5. RUNGE-KUTTA METHODS 107
- Page 115 and 116: CHAPTER 5. RUNGE-KUTTA METHODS 109
- Page 117 and 118: CHAPTER 5. RUNGE-KUTTA METHODS 111
- Page 119 and 120: CHAPTER 5. RUNGE-KUTTA METHODS 113
- Page 121 and 122: CHAPTER 5. RUNGE-KUTTA METHODS 115
- Page 123 and 124: Chapter 6 Linear Multistep Methods
- Page 125 and 126: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 127 and 128: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 129 and 130: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 131 and 132: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 133 and 134: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 135 and 136: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 137 and 138: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 139 and 140: CHAPTER 6. LINEAR MULTISTEP METHODS
- Page 141 and 142: Chapter 7 Delay Differential Equati
- Page 143 and 144: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 145 and 146: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 147 and 148: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 149 and 150: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 151 and 152: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 153 and 154: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 155 and 156: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 157 and 158: CHAPTER 7. DELAY DIFFERENTIAL EQUAT
- Page 159 and 160: Chapter 8 Boundary Value Problems 8
CHAPTER 5. RUNGE-KUTTA METHODS 105<br />
where ν is a safety fraction, say 50%, giving the level of comfort or closeness we<br />
want to allow the error estimate to approach ɛ. <strong>The</strong>n we choose any h new satisfying<br />
(<br />
) 1<br />
νɛ<br />
h new < h old<br />
|y n − z n | old<br />
p+1<br />
(5.136)<br />
Again, when the error becomes significantly smaller than νɛ the process can be<br />
reversed, and the step size increased. Or the step size can be adjusted at each calculation<br />
to equal the right hand side of 5.136.<br />
<strong>The</strong> problem with this technique is that one needs to perform two calculations,<br />
one at each of two different orders. This could potentially double the computation<br />
time unless we can find an embedded method – that is, one that has a lower-level<br />
computation built into it as part of the higher level computation. If the original and<br />
embedded methods are given by<br />
and<br />
c<br />
c<br />
A<br />
b T (5.137)<br />
A<br />
ˆb T (5.138)<br />
respectively, then we use the shorter notation<br />
c<br />
A<br />
b T<br />
ˆb T (5.139)<br />
to describe them both together. For example, the forward Euler is embedded in the<br />
modified trapezoidal:<br />
0 0 0<br />
1 1 0<br />
(5.140)<br />
1 0<br />
1/2 1/2<br />
One frequently implemented method is the six-stage Runge-Kutta-Fehlberg which<br />
has a 4-th order method embedded within a fifth-order method:<br />
0<br />
1/4 1/4<br />
3/8 3/32 9/32<br />
12/13 1932/2197 −7200/2197 7296/2197<br />
1 439/216 −8 3680/513 −845/4104<br />
1/2 −8/27 2 −3544/2565 1859/4104 −11/40<br />
25/216 0 1408/2565 2197/4104 −1/5 0<br />
16/135 0 6656/12825 28561/56430 −9/50 2/55<br />
(5.141)<br />
c○2007, B.E.<strong>Shapiro</strong><br />
Last revised: May 23, 2007<br />
Math 582B, Spring 2007<br />
California State University Northridge