0% found this document useful (0 votes)
23 views

Numerical Methods

This document appears to be the table of contents and introduction section of a textbook on numerical methods for engineering. It discusses nonlinear equations and various methods for solving them including bracketing methods like the bisection method. The introduction provides an overview of numerical methods, their iterative nature, sources of error, and accuracy measurements. It also presents example problems demonstrating how to use bracketing methods to find roots of equations within a given tolerance.

Uploaded by

Nrz Slvcn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Numerical Methods

This document appears to be the table of contents and introduction section of a textbook on numerical methods for engineering. It discusses nonlinear equations and various methods for solving them including bracketing methods like the bisection method. The introduction provides an overview of numerical methods, their iterative nature, sources of error, and accuracy measurements. It also presents example problems demonstrating how to use bracketing methods to find roots of equations within a given tolerance.

Uploaded by

Nrz Slvcn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Prepared by;

Gabriel I. Gamana, CE, MSCE

1.0 Nonlinear Equations in One


Variable
2.0 Systems of Equations
3.0 Function Approximation and
Interpolation, Curve Fitting
Numerical Table of Contents 4.0 Numerical Differentiation and
Integration
Methods for 5.0 Eigenvalue Problems
Engineering 6.0 Ordinary Differential Equations
7.0 Partial Differential Equations
Engr. Gabriel I. Gamana, M.Sc.

1 2

1.1 Introduction

1.1 Introduction
1.2 Bracketing Methods
1.0 Nonlinear 1.2.1 Bisection Method
1.2.2 False Position Method
Equations in 1.3 Open Methods
One Variable 1.3.1 Fixed-Point Method
1.3.2 Newton-Raphson Method
1.3.3 Secant Method

3 4

3 4

1
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.1 Introduction 1.1 Introduction


Mathematical Modeling and Engineering Problem Solving
• In Engineering, problems can be solved by either using exact
analytical methods or approximation using numerical
methods
• The discrepancy between analytical methods and numerical
methods is what we called error.
• For many applied engineering problems, we cannot obtain
analytical solutions. Therefore, we cannot compute exactly
the errors associated with our numerical methods. In these
cases, we must settle for approximations of the errors.

5 6

5 6

1.1 Introduction 1.1 Introduction


• Numerical methods are iterative solutions.
• There are no particular numerical methods that work for all
equations.
• The root depends on the initial guess.
• Accuracy measurement of the approximation can be
calculated using the equation:
𝑥 −𝑥
𝜀 = <𝜀
𝑥
Where: 𝜀 = relative error
𝜀 = stopping criterion
𝑥 = present iteration
𝑥 = previous iteration
7 8

7 8

2
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.2 Bracketing Methods 1.2 Bracketing Methods


• These techniques are called bracketing methods because 1.2.1 Bisection Method
two initial guesses for the root are required. As the name The bisection method, which is alternatively called binary
implies, these guesses must “bracket,” or be on either side of, chopping, interval halving, or Bolzano’s method, is one type
the root. The particular methods described herein employ of incremental search method in which the interval is always
different strategies to systematically reduce the width of the divided in half. The process is repeated to obtain refined
bracket and, hence, home in on the correct answer. estimates.
• For the bracketing methods, the root is located within an
interval prescribed by a lower and an upper bound. Repeated
application of these methods always results in closer
estimates of the true value of the root. Such methods are said
to be convergent because they move closer to the truth as
the computation progresses.

9 10

9 10

1.2 Bracketing Methods 1.2 Bracketing Methods


1.2.1.1 Procedures Problem 1-1
1. Choose lower 𝑥 and upper 𝑥 guesses for the root such that Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping
the function changes sign over the interval. This can be criterion of 0.0001.
checked by ensuring that 𝑓 𝑥 𝑓 𝑥 < 0. 𝑓 𝑥 = 𝑥 − 3𝑥 − 6𝑥 + 8
2. An estimate of the root 𝑥 is determined by
𝑥 +𝑥
𝑥 =
2
3. Make the following evaluations to determine in which
subinterval the root lies
a. If 𝑓 𝑥 𝑓 𝑥 < 0, the root lies in the lower subinterval.
Therefore, set 𝑥 = 𝑥 and return to step 2.
b. If 𝑓 𝑥 𝑓 𝑥 > 0, the root lies in the lower subinterval.
Therefore, set 𝑥 = 𝑥 and return to step 2.
c. If 𝑓 𝑥 𝑓 𝑥 = 0 or more accurately, if 𝑓 𝑥 < 0.001
or 𝜀 < 𝜀, the root equals 𝑥 ; terminate the computation.
11 12

