Computers in Engineering - 308-208 Lecture 25
Computers in Engineering - 308-208


Lesson 25 - Learning Goals



25.1 Learn why Ordinary Differential Equations is useful

25.2 Learn several different Ordinary Differential Equations Techniques

25.3 Learn how to compare different Ordinary Differential Equations algorithms



ORDINARY DIFFERENTIAL EQUATIONS

INTRODUCTION


THE EULER METHOD

EULER ALGORITHM

Starting from the point (0 , y0), we estimate the solution to y' = f(x,y) at x-values separated by the step size h, until we reach the desired value xf of x. It is assumed that xf = n h for some positive integer n, which is the number of steps taken in attaining the final solution.

  1. x = 0 , y = y0
  2. if(xxf) , STOP
  3. y = y + h* f(x,y)
  4. x = x + h
  5. go to step 2

THE RUNGE-KUTTA METHOD

Advantages
(relative to more complicated techniques):

The derivation of the formula is too complex, but basic idea is to start from (xi , yi) and use Euler method to obtain different estimates of yi + ½ and yi+1 which are combined so as to minimize error:

y*i + ½ = yi + h/2 f(xi , yi)

y**i + ½ = yi + h/2 f(xi + ½ , y*i + ½)

y*i + 1 = yi + h f(xi + ½ , y**i + ½)

yi + 1 = yi + h/6 [ f(xi , yi) + 2f(xi + ½ , y*i + ½)

+2f(xi + ½ , y**i + ½) + f(xi + 1 , y*i + 1) ]

To use the Runge-Kutta method, start with y(0) = y0, and apply the above equations (in sequence!) to get y1 = y(h).

Repeat this process for x2, … , xn where xn = nh.


On to the next lecture
Go back to lecture menu
Browse other websites on this topic

Copyright © 1996 McGill University. All rights reserved.