0% found this document useful (0 votes)
20 views26 pages

IPE 329, Truncation Error and Taylor Series

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)
20 views26 pages

IPE 329, Truncation Error and Taylor Series

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/ 26

9/9/2020

Lecture 05: Roots and


Optimization: Bracketing
Methods

Bangladesh University of Eng. & Tech. Slide 1 of 52 Industrial &Production Engineering

Roots of Equations

• Roots are sometimes called the zeros of the equation.


• Methods:
– Direct methods
– Approximate solution techniques

Bangladesh University of Eng. & Tech. Slide 2 of 52 Industrial &Production Engineering

1
9/9/2020

Roots of Equations
• An approximate solution technique  graphical methods.
• Plot the function and determine where it crosses the x axis.
• Although graphical methods are useful for obtaining rough
estimates of roots, they are limited because of their lack of
precision.
• An alternative approach is to use trial and error.
• This technique consists of guessing a value of x and
evaluating whether f(x) is zero.
• If not (as is almost always the case), another guess is made,
and f(x) is again evaluated to determine whether the new
value provides a better estimate of the root.

Bangladesh University of Eng. & Tech. Slide 3 of 52 Industrial &Production Engineering

Optimization
• Besides roots, another feature of interest to engineers
and scientists are a function’s minimum and maximum
values  referred to as optimization.
• From a numerical standpoint, such optimization methods
are similar in spirit to the root-location methods.
• Both involve guessing and searching for a location on a
function.
• Root location involves searching for the location where
the function equals zero.
• In contrast, optimization involves searching for the
function’s extreme points.
Bangladesh University of Eng. & Tech. Slide 4 of 52 Industrial &Production Engineering

2
9/9/2020

Difference between Roots and


Optima

Bangladesh University of Eng. & Tech. Slide 5 of 52 Industrial &Production Engineering

Roots: Bracketing Methods


• Example
Medical studies have established that a bungee jumper’s chances of
sustaining a significant vertebrae injury increase significantly if the
free-fall velocity exceeds 36 m/s after 4 s of free fall. Your boss at
the bungee-jumping company wants you to determine the mass at
which this criterion is exceeded given a drag coefficient of 0.25
kg/m.
You know from your previous studies that the following analytical
solution can be used to predict fall velocity as a function of time:

Try as you might, you cannot manipulate this equation to explicitly


solve for m  you cannot isolate the mass on the left side of the
equation.
Bangladesh University of Eng. & Tech. Slide 6 of 52 Industrial &Production Engineering

3
9/9/2020

Roots: Bracketing Methods


• Example
– Solution

• The value of m that makes f(m) = 0 is, therefore, the root


of the equation.

Bangladesh University of Eng. & Tech. Slide 7 of 52 Industrial &Production Engineering

Roots in Engineering and


Science

Bangladesh University of Eng. & Tech. Slide 8 of 52 Industrial &Production Engineering

4
9/9/2020

Example 1: Graphical Methods

Bangladesh University of Eng. & Tech. Slide 9 of 52 Industrial &Production Engineering

Graphical Methods

• Graphical techniques are of limited practical value


because they are not very precise.
• However, graphical methods can be utilized to obtain
rough estimates of roots.
• These estimates can be employed as starting guesses
for numerical methods discussed later in this lecture.
• Also, graphical interpretations are useful for
understanding the properties of the functions and
anticipating the pitfalls of the numerical methods.

Bangladesh University of Eng. & Tech. Slide 10 of 52 Industrial &Production Engineering

5
9/9/2020

Graphical Methods

Bangladesh University of Eng. & Tech. Slide 11 of 52 Industrial &Production Engineering

Graphical Methods
• In general, if f(xl) and f(xu) have opposite signs, there are an
odd number of roots in the interval.
• If f(xl) and f(xu) have the same sign, there are either no roots
or an even number of roots between the values.
• Although these generalizations are usually true, there are
cases where they do not hold.
• For example, functions that are tangential to the x axis and
discontinuous functions can violate these principles.
• An example of a function that is tangential to the axis is the
cubic equation f(x) = (x − 2)(x − 2)(x − 4).
• Notice that x = 2 makes two terms in this polynomial equal to
zero. Mathematically, x = 2 is called a multiple root.
Bangladesh University of Eng. & Tech. Slide 12 of 52 Industrial &Production Engineering

6
9/9/2020

Example 2: Graphical Methods

Bangladesh University of Eng. & Tech. Slide 13 of 52 Industrial &Production Engineering

Example 2: Graphical Methods

Bangladesh University of Eng. & Tech. Slide 14 of 52 Industrial &Production Engineering

7
9/9/2020

Numerical Methods

• Two major classes of methods available:


