 |
|

|
 |

09/08/11 - Refined numerical methods: improved Euler's method and the Runge-Kutta method
|
 |
 |
 |
  | The weakness in Euler's method and how to reduce it
|
 |
 |
 |
 |
  | Euler's method uses the slope at the beginning of the interval to estimate the change over the whole interval, but if the function changes slope appreciably during the interval, then the estimate could be significantly in error. One way to reduce this error would be to use an average slope over the whole interval. If we knew the slope at the end of the interval, we could average that with the slope at the beginning of the interval, and use the average slope to estimate the change over the whole interval. This gives us an improved Euler's method.
|
 |
 |
 |
 |
  | Using the same ODE as above:
 we can create the following spreadsheet:
|
 |
 |
 |
 |
  | Runge-Kutta fourth-order method
|
 |
 |
 |
 |
  | This method is probably the most commonly used solution algorithm. For most equations and systems it is suitably fast and accurate. It's comparable to Simpson's method for approximating integrals numerically.
|
 |
 |
 |
 |
  | Given a first-order ODE of the form:
 This method looks at the slope at the beginning of an interval (y' = f(tk-1,yk-1)), the estimated slope at the end of the interval (y' = f(tk,yk)), and two estimates of the slope in the middle. Starting with the initial condition (t0,y0), we calculate four parameters for k = 1 to N:



 Then


|
 |
 |
 |
 |
  | Use the Runge-Kutta fourth-order method in a spreadsheet to solve the following initial-value problem:
 over the interval x = [0, 3] and report the value of y(3). Your solution should be similar to that shown below.

|
 |
 |
|


 |
 |
 |