Download presentation
Presentation is loading. Please wait.
Published byMilo Haynes Modified over 9 years ago
1
MECN 3500 Lecture 4 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo omeza@bayamon.inter.edu http://www.bc.inter.edu/facultad/omeza Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus
2
Lecture 4 MECN 3500 Inter - Bayamon 2 Tentative Lectures Schedule TopicLecture Mathematical Modeling and Engineering Problem Solving 1 Introduction to Matlab 2 Numerical Error 3 Root Finding 3 System of Linear Equations Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations
3
Lecture 4 MECN 3500 Inter - Bayamon Taylor Theorem Truncation Errors and the Taylor Series 3
4
Lecture 4 MECN 3500 Inter - Bayamon To understand the use of Taylor Series in the study of numerical methods. 4 Course Objectives
5
Lecture 4 MECN 3500 Inter - Bayamon Truncation Errors: use approximation in place of an exact mathematical procedure. Truncation Errors: use approximation in place of an exact mathematical procedure. Numerical Methods express functions in an approximate fashion: The Taylor Series. Numerical Methods express functions in an approximate fashion: The Taylor Series. What is a Taylor Series? What is a Taylor Series? Some examples of Taylor series which you must have seen 5 Introduction
6
Lecture 4 MECN 3500 Inter - Bayamon The general form of the Taylor series is given by The general form of the Taylor series is given by provided that all derivatives of f(x) are continuous and exist in the interval [x,x+h] What does this mean in plain English? 6 General Taylor Series As Archimedes would have said, “Give me the value of the function at a single point, and the value of all (first, second, and so on) its derivatives at that single point, and I can give you the value of the function at any other point” ( fine print excluded )
7
Lecture 4 MECN 3500 Inter - Bayamon 7
8
Lecture 4 MECN 3500 Inter - Bayamon Example: Find the value of f(6) given that f(4)=125, f’(4)=74, f’’(4)=30, f’’’(4)=6 and all other higher order derivatives of f(x) at x=4 are zero. Example: Find the value of f(6) given that f(4)=125, f’(4)=74, f’’(4)=30, f’’’(4)=6 and all other higher order derivatives of f(x) at x=4 are zero. Solution: x=4, x+h=6 h=6-x=2 Solution: x=4, x+h=6 h=6-x=2 Since the higher order derivatives are zero, Since the higher order derivatives are zero, 8 General Taylor Series
9
Lecture 4 MECN 3500 Inter - Bayamon The Taylor Series (x i+1 -x i )= hstep size (define first) (x i+1 -x i )= hstep size (define first) Reminder term, R n, accounts for all terms from (n+1) to infinity. Reminder term, R n, accounts for all terms from (n+1) to infinity. 9
10
Lecture 4 MECN 3500 Inter - Bayamon The Taylor Series Zero-order approximation Zero-order approximation First-order approximation First-order approximation Second-order approximation Second-order approximation 10
11
Lecture 4 MECN 3500 Inter - Bayamon 11
12
Lecture 4 MECN 3500 Inter - Bayamon Example 4.1: Taylor Series Approximation of a polynomial Use zero- through fourth- order Taylor Series approximation to approximate the function: Example 4.1: Taylor Series Approximation of a polynomial Use zero- through fourth- order Taylor Series approximation to approximate the function: From x i =0 with h=1. That is, predict the function’s value at x i+1 =1 From x i =0 with h=1. That is, predict the function’s value at x i+1 =1 f(0)=1.2 f(0)=1.2 f(1)=0.2 - True value f(1)=0.2 - True value 12 The Taylor Series
13
Lecture 4 MECN 3500 Inter - Bayamon Zero-order approximation Zero-order approximation First-order approximation First-order approximation 13 The Taylor Series
14
Lecture 4 MECN 3500 Inter - Bayamon Second-order approximation Second-order approximation 14 The Taylor Series
15
Lecture 4 MECN 3500 Inter - Bayamon Third-order approximation Third-order approximation 15 The Taylor Series
16
Lecture 4 MECN 3500 Inter - Bayamon Fourth-order approximation Fourth-order approximation 16 The Taylor Series
17
Lecture 4 MECN 3500 Inter - Bayamon 17 The Taylor Series
18
Lecture 4 MECN 3500 Inter - Bayamon If we truncate the series after the first derivative term If we truncate the series after the first derivative term 18 Taylor Series to Estimate Truncation Errors First-order approximation Truncation Error
19
Lecture 4 MECN 3500 Inter - Bayamon Forward Difference Approximation Forward Difference Approximation 19 Numerical Differentiation
20
Lecture 4 MECN 3500 Inter - Bayamon Backward Difference Approximation Backward Difference Approximation 20 Numerical Differentiation
21
Lecture 4 MECN 3500 Inter - Bayamon Centered Difference Approximation Centered Difference Approximation 21 Numerical Differentiation
22
Lecture 4 MECN 3500 Inter - Bayamon 22
23
Lecture 4 MECN 3500 Inter - Bayamon Example 4.4: To find the forward, backward and centered difference approximation for f(x) at x=0.5 using step size of h=0.5, repeat using h=0.25. The true value is - 0.9125 Example 4.4: To find the forward, backward and centered difference approximation for f(x) at x=0.5 using step size of h=0.5, repeat using h=0.25. The true value is - 0.9125 h=0.5 h=0.5 x i-1 =0 - f(x i-1 )=1.2 x i-1 =0 - f(x i-1 )=1.2 x i =0.5 - f(x i )=0.925 x i =0.5 - f(x i )=0.925 X i+1 =1 - f(x i+1 )=0.2 X i+1 =1 - f(x i+1 )=0.2 23 The Taylor Series
24
Lecture 4 MECN 3500 Inter - Bayamon Forward Difference Approximation Forward Difference Approximation Backward Difference Approximation Backward Difference Approximation 24 The Taylor Series
25
Lecture 4 MECN 3500 Inter - Bayamon Centered Difference Approximation Centered Difference Approximation 25 The Taylor Series
26
Lecture 4 MECN 3500 Inter - Bayamon h=0.25 h=0.25 x i-1 =0.25 - f(x i-1 )=1.10351563 x i-1 =0.25 - f(x i-1 )=1.10351563 x i =0.5 - f(x i )=0.925 x i =0.5 - f(x i )=0.925 X i+1 =0.75 - f(x i+1 )=0.63632813 X i+1 =0.75 - f(x i+1 )=0.63632813 Forward Difference Approximation Forward Difference Approximation 26 The Taylor Series
27
Lecture 4 MECN 3500 Inter - Bayamon Backward Difference Approximation Backward Difference Approximation Centered Difference Approximation Centered Difference Approximation 27 The Taylor Series
28
Lecture 4 MECN 3500 Inter - Bayamon Homework3 www.bc.inter.edu/facultad/omeza www.bc.inter.edu/facultad/omeza Omar E. Meza Castillo Ph.D. 28
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.