Calculus/Euler's Method

From Wikibooks, open books for an open world
Jump to: navigation, search
← Optimization Calculus Differentiation/Applications of Derivatives/Exercises →
Euler's Method

Euler's Method is a method for estimating the value of a function based upon the values of that function's first derivative.

The general algorithm for finding a value of  y(x) \ is:

 y_{n+1} = y_n + \Delta x_{step} \cdot f(x_n,y_n), \

where f is y'(x). In other words, the new value, y_{n+1}, is the sum of the old value y_n and the step size \Delta x_{step} times the change, f(x_n,y_n).

You can think of the algorithm as a person traveling with a map: Now I am standing here and based on these surroundings I go that way 1 km. Then, I check the map again and determine my direction again and go 1 km that way. I repeat this until I have finished my trip.

The Euler method is mostly used to solve differential equations of the form

 
    y' = f(x,y), 
    y(x_0) = y_0. \


Examples[edit]

A simple example is to solve the equation:


 
    y' = x + y,  
    y(0) = 1. \

This yields f = y' = x + y and hence, the updating rule is:

 
    y_{n+1} = y_n + 0.1 (x_n + y_n)\

Step size \Delta x_{step} = 0.1 is used here.

The easiest way to keep track of the successive values generated by the algorithm is to draw a table with columns for  n, x_n, y_n, y_{n+1} \ .

The above equation can be e.g. a population model, where y is the population size and x a decease that is reducing the population.

← Optimization Calculus Differentiation/Applications of Derivatives/Exercises →
Euler's Method