Presentation on theme: "Truncation Errors and Taylor Series"— Presentation transcript:
1Truncation Errors and Taylor Series The Islamic University of GazaFaculty of EngineeringCivil Engineering DepartmentNumerical AnalysisECIV 3306Chapter 4Truncation Errors and Taylor Series
2Introduction Truncation errors Result when approximations are used to represent exact mathematical procedureFor example:
3Taylor Series - Definition Mathematical Formulation used widely in numerical methods to express functions in an approximate fashion……. Taylor Series.It is of great value in the study of numerical methods.It provides means to predict a functional value at one point in terms of:- the function value- its derivativesat another point
4Taylor’s Theorem General Expression Where:Rn is the remainder term to account for all terms from n+1 to infinity.Andis a value of x that lies somewhere between xi and xi+1
5Taylor’s TheoremAny smooth function can be approximated as a polynomialZero- order approximation: only true if xi+1 and xi are very close to each other.First- order approximation: in form of a straight lineSecond- order approximation:
6Taylor’s Theorem - Remainder Term Remainder Term: What is ξ ?If Zero- order approximation:
7Taylor Series - Example Use zero-order to fourth-order Taylor series expansions to approximate the function.f(x)= -0.1x4 – 0.15x3 – 0.5x2 – 0.25x +1.2From xi = 0 with h =1. Predict the function’s value at xi+1 =1.Solutionf(xi)= f(0)= 1.2 , f(xi+1)= f(1) = 0.2 ………exact solutionZero- order approx. (n=0) f(xi+1)=1.2Et = 0.2 – 1.2 = -1.0First- order approx. (n=1) f(xi+1)= 0.95f(x)= -0.4x3 – 0.45x2 – x – 0.25, f’(0)= -0.25f( xi+1)= h = 0.95Et = = -0.75
8Taylor Series - Example Second- order approximation (n=2) f(xi+1)= 0.45f’’(x) = -1.2 x2 – 0.9x -1 , f’’(0)= -1f( xi+1)= h h2 = 0.45Et = 0.2 – 0.45 = -0.25Third-order approximation (n=3) f(xi+1)= 0.3f( xi+1)= h h2 – 0.15h3 = 0.3Et = 0.2 – 0.3 = -0.1
9Taylor Series - Example Fourth-order approximation (n = 4) f(xi+1)= 0.2f( xi+1)= h h2 – 0.15h3 – 0.1h 4= 0.2Et = 0.2 – 0.2 = 0The remainder term (R4) = 0because the fifth derivative of the fourth-order polynomial is zero.
10Approximation using Taylor Series Expansion The nth-order Approximation
11Taylor SeriesIn General, the n-th order Taylor Series will be exact for n-th order polynomial.For other differentiable and continuous functions, such as exponentials and sinusoids, a finite number of terms will not yield an exact estimate. Each additional term will contribute some improvement.(see example 4.2)
12Taylor SeriesTruncation error is decreased by addition of terms to the Taylor series.If h is sufficiently small, only a few terms may be required to obtain an approximation close enough to the actual value for practical purposes.