– Bracketing methods  As the name implies, these are based on
two initial guesses that bracket the root that are on either side of
the root.
– Open methods  These methods can involve one or more initial
guesses, but there is no need for them to bracket the root.

• For well-posed problems, the bracketing methods always


work but converge slowly.
• In contrast, the open methods do not always work (i.e.,
they can diverge), but when they do they usually
converge quicker.

Bangladesh University of Eng. & Tech. Slide 15 of 52 Industrial &Production Engineering

Bracketing Methods

• These methods exploit the fact that a function typically


changes sign in the vicinity of a root.
• These techniques are called bracketing methods
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.

Bangladesh University of Eng. & Tech. Slide 16 of 52 Industrial &Production Engineering

8
9/9/2020

Incremental Search

• In general, if f(x) is real and continuous in the interval


from xl to xu and f(xl) and f(xu) have opposite signs, i.e.,
f(xl) f(xu) < 0, then there is at least one real root between
xl and xu.
• Incremental search methods capitalize on this
observation by locating an interval where the function
changes sign.

Bangladesh University of Eng. & Tech. Slide 17 of 52 Industrial &Production Engineering

Incremental Search

• Then the location of the sign change (and consequently,


the root) is identified more precisely by dividing the
interval into a number of subintervals.
• Each of these subintervals is searched to locate the sign
change.
• The process is repeated and the root estimate refined by
dividing the subintervals into finer increments.

Bangladesh University of Eng. & Tech. Slide 18 of 52 Industrial &Production Engineering

9
9/9/2020

Incremental Search

• A potential problem with an incremental search is the


choice of the increment length.
• If the length is too small, the search can be very time
consuming.
• On the other hand, if the length is too great, there is a
possibility that closely spaced roots might be missed .
• The problem is compounded by the possible existence of
multiple roots.

Bangladesh University of Eng. & Tech. Slide 19 of 52 Industrial &Production Engineering

Incremental Search

Bangladesh University of Eng. & Tech. Slide 20 of 52 Industrial &Production Engineering

10
9/9/2020

Example 3 : Incremental Search

Bangladesh University of Eng. & Tech. Slide 21 of 52 Industrial &Production Engineering

Example 3 : Incremental Search

• The foregoing example illustrates that brute-force methods such as


incremental search are not foolproof.
• You would be wise to supplement such automatic techniques with
any other information that provides insight into the location of the
roots.
Bangladesh University of Eng. & Tech. Slide 22 of 52 Industrial &Production Engineering

11
9/9/2020

Bisection Method
• The bisection method is also known as binary chopping,
interval halving, or Bolzano’s method.
• It is a variation of the 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 within
the subinterval where the sign change occurs.
• The subinterval then becomes the interval for the next
iteration.
• The process is repeated until the root is known to the
required precision.
Bangladesh University of Eng. & Tech. Slide 23 of 52 Industrial &Production Engineering

Bisection Method

Bangladesh University of Eng. & Tech. Slide 24 of 52 Industrial &Production Engineering

12
9/9/2020

Bisection Method

Bangladesh University of Eng. & Tech. Slide 25 of 52 Industrial &Production Engineering

Example 4: Bisection Method

Bangladesh University of Eng. & Tech. Slide 26 of 52 Industrial &Production Engineering

13
9/9/2020

Example 4: Bisection Method

Bangladesh University of Eng. & Tech. Slide 27 of 52 Industrial &Production Engineering

Termination Criteria and Error


Estimates

• When εa becomes less than a prespecified stopping


criterion εs, the computation is terminated.

Bangladesh University of Eng. & Tech. Slide 28 of 52 Industrial &Production Engineering

14
9/9/2020

Example 5: Bisection Method

Bangladesh University of Eng. & Tech. Slide 29 of 52 Industrial &Production Engineering

Example 5: Bisection Method

Bangladesh University of Eng. & Tech. Slide 30 of 52 Industrial &Production Engineering

15
9/9/2020

Termination Criteria and Error


Estimates
• It can be demonstrated that |εa| will always be greater
than |εt | for bisection.
• This is due to the fact that each time an approximate root
is located using bisection as xr = (xl + xu)/2, we know that
the true root lies somewhere within an interval of Δx = xu
− xl .
• Therefore, the root must lie within ±Δx/2 of our estimate.

Bangladesh University of Eng. & Tech. Slide 31 of 52 Industrial &Production Engineering

Termination Criteria and Error


Estimates

Bangladesh University of Eng. & Tech. Slide 32 of 52 Industrial &Production Engineering

16
9/9/2020

Termination Criteria and Error


Estimates

Provides an exact upper


bound on
the true error
Bangladesh University of Eng. & Tech. Slide 33 of 52 Industrial &Production Engineering

