Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Methods for Engineering MECN 3500

Similar presentations


Presentation on theme: "Numerical Methods for Engineering MECN 3500"— Presentation transcript:

1 Numerical Methods for Engineering MECN 3500
Professor: Dr. Omar E. Meza Castillo Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus

2 Tentative Lectures Schedule
Topic Lecture Mathematical Modeling and Engineering Problem Solving 1 Introduction to Matlab 2 Numerical Error 3 Root Finding System of Linear Equations Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations

3 Roots of Equations Engineering Practice

4 Course Objectives To understand the use of Taylor Series in the study of numerical methods.

5 Introduction Years ago, you learned to use the quadratic formula The values calculated with the previous equation are called the “roots” of f(x). They represent the values of x that make f(x) equal to zero. For this reason, roots are sometimes called the zeros of the equation. There are many other functions for which the roots cannot be determined so easily.

6 Introduction

7 Bracketing Methods This chapter on roots of equations deals with methods that exploit the fact that a function typically changes sign in the vicinity of a root. These techniques are called Bracketing Methods (Or, two point methods for finding roots) because two initial guesses for the root are required. As the name implies, these guesses must “bracket”, or be on either side of, the root. Previous to discuss the techniques Bisection and False-Position, we will briefly discuss the Graphical Method.

8 Example 5.1- The Graphical Approach:
Bracketing Methods Graphical Methods: A simple method for obtaining an estimate the root of the equation f(x)=0 is to make a plot of the function and observe where it crosses the x axis. This point, which represents the x value for which f(x)=0, provides a rough approximation of the root. Example 5.1- The Graphical Approach: Problem Statement. Use the graphical approach to determine the drag coefficient c needed for a parachutist of mass m=68 kg to have a velocity of 40 m/s after free-falling for time t=10s. Note: The acceleration due to gravity is 9.8 /s2. Solution. This problem can be solved by determining the root of parachutist equation using the parameters t=10, g=9.8, v=40 and m=68.1

9 Bracketing Methods (1) (2)

10 Bracketing Methods Various values of c can be substituted into the right-hand side of this equation to compute values shows in the table and resulting in the curve that crosses the c axis between 12 and 16. Visual inspection of the plot provides a rough estimate of the root of Substituting this value in to equation (2) we get f(14.75)=0.059, which is close to zero. In order to check the root, substituting it into equation (1) v=40.059, which is close to 40m/s. c f(c) 4 34.115 8 17.653 12 6.067 16 -2.269 20 -8.401

11 Three roots( Might work for a while!!)
Bracketing Methods Graphical techniques are of limited practical value because they are not precise. However, graphical methods can be utilized to obtain the rough estimates of roots. These estimates can be employed as starting guesses for numerical methods. No answer (No root) Nice case (one root) Oops!! (two roots!!) Three roots( Might work for a while!!)

12 Bracketing Methods Progressive Enlargement
Two roots( Might work for a while!!) Discontinuous function. Need special method

13 Then there is at least one real root between xl and xu.
Bracketing Methods The Bisection Method: When applying the graphical technique you have observed that f(x) changed sign on opposite side of the root. In general if f(x) is real and continuum in the interval from xl to xu and f(xl) and f(xu) have apposite signs, that is Then there is at least one real root between xl and xu. The methods that capitalize on this observation by locating an interval where the function change sign are called Incremental Search Methods.

14 The process is repeated to obtain refined estimates.
Bracketing Methods The Bisection method also called binary chopping, interval halving, is one type of incremental search method in which the interval is always divided in half. If a function changes sign over an interval, the function value at the midpoint is evaluated. The location of the root is then determined as lying at the midpoint of the subinterval within which the sign change occurs. The process is repeated to obtain refined estimates. A simple algorithm for the bisection calculation is listed as follow:

15 Bracketing Methods For the arbitrary equation of one variable, f(x)=0
Pick xl and xu such that they bound the root of interest, check if f(xl).f(xu) <0. Estimate the root by evaluating xr =(xl+xu)/2 Find the pair If f(xl). f[(xl+xu)/2]<0, root lies in the lower interval, then xu=(xl+xu)/2 and go to step 2. If f(xl). f[(xl+xu)/2]>0, root lies in the upper interval, then xl= [(xl+xu)/2, go to step 2. If f(xl). f[(xl+xu)/2]=0, then root is (xl+xu)/2 and terminate. Compare es with ea If es<ea, stop. Otherwise repeat the process.

16 Application Problems

17 Bracketing Methods Example 5.3- Bisection Method: Problem Statement. Use the bisection to solve the same problem approached graphically in Example 5.1. Solution. The first step in bisection is to guess two values (12 and 16) of the unknown (in the present problem, c) that give values for f(c) with different signs. The initial estimate of the root xr lies at the midpoint of the interval Next we compute the product of the function value at the lower bound and at the midpoint:

18 Bracketing Methods Which value is greater than zero, and hence no sign change occurs between the lower bound and the midpoint. Consequently, the root must be located between 14 and 16. Therefore, we create a new interval by redefining the lower bound as 14 and determining a revised root estimate as: Compute the product of the function value at the lower bound and at the midpoint

19 Bracketing Methods Therefore, the root is between 14 and 15. The upper bound is redefined as 15, and the root estimate for the third iteration is calculated as The method can be repeated until the result is accurate enough to satisfy your needs.

20 Bracketing Methods Bisection Method

21 Termination Criteria and Error Estimates:
Bracketing Methods Termination Criteria and Error Estimates: Error Estimation Example 5.3, for εs=0.5% Iteration Xl Xu Xr εa(%) εt(%) 1 12 16 14 5.279 2 15 6.667 1.487 3 14.5 3.448 1.896 4 14.75 1.695 0.204 5 14.875 0.840 0.641 6 0.422 0.219

22 Bracketing Methods The False-Position Method: Although bisection is a perfectly valid technique for determining roots, its “brute-force” approach is relatively inefficient. False position is an alternative based on a graphical insight. This method that exploits this graphical insight is to joint f(xl) and f(xu) by a straight line. The fact that the replacement of the curve by a straight line gives a “false position” of the root is the origin of the name, method of false position, or in latin, regula falsi. It is also called the linear interpolation method. Using similar triangles, the intersection of the straight line with the x axis can be estimated as

23 Bracketing Methods Which can be solved for This is the false-position formula. The value of xr replaces whichever of the two initial guesses, xl or xu, yields a function value with the same sign as f(xr)

24 Bracketing Methods In this way, the values of xl and xu always bracket the true root. The process is repeated until the root is estimated adequately. The algorithm is presented as follow: Find a pair of values of x, xl and xu such that fl=f(xl) <0 and fu=f(xu) >0. Estimate the value of the root xr and evaluate f(xr). Use the new point to replace one of the original points, keeping the two points on opposite sides of the x axis. If f(xr)<0 then xl=xr == > fl=f(xr) If f(xr)>0 then xu=xr == > fu=f(xr) If f(xr)=0 then you have found the root and need go no further!

25 Bracketing Methods See if the new xl and xu are close enough for convergence to be declared. If they are not go back to step 2.

26 Application Problems

27 Bracketing Methods Example 5.5- False Position: Problem Statement. Use the false-position method to determine the root of the same equation investigated in example 5.1. Solution. As in example 5.3, initiate the computation with guesses of xl=12 and xu=16. First Iteration: Which has a true relative error of 0.89 percent.

28 Bracketing Methods Second Iteration: Therefore, the root lies in the first interval, and xr becomes the upper limit for the next iteration, xu= : Which has true and approximate relative error of 0.09 and 0.79 percent.

29 Homework4  www.bc.inter.edu/facultad/omeza
Omar E. Meza Castillo Ph.D.


Download ppt "Numerical Methods for Engineering MECN 3500"

Similar presentations


Ads by Google