11 12

3
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.2 Bracketing Methods 1.2 Bracketing Methods


Problem 1-2 Problem 1-3
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping Find the roots of the equation below with a stopping criterion of
criterion of 0.0001. 0.001.
𝑓 𝑥 = 3𝑥 + 𝑠𝑖𝑛 𝑥 − 𝑒 𝑥 + 3 2𝑥 − 10
+ =3
𝑥 −5 𝑥 +3

13 14

13 14

1.2 Bracketing Methods 1.2 Bracketing Methods


Problem 1-4 1.2.2 False-Position Method
Aerospace engineers compute the trajectories of the projectiles Shortcoming of the bisection method is that, in dividing the
like rockets. A related problem deals with the trajectory of a interval from 𝑥 to 𝑥 into equal halves, no account is taken of
thrown ball. The trajectory of a ball thrown by a right fielder is the magnitudes of 𝑓(𝑥 ) and 𝑓(𝑥 ). For example, if 𝑓(𝑥 ) is
much closer to zero than 𝑓(𝑥 ), it is likely that the root is closer
defined by the (x, y) coordinates whose trajectory can be to 𝑥 than to 𝑥 , as shown in figure below.
modeled as:
𝑔𝑥
𝑦 = 𝑥 tan 𝜃 −
2𝑣 𝑐𝑜𝑠 𝜃
Find the approximate initial angle 𝜃 if 𝑣 = 20 𝑚/𝑠 and the
distance to second base is 40 m. Note that the throw leaves the
right fielder’s hand at an elevation of 1.8 m and the second
baseman receives it at 1 m.

15 16

15 16

4
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.2 Bracketing Methods 1.2 Bracketing Methods


• An alternative method that exploits this graphical insight is to 1.2.2.1 Procedures
join 𝑓(𝑥 ) and 𝑓(𝑥 ) by a straight line. The intersection of this 1. Choose lower 𝑥 and upper 𝑥 guesses for the root such that
line with the x axis represents an improved estimate of the the function changes sign over the interval. This can be
root. checked by ensuring that 𝑓 𝑥 𝑓 𝑥 < 0.
• The fact that the replacement of the curve by a straight line 2. An estimate of the root 𝑥 is determined by
gives a “false position” of the root, and is the origin of the
name, false position method, or in Latin, regula falsi. It is 𝑥 𝑓(𝑥 ) − 𝑥 𝑓(𝑥 )
𝑥 =
also called the linear interpolation method. 𝑓 𝑥 − 𝑓(𝑥 )
3. Make the following evaluations to determine in which
subinterval the root lies
a. If 𝑓 𝑥 𝑓 𝑥 < 0. the root lies in the lower subinterval.
Therefore, set 𝑥 = 𝑥 and return to step 2.
b. If 𝑓 𝑥 𝑓 𝑥 > 0. the root lies in the lower subinterval.
Therefore, set 𝑥 = 𝑥 and return to step 2.
c. If 𝑓 𝑥 𝑓 𝑥 = 0 or more accurately, if 𝑓 𝑥 < 0.001
or 𝜀 < 𝜀, the root equals 𝑥 ; terminate the computation.
17 18

17 18

1.2 Bracketing Methods 1.2 Bracketing Methods


1.2.2.2 Other Boundaries Problem 1-5
1. Although the false-position method would seem to always be Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping
the bracketing method of preference (false position is often criterion of 0.0001.
superior to bisection). 𝑓 𝑥 = 𝑥 − 3𝑥 − 6𝑥 + 8
2. There are cases where it performs poorly (bisection yields
superior results) as shown in figure below.

19 20

19 20

5
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.2 Bracketing Methods 1.2 Bracketing Methods


Problem 1-6 Problem 1-7
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping Find the roots of the equation below with a stopping criterion of
criterion of 0.0001. 0.0001.
𝑓 𝑥 = 3𝑥 + 𝑠𝑖𝑛 𝑥 − 𝑒 𝑥 + 3 2𝑥 − 10
+ =3
𝑥 −5 𝑥 +3

21 22

21 22

1.2 Bracketing Methods 1.2 Bracketing Methods


