Presentation is loading. Please wait.

Presentation is loading. Please wait.

MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo

Similar presentations


Presentation on theme: "MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo"— Presentation transcript:

1 MECN 3500 Inter - Bayamon Lecture 6 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 6 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 4-5 System of Linear Equations Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations

3 Lecture 6 MECN 3500 Inter - Bayamon Engineering Practice Roots of Equations 3

4 Lecture 6 MECN 3500 Inter - Bayamon  To understand the open methods to find the root of equations. 4 Course Objectives

5 Lecture 6 MECN 3500 Inter - Bayamon For the bracketing methods in previous chapter, the root is located within an interval prescribed by a lower and an upper bound. Repeated application of theses methods always results in closer estimates of the true value of the root. For the bracketing methods in previous chapter, the root is located within an interval prescribed by a lower and an upper bound. Repeated application of theses methods always results in closer estimates of the true value of the root. These methods are said to be convergent because they move closer to the truth as the computation progresses. These methods are said to be convergent because they move closer to the truth as the computation progresses. In contrast Open Methods described in this chapter are based on formulas that require only a single starting value of x or two starting values that do not necessarily bracket the root. In contrast Open Methods described in this chapter are based on formulas that require only a single starting value of x or two starting values that do not necessarily bracket the root. They some time diverge or move away from the true root as the computation progresses. They some time diverge or move away from the true root as the computation progresses. When the open methods converge, they usually do so much more quickly than the bracketing methods. When the open methods converge, they usually do so much more quickly than the bracketing methods. 5 Introduction

6 Lecture 6 MECN 3500 Inter - Bayamon Simple Fixed-Point Iteration: As mentioned previously, open methods employ a formula to predict the root. Such a formula can be developed for simple fixed-point iteration (or, as it is also called, one-point iteration or successive substitution) by rearranging the function f(x)=0 so that x is on the left- hand side of the equation: Simple Fixed-Point Iteration: As mentioned previously, open methods employ a formula to predict the root. Such a formula can be developed for simple fixed-point iteration (or, as it is also called, one-point iteration or successive substitution) by rearranging the function f(x)=0 so that x is on the left- hand side of the equation: 6 Open Methods

7 Lecture 6 MECN 3500 Inter - Bayamon 7

8 Lecture 6 MECN 3500 Inter - Bayamon Example 6.1 - Fixed-Point Iteration Example 6.1 - Fixed-Point Iteration Problem Statement. Use the fixed-point iteration to locate the root of f(x)=e -x -x. Problem Statement. Use the fixed-point iteration to locate the root of f(x)=e -x -x. Solution: The function can be separated directly and expressed of the form Solution: The function can be separated directly and expressed of the form Starting with an initial guess of x 0 =0, Starting with an initial guess of x 0 =0, 8 Open Methods ixixi ε a (%) ε t (%) 00100 11.000000100.076.3 20.367879171.835.1 30.69220146.922.1 40.50047338.311.8 50.60624417.46.89 60.54539611.23.83 70.5796125.902.20 80.5601153.481.24 90.5711431.930.705 100.5648791.110.399

9 Lecture 6 MECN 3500 Inter - Bayamon Open Methods  x=g(x) can be expressed as a pair of equations: y 1 =x y 2 =g(x)(component equations)  Plot them separately 9

10 Lecture 6 MECN 3500 Inter - Bayamon The Newton-Raphson Method: Perhaps the most widely used of all root-locating formulas in the Netwton-Raphson. If the initial guess at the root is x i, a tangent can be extended from the point [x i,f(x i )]. The point where this tangent crosses the x axis usually represents an improved estimate of the root. The Newton-Raphson Method: Perhaps the most widely used of all root-locating formulas in the Netwton-Raphson. If the initial guess at the root is x i, a tangent can be extended from the point [x i,f(x i )]. The point where this tangent crosses the x axis usually represents an improved estimate of the root. 10 Open Methods Newton-Raphson formula Solve for

11 Lecture 6 MECN 3500 Inter - Bayamon Open Methods 11  A convenient method for functions whose derivatives can be evaluated analytically. It may not be convenient for functions whose derivatives cannot be evaluated analytically.

12 Lecture 6 MECN 3500 Inter - Bayamon 12

13 Lecture 6 MECN 3500 Inter - Bayamon Example 6.3 – Newton-Raphson Method Example 6.3 – Newton-Raphson Method Problem Statement. Use the Newton-Raphson Method to estimate the root of f(x)=e -x -x, employing an initial guess of x 0 =0 Problem Statement. Use the Newton-Raphson Method to estimate the root of f(x)=e -x -x, employing an initial guess of x 0 =0 Solution: The first derivative of the function can be evaluated as Solution: The first derivative of the function can be evaluated as Which can be substituted in the Newton- Raphson Method Which can be substituted in the Newton- Raphson Method 13 Open Methods

14 Lecture 6 MECN 3500 Inter - Bayamon Starting with an initial guess of x 0 =0, this iterative equation can be applied to compute Starting with an initial guess of x 0 =0, this iterative equation can be applied to compute 14 Open Methods ixixi ε t (%) 00100 10.50000000011.8 20.5663110030.147 30.5671431650.0000220 40.567143290<10 -8

15 Lecture 6 MECN 3500 Inter - Bayamon Open Methods The Secant Method: A potential problem in implementing the Newton-Raphson Method is the evaluation of the derivative. The Secant Method: A potential problem in implementing the Newton-Raphson Method is the evaluation of the derivative. A slight variation of Newton’s method for functions whose derivatives are difficult to evaluate. For these cases the derivative can be approximated by a backward finite divided difference. A slight variation of Newton’s method for functions whose derivatives are difficult to evaluate. For these cases the derivative can be approximated by a backward finite divided difference. 15 Formula for the Secant Method

16 Lecture 6 MECN 3500 Inter - Bayamon Open Methods Requires two initial estimates of x, e.g, x o, x 1. However, because f(x) is not required to change signs between estimates, it is not classified as a “bracketing” method.Requires two initial estimates of x, e.g, x o, x 1. However, because f(x) is not required to change signs between estimates, it is not classified as a “bracketing” method. The secant method has the same properties as Newton’s method. Convergence is not guaranteed for all x o, f(x).The secant method has the same properties as Newton’s method. Convergence is not guaranteed for all x o, f(x). 16

17 Lecture 6 MECN 3500 Inter - Bayamon 17

18 Lecture 6 MECN 3500 Inter - Bayamon Example 6.6 – The Secant Method Example 6.6 – The Secant Method Problem Statement. Use the Secant Method to estimate the root of f(x)=e -x -x. Start with initial estimates of x -1 =0 x 0 =1.0. Problem Statement. Use the Secant Method to estimate the root of f(x)=e -x -x. Start with initial estimates of x -1 =0 x 0 =1.0. Solution: Recall that the true root is 0.56714329 Solution: Recall that the true root is 0.56714329 First Iteration: First Iteration: Second Iteration: Second Iteration: 18 Open Methods

19 Lecture 6 MECN 3500 Inter - Bayamon Third Iteration: Third Iteration: 19 Open Methods

20 Lecture 6 MECN 3500 Inter - Bayamon Homework5  www.bc.inter.edu/facultad/omeza www.bc.inter.edu/facultad/omeza Omar E. Meza Castillo Ph.D. 20


Download ppt "MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo"

Similar presentations


Ads by Google