Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Solutions of Differential Equations Taylor Methods.

Similar presentations


Presentation on theme: "Numerical Solutions of Differential Equations Taylor Methods."— Presentation transcript:

1 Numerical Solutions of Differential Equations Taylor Methods

2 Euler’s Method We have previously seen Euler’s Method for estimating the solution of a differential equation. That is to say given the derivative as a function of x and y (i.e. f(x,y) ) and an initial value y(x 0 )=y 0 and a terminal value x n we can generate an estimate for the corresponding y n. They are related in the following way: The value  x = ( x n - x 0 )/ n and the accuracy increases with n. Taylor Method of Order 1 Euler’s Method is one of a family of methods for solving differential equations developed by Taylor. We would call this a Taylor Method of order 1. The 1 refers to the fact that this method used the first derivative to generate the next estimate. In terms of geometry it says you are moving along a line (i.e. the tangent line) to get from one estimate to the next.

3 Taylor Method of Order 2 In this method instead of moving from point to point along a line we move from point to point along a parabola. Not just any parabola but the parabola that most closely approximates the function y we are interested in. In intermediate calculus we discussed Taylor’s Theorem. This explained how to get a polynomial of varying degrees that would estimate any function at a point a. In particular a second degree polynomial (i.e. it graph is a parabola). How you do this estimate is given below. In order to be able to apply this we need to be able to resolve 2 questions: 1) How is the second or higher derivative found? 2) How is accuracy improved by increasing the number of subintervals?

4 Computing Higher Order Derivatives The problem we are trying to solve we are given the first derivative expressed as a function of x and y. How can we get the second, third or any higher derivative from this piece of information? We use a concept from multivariable calculus and a tool called partial derivatives. The Problem: Given :find To the right is a tree that shows how the variables depend on each other. Remember y is a function of x (i.e. y is the dependent variable x is the independent variable). The delta symbol  indicates a partial derivative which means treat the indicated variable as the variable and all other variables as a constant. xy x

5 Example: Find the second derivative if the first derivative is given to the right. Set f(x,y) = x 2 y and plug it into the formula below. Here we notice that: Higher Derivatives Third, fourth, fifth, … etc derivatives can be computed with the same method. This has a recursive definition given to the right. Notice you get a function of x and y again!

6 Subintervals If we wish to apply Taylor’s Method to the general differential equation given to the right on only one subinterval we simply plug into the formula the following values: x 0 = ay 0 = f(x 0 )x 1 = x Applying this to a subinterval with n parts to the partition this formula becomes: Where:

7 Example: Apply the second order Taylor Method to estimate the solution to the differential equation to the right at x = 2 using 4 partitions. The recursive formula becomes: The estimate we have found for this value is 7.38842

8 Higher Order Taylor Methods Taylor’s Method can be extended to any order Taylor approximation by the following recursive definition. This is the definition of a Taylor method of order n. Algorithm for Taylor’s Method f(x,y) (* expression for x and y *) x 0 (* initial value for x *) y 0 (* initial value for y *) xn (* terminal value for x *) n (* number of partitions of the interval *) deltax = ( xn-x0 )/ n x i = x 0 xprev = x i y i = y 0 for( i =1, i  n, i ++, x i = x i + deltax y i = y i + f(xprev,yi)*deltax+…+(1/(n!))(y (n) (xprev,y i )*deltax ) xprev = x i Return y i


Download ppt "Numerical Solutions of Differential Equations Taylor Methods."

Similar presentations


Ads by Google