Problem 1-8 Problem 1-9
Aerospace engineers compute the trajectories of the projectiles For the simply supported beam shown below. Determine the
like rockets. A related problem deals with the trajectory of a location where the deflection is -1.00 mm. EI = 154,386.875 kN
thrown ball. The trajectory of a ball thrown by a right fielder is m2, with a stopping criterion of 0.0001.
defined by the (x, y) coordinates whose trajectory can be
modeled as:
𝑔𝑥
𝑦 = 𝑥 tan 𝜃 −
2𝑣 𝑐𝑜𝑠 𝜃
Find the approximate initial angle 𝜃 if 𝑣 = 20 𝑚/𝑠 and the
distance to second base is 40 m. Note that the throw leaves the
right fielder’s hand at an elevation of 1.8 m and the second
𝑑 𝑦 𝑀
baseman receives it at 1 m. =
𝑑𝑥 𝐸𝐼

23 24

23 24

6
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.2 Bracketing Methods 1.3 Open Methods


Determining Initial Guesses In contrast, the open methods described in this chapter are
• Plotting of the function is usually very useful in guiding you to based on formulas that require only a single starting value of x
determine all possible roots. or two starting values that do not necessarily bracket the root. As
such, they sometimes diverge (move away) from the true root
• Another option is to incorporate an incremental search at the as the computation progresses. However, when the open
beginning of the computer program. This consists of starting methods converge, they usually do so much more quickly than
at one end of the region of interest and then making function the bracketing methods.
evaluations at small increments across the region. When the
function changes sign, it is assumed that a root falls within
the increment.
• A partial remedy for such cases is to compute the first
derivative of the function at the beginning and the end of
each interval. If the derivative changes sign, it suggests that
a minimum or maximum may have occurred and that the
interval should be examined more closely for the existence of
a possible root.
25 26

25 26

1.3 Open Methods 1.3 Open Methods


1.3.1 Fixed-Point Method 1.3.1.1 Convergence
Open methods employ a formula to predict the root. Such a • True percent relative error for each iteration is roughly
formula can be developed for simple fixed-point iteration (or, as proportional to the error from the previous iteration. This
it is also called, one-point iteration or successive property, called linear convergence, and a characteristic of
substitution) by rearranging the function 𝑓 𝑥 = 0 so that 𝑥 is fixed-point iteration.
on the left-hand side of the equation: • If 𝑔′ 𝑥 < 1 the errors decrease each iteration, therefore the
𝑓 𝑥 =𝑔 𝑥 −𝑥 solution will converge.
0 = 𝑔 𝑥 −𝑥
𝑥 = 𝑔(𝑥 )

27 28

27 28

7
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.3 Open Methods 1.3 Open Methods


• If 𝑔′ 𝑥 > 1 the errors increase each iteration, therefore the Problem 1-10
solution will diverge.
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping
criterion of 0.0001.
𝑓 𝑥 = 𝑥 − 3𝑥 − 6𝑥 + 8

29 30

29 30

1.3 Open Methods 1.3 Open Methods


Problem 1-11 1.3.2 Newton-Raphson Method
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping Newton's method, also known as Newton-Raphson's method
criterion of 0.0001. is another iteration method for solving equations 𝑓 𝑥 = 0 ,
𝑓 𝑥 = 3𝑥 + 𝑠𝑖𝑛 𝑥 − 𝑒 where 𝑓 𝑥 is assumed to have a continuous derivative 𝑓′ 𝑥 .
The method is commonly used because of its simplicity and
great speed.

31 32

31 32

8
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.3 Open Methods 1.3 Open Methods


The underlying idea is that we approximate the graph of 𝑓 𝑥 by 1.3.2.1 Convergence
suitable tangents. Using an approximate value 𝑥 obtained from • True percent relative error for each iteration is roughly
the graph of 𝑓 𝑥 , we let 𝑥 be the point of intersection of the proportional to the square of the previous error.
x-axis and the tangent to the curve of 𝑓 at 𝑥 .
• This means that the number of correct decimal places
𝑓 𝑥 approximately doubles with each iteration. Such behavior is
𝑥 =𝑥 −
𝑓′ 𝑥 referred to as quadratic convergence.
−𝑓′′ 𝑥
𝜀 . ≅ 𝜀 ,
2𝑓′ 𝑥
• There is no general convergence criterion for Newton-
Raphson. Its convergence depends on the nature of the
function and on the accuracy of the initial guess. The only
remedy is to have an initial guess that is “sufficiently” close to
the root.