Termination Criteria and Error


Estimates
• It is also possible to calculate an error estimate on the
basis of our initial guesses—that is, on our first iteration.

Bangladesh University of Eng. & Tech. Slide 34 of 52 Industrial &Production Engineering

17
9/9/2020

Termination Criteria and Error


Estimates
• Another benefit of the bisection method is that the
number of iterations required to attain an absolute error
can be computed a priori—i.e., before starting the
computation.

Ea,d is the desired


error

Bangladesh University of Eng. & Tech. Slide 35 of 52 Industrial &Production Engineering

Example 5: Bisection Method


(Cont’d)

Bangladesh University of Eng. & Tech. Slide 36 of 52 Industrial &Production Engineering

18
9/9/2020

Bisection Algorithm

Bangladesh University of Eng. & Tech. Slide 37 of 52 Industrial &Production Engineering

Minimizing Function Evaluations

(n+1) function
evaluations are
performed, rather
than 2n

Bangladesh University of Eng. & Tech. Slide 38 of 52 Industrial &Production Engineering

19
9/9/2020

False Position Method

• False position is also known as the linear interpolation


method.
• It is very similar to bisection with the exception that it
uses a different strategy to come up with its new root
estimate.
• False position is an alternative based on a graphical
insight.
• A shortcoming of the bisection method is that, in dividing
the interval from xl to xu into equal halves, no account is
taken of the magnitudes of f(xl) and f(xu).

Bangladesh University of Eng. & Tech. Slide 39 of 52 Industrial &Production Engineering

False Position Method


• Rather than bisecting the
interval, it locates the root
by joining f(xl) and f(xu)
with a straight line.
• The intersection of this
line with the x axis
represents an improved
estimate of the root.
• Thus, the shape of the
function influences the
new root estimate.

Bangladesh University of Eng. & Tech. Slide 40 of 52 Industrial &Production Engineering

20
9/9/2020

False Position Method

• 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.

Bangladesh University of Eng. & Tech. Slide 41 of 52 Industrial &Production Engineering

Derivation of the Method of False


Position

• The later involves one less function evaluation and one


less multiplication than the former.
Bangladesh University of Eng. & Tech. Slide 42 of 52 Industrial &Production Engineering

21
9/9/2020

Example 6: False-Position Method

Bangladesh University of Eng. & Tech. Slide 43 of 52 Industrial &Production Engineering

Example 6: False-Position Method

Bangladesh University of Eng. & Tech. Slide 44 of 52 Industrial &Production Engineering

22
9/9/2020

Comparison of Relative Errors

• The error for false position


decreases much faster than
for bisection because of the
more efficient scheme for root
location in the false-position
method.

Bangladesh University of Eng. & Tech. Slide 45 of 52 Industrial &Production Engineering

Pitfalls of False-Position Method

• A major weakness of the false-position method: its one-


sidedness.
• That is, as iterations are proceeding, one of the
bracketing points will tend to stay fixed.
• This can lead to poor convergence, particularly for
functions with significant curvature.

Bangladesh University of Eng. & Tech. Slide 46 of 52 Industrial &Production Engineering

23
9/9/2020

Example 7: A Case where Bisection


is Preferable to False Position

Bangladesh University of Eng. & Tech. Slide 47 of 52 Industrial &Production Engineering

Example 7: A Case where Bisection


is Preferable to False Position

• After five iterations, the true error has only been reduced
to about 59 percent.
• In addition, note that εa < εt  the approximate error is
misleading.
Bangladesh University of Eng. & Tech. Slide 48 of 52 Industrial &Production Engineering

24
9/9/2020

Example 7: A Case where Bisection


is Preferable to False Position

• The curve violates the


premise upon which false
position was based—that is, if
f(xl) is much closer to zero
than f(xu), then the root is
closer to xl than to xu.
• Because of the shape of the
present function, the opposite
is true.

Bangladesh University of Eng. & Tech. Slide 49 of 52 Industrial &Production Engineering

Modified False Position

• One way to mitigate the “one-sided” nature of false


position is to have the algorithm detect when one of the
bounds is stuck.
• If this occurs, the function value at the stagnant bound
can be divided in half.
• This is called the modified false-position method.

Bangladesh University of Eng. & Tech. Slide 50 of 52 Industrial &Production Engineering

25
9/9/2020

Modified False Position

Bangladesh University of Eng. & Tech. Slide 51 of 52 Industrial &Production Engineering

Assignment-05

• Problems 5.1, 5.4, 5.9, 5.15, 5.17.

Bangladesh University of Eng. & Tech. Slide 52 of 52 Industrial &Production Engineering

26

You might also like