Lecture 14: Numerical Application
Solving Differential Equations:
Euler’s Method
Using Iteration in Numerical Methods
Numerical integration requires a kind of iteration because we
repeatedly add strips of area to a partial total, until the final
area is found.
However, the word iteration is more specific. It means we start
with a value or a guess and this value changes with every
repetition to approximate a solution.
Numerical Differentiation is one example of an iterative
method.
Solving Differential Equations
Most differential equations can’t be solved analytically and need
numerical approximations. These approximations require:
• the initial conditions (a known point in the solution curve)
• the derivative at that point (known from the equation).
Examples:
d F (x)
f (x, y ) = = 2x
dx
d F (x)
f (x, y ) = = y x 2 cos(x)
dx
Euler’s Method
This is the easiest numerical method for solving differential
equations. We seek the value of the function at a point xN
F (x)
We know the point (x0 , y0 ) and the derivative at that point.
Take a point x1 and find an approximation to y1 on the initial
slope.
Calculate derivative at new point (x1 , y1 ) which defines a new
slope.
Continue until we find an approximation to the function at xN .
Derivation of Euler’s Method
The derivative (slope) is:
∆y ∆y
f (xn , yn ) = h = ∆x
yn+1 −yn
f (xn , yn ) = ∆x
Solving for yn+1 we obtain:
yn+1 = yn + f (xn , yn )∆ x
We can apply this formula to successive points until we reach
desired value of yN .
y1 = y0 + f (x0 , y0 )∆ x
y2 = y1 + f (x1 , y1 )∆ x
y3 = y2 + f (x2 , y2 )∆ x
... = ... + ...
yN = yN−1 + f (xN−1 , yN−1 )∆ x
The answer we get is only an approximation. Its accuracy
depends on N and how far xN is from x0 .