33 34

33 34

1.3 Open Methods 1.3 Open Methods


Problem 1-12 Problem 1-13
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping
criterion of 0.0001. criterion of 0.0001.
𝑓 𝑥 = 𝑥 − 3𝑥 − 6𝑥 + 8 𝑓 𝑥 = 3𝑥 + 𝑠𝑖𝑛 𝑥 − 𝑒

35 36

35 36

9
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.3 Open Methods 1.3 Open Methods


Problem 1-14 Problem 1-15
Find the roots of the equation below with a stopping criterion of Aerospace engineers compute the trajectories of the projectiles
0.0001. like rockets. A related problem deals with the trajectory of a
𝑥 + 3 2𝑥 − 10 thrown ball. The trajectory of a ball thrown by a right fielder is
+ =3 defined by the (x, y) coordinates whose trajectory can be
𝑥 −5 𝑥 +3
modeled as:
𝑔𝑥
𝑦 = 𝑥 tan 𝜃 −
2𝑣 𝑐𝑜𝑠 𝜃
Find the approximate initial angle 𝜃 if 𝑣 = 20 𝑚/𝑠 and the
distance to second base is 40 m. Note that the throw leaves the
right fielder’s hand at an elevation of 1.8 m and the second
baseman receives it at 1 m.

37 38

37 38

1.3 Open Methods 1.3 Open Methods


Problem 1-16 Problem 1-17
For the simply supported beam shown below. Determine the The saturation concentration of dissolved oxygen in freshwater
location where the deflection is -1.00 mm. EI = 154,386.875 kN can be calculated with the equation below where 𝜎 is the
m2, with a stopping criterion of 0.0001. saturation concentration of dissolved oxygen in freshwater at 1
atm (mg/L) and 𝑇 is the absolute temperature (𝐾). Determine
the maximum and minimum temperature in ( ℃ ) for the
recommended dissolved oxygen of 4-14 mg/L for shallow water
fish.

𝑑 𝑦 𝑀
=
𝑑𝑥 𝐸𝐼

39 40

39 40

10
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.3 Open Methods 1.3 Open Methods


Problem 1-18 1.3.3 Secant Method
Find the positive root of the equation below with a stopping Newton's method is very powerful but has the disadvantage that
criterion of 0.0001. the derivative 𝑓′ 𝑥 may sometimes be a far more difficult
expression than 𝑓 𝑥 itself and its evaluation therefore
𝑓 𝑥 =𝑥 −1 computationally expensive. The derivative can be approximated
by a backward finite divided difference.
𝑓 𝑥 −𝑓 𝑥
𝑓′ 𝑥 ≅
𝑥 −𝑥

41 42

41 42

1.3 Open Methods 1.3 Open Methods


This approximation can be substituted into the Newton-Raphson 1.3.3.1 Secant Method vs False-Position Method
equation to yield the iterative equation: • Note the similarity between the secant method and the false-
𝑥 −𝑥 position method. Both use two initial estimates to compute
𝑥 = 𝑥 −𝑓 𝑥
𝑓 𝑥 −𝑓 𝑥 an approximation of the slope of the function that is used to
project to the x axis for a new estimate of the root.
• In false-position method two estimates always bracket the
root. Therefore, for all practical purposes, the method always
converges because the root is kept within the bracket.
• In contrast, the secant method replaces the values in strict
sequence, with the new value 𝑥 replacing 𝑥 and 𝑥
replacing 𝑥 . As a result, the two values can sometimes lie
on the same side of the root. For certain cases, this can lead
to divergence.

43 44

43 44

11
Prepared by;
Gabriel I. Gamana, CE, MSCE

1.3 Open Methods 1.3 Open Methods


Problem 1-19 Problem 1-20
Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping Find the roots of the equation where 𝑓 𝑥 = 0 with a stopping
criterion of 0.0001. criterion of 0.0001.
𝑓 𝑥 = 𝑥 − 3𝑥 − 6𝑥 + 8 𝑓 𝑥 = 3𝑥 + 𝑠𝑖𝑛 𝑥 − 𝑒

45 46

45 46

References
• Chapra, S. C. & Canale, R. P. “Numerical Methods for
Engineers” 7th Edition, McGraw-Hill Education, 2015
• Kreyszig, E. “Advanced Engineering Mathematics” 9th
Edition, John Wiley & Sons. Inc., Singapore, 2006

47

47

12

You might also like