Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
120 views

02+Nonlinear+Equations+ +Bisection+Method

The document summarizes the bisection method for finding the roots of nonlinear equations. It begins with introducing the intermediate value theorem, which states that if a continuous function changes sign over an interval, then there is at least one root in that interval. The bisection method then works by repeatedly bisecting the interval and narrowing in on the root, where the function changes sign, until reaching the desired precision. It provides examples of applying these concepts to demonstrate the method.

Uploaded by

Bruh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views

02+Nonlinear+Equations+ +Bisection+Method

The document summarizes the bisection method for finding the roots of nonlinear equations. It begins with introducing the intermediate value theorem, which states that if a continuous function changes sign over an interval, then there is at least one root in that interval. The bisection method then works by repeatedly bisecting the interval and narrowing in on the root, where the function changes sign, until reaching the desired precision. It provides examples of applying these concepts to demonstrate the method.

Uploaded by

Bruh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

3/21/21

KA20602 NUMERICAL ANALYSIS

Lecture 2
NONLINEAR EQUATIONS - BISECTION METHOD
AHMAD NURFAIDHI RIZALMAN (PhD)
Civil Engineering Programme
, No. 66 Level 2 Block A, Faculty of Engineering
( 088 – 320000 (ext. 3033) + ahmadnurfaidhi@ums.edu.my
Prepared by: Ahmad Nurfaidhi Rizalman

CONTENT

q Introduction
q Intermediate Value Theorem
Ø Question 2.1 to 2.2
q Bisection Method
Ø Question 2.3 to 2.8
q Applications in Civil Engineering
Ø Question 2.9 Location of Maximum Bending Moment

Prepared by: Ahmad Nurfaidhi Rizalman

1
3/21/21

INTRODUCTION

Prepared by: Ahmad Nurfaidhi Rizalman

INTRODUCTION
• MathemaEcal model in science and engineering involve equaEons that need to be solved.

• EquaEons of one variable can be formulated as:

𝑓 𝑥 =0 (2.1)

• EquaEon (2.1) can be in the form of linear and nonlinear.

• Solving EquaEon (2.1) means that finding the values of 𝑥 that saEsfying the equaEon.

Prepared by: Ahmad Nurfaidhi Rizalman

2
3/21/21

INTRODUCTION

1. Polynomial Equa9ons (contains 1 variable)


Example: 𝑥 ! + 2𝑥 − 4 = 0

2. Algebraic Equations (contains more than 1


Equation (2.1) may be belong to variables)
one of the following types of
equations: Example: 4𝑥 − 3𝑥 ! 𝑦 − 15 = 0

3. Transcendental Equations (a non-algebraic


equation of trigonometric, exponential and logarithm
function)
Example: sin 2𝑥 − 3𝑥 = 0

Prepared by: Ahmad Nurfaidhi Rizalman

INTRODUCTION

Problems Methods Solutions

Factorization

Finding roots for


Quadratic Equations Analytical Completing the Exact
!
𝑓 𝑥 = 𝑎𝑥 + 𝑏𝑥 + 𝑐 Methods Square Solutions

Quadra;c Formula
−𝑏 ± 𝑏! + 4𝑎𝑐
𝑥=
2𝑎

Prepared by: Ahmad Nurfaidhi Rizalman

3
3/21/21

INTRODUCTION

Problems Methods Solu9ons

Due to the Bracketing Methods


complexity of a) Bisection Method
the equations in b) False Position
modelling the Method Numerical
Numerical Solutions
real-life system,
the exact
method (or Approximate)
solutions are Open Methods
often difficult to a) Newton Raphson
be found. Method
b) Secant Method

Prepared by: Ahmad Nurfaidhi Rizalman

INTERMEDIATE VALUE THEOREM

Prepared by: Ahmad Nurfaidhi Rizalman

4
3/21/21

INTERMEDIATE VALUE THEOREM


• The root of nonlinear equation 𝑓 𝑥 = 0 can be roughly located by plotting the graph
manually or by mathematical software.

• But, if we want to locate the interval of root without plotting graph, we can applied
Intermediate Value Theorem.

• In the theorem, say 𝑓 𝑥 = 0 is a nonlinear equation and 𝑓 𝑎 𝑏 < 0, then it is


guaranteed that exists at least a root in the interval 𝑎, 𝑏 .

Prepared by: Ahmad Nurfaidhi Rizalman

INTERMEDIATE VALUE THEOREM

(a) (b)
Graphical view of of Intermediate Value of Theorem

Prepared by: Ahmad Nurfaidhi Rizalman

10

5
3/21/21

QUESTION 2.1
Given 𝑥 + ln 𝑥 = 0 . Show that there is a root in the following interval by using Intermediate
Value Theorem.
a) [0.2, 1]
b) [0.4, 0.6]

Prepared by: Ahmad Nurfaidhi Rizalman

11

SOLUTIONS TO QUESTION 2.1


Solutions to Question 2.1a)
𝑓 𝑥 = 𝑥 + ln 𝑥, 𝑎, 𝑏 = 0.2,1
𝑓(0.2) = −1.409, 𝑓 1 = 1, so 𝑓 0.2 𝑓 1 < 0. Thus, there is at least a root in the interval
0.2,1 by using Intermediate Value Theorem.

Solutions to Question 2.1b)


𝑓 𝑥 = 𝑥 + ln 𝑥, 𝑎, 𝑏 = 0.4,0.6
𝑓(0.4) = −0.516, 𝑓 0.6 = 0.089, so 𝑓 0.4 𝑓 0.6 < 0. Thus, there is at least a root in the
interval 0.2,1 by using Intermediate Value Theorem.

Prepared by: Ahmad Nurfaidhi Rizalman

12

6
3/21/21

QUESTION 2.2
Given the graph of the the funcEon 𝑓 𝑥 = sin 2𝑥 + 𝑥 ! − 3 . Choose 𝑎, 𝑏 that saEsfies
𝑏 − 𝑎 = 1. Then, show that there is a root in the chosen 𝑎, 𝑏 by using Intermediate Value
Theorem.

Prepared by: Ahmad Nurfaidhi Rizalman

13

SOLUTIONS TO QUESTION 2.2


Note: Do the calculation in radian.
From the graph 𝑓 𝑥 = sin 2𝑥 + 𝑥 ! − 3, it was found that 𝑥 −intercept is in the coordinate
between 𝑥 = 1,2 so 𝑎, 𝑏 = 1,2 .

𝑓 1 = −1.091, 𝑓 2 = 4.243, so 𝑓(1)(2) < 0. Thus, there is at least a root in the interval
1,2 by using Intermediate Value Theorem.

Prepared by: Ahmad Nurfaidhi Rizalman

14

7
3/21/21

BISECTION METHOD

Prepared by: Ahmad Nurfaidhi Rizalman

15

BISECTION METHOD
In general, if 𝑓(𝑥) is real and conEnuous in the interval from 𝑥" to 𝑥# and 𝑓 𝑥" and 𝑓 𝑥#
have opposite signs, that is 𝑓 𝑥" 𝑓 𝑥# < 0, then there is at least one real root between 𝑥"
and 𝑥# .

Figure 2.1 Root is between lower bound 𝑥" and upper bound 𝑥#
Prepared by: Ahmad Nurfaidhi Rizalman

16

8
3/21/21

BISECTION METHOD

3. The location of the root is then


1. The bisection method is also called determined as lying at the midpoint of
as binary chopping, interval halving, the subinterval within which the sign
or Bolzano’s method. change occurs. The process is
repeated to obtain refined estimates.

Bisection Method

4. To be more precise in the definition,


2. The interval is divided into half. If a
suppose an interval 𝑥", 𝑥$ satisfying
funcQon changes sign over an
𝑓 𝑥 = 0 and an error tolerance 𝜀 >
interval, the funcQon value at the
0. If |𝑥$ − 𝑥%| ≤ 𝜀, then accept 𝑥% as
midpoint is evaluated.
the root and stop the calculation.

Prepared by: Ahmad Nurfaidhi Rizalman

17

BISECTION METHOD – STEP PROCESS


The step process in bisection method is as follows:
Step 1 Choose lower 𝑥" and upper 𝑥# guesses for the root such that the function 𝑓(𝑥)
changes sign over the interval. This can be checked by ensuring that 𝑓(𝑥" )(𝑥# ) < 0.

Step 2 An estimate of the root 𝑥$ is determined by


%, &%-
Step 1 𝑥$ =Choose
' lower 𝑥 and upper 𝑥 guesses for the root such that the function 𝑓(𝑥)
" #

Step 3 Make the following evaluations to determine which subinterval the root lies:
a) If 𝑓(𝑥" )(𝑥$ ) < 0, the root lies in the lower subinterval. Then, set 𝑥# = 𝑥$ and
return to Step 2.
b) If 𝑓(𝑥" )(𝑥$ ) > 0, the root lies in the upper subinterval. Then, set 𝑥" = 𝑥$ and
return to Step 2.
c) If 𝑓 𝑥" 𝑥$ = 0, the root equals 𝑥$ . Then, terminate the computation.
Prepared by: Ahmad Nurfaidhi Rizalman

18

9
3/21/21

BISECTION METHOD
The followings are graphical representation for Step 3a) and b), respectively

Figure 2.2 𝑓 𝑥" 𝑥$ < 0, the root lies in the Figure 2.3 𝑓 𝑥" 𝑥$ > 0, the root lies in the
lower subinterval. Therefore, set 𝑥# = 𝑥$ upper subinterval. Therefore, set 𝑥" = 𝑥$ .

Prepared by: Ahmad Nurfaidhi Rizalman

19

BISECTION METHOD – STEP PROCESS


The
Stepstep
4 process in bisection
If required, calculatemethod is as follows:
the approximate percent relative error, 𝜀" in percentage
()*+*,- ()*./01+
𝑥$ − 𝑥$
𝜀" = ()*+*,- ×100%
𝑥$

Step 5 Compare 𝜀+ with 𝜀" . If 𝜀" < 𝜀+ , then stop the computation. Otherwise, go to Step 2
Step 1 Choosethe
and repeat lower 𝑥" and
process uppernew
by using 𝑥# guesses
interval.for the root such that the function 𝑓(𝑥)

Prepared by: Ahmad Nurfaidhi Rizalman

20

10
3/21/21

BISECTION METHOD – STEP PROCESS


Convergence criteria for Bisection Method
Suppose a continuous function 𝑓𝜖 𝑎, 𝑏 and 𝑓 𝑎 𝑏 < 0. The bisection method generates a
sequence 𝑐/ 4/23 approximating the root, 𝑟 of 𝑓 with

#5"
𝑟 − 𝑐/ ≤ './0
, where 𝑖 ≥ 0

where 𝑟 − 𝑐/ is also known as absolute tolerance.

Prepared by: Ahmad Nurfaidhi Rizalman

21

QUESTION 2.3
Use three (3) iterations of the bisection method to determine the root of the function
below. Employ initial guesses of 𝑥" = 1.2 and 𝑥# = 2.

𝑓 𝑥 = 𝑥 ! − 7.5𝑥 ' + 17.75𝑥 − 13.125

Prepared by: Ahmad Nurfaidhi Rizalman

22

11
3/21/21

SOLUTIONS TO QUESTION 2.3


% &%
To find 𝑥$ , use formula 𝑥$ = , ' - .
Then, insert 𝑥" and 𝑥$ to 𝑓(𝑥) to find 𝑓 𝑥" and 𝑓 𝑥$

𝑖 𝑥" 𝑥# 𝑥$ 𝑓 𝑥" 𝑓 𝑥# 𝑓 𝑥$
1 1.2 2 6.'&' −0.897 0.375 0.171
'
= 1.6
2 1.2 1.6 6.'&6.8 −0.897 0.171 −0.231
'
= 1.4
3 1.4 1.6 6.9&6.8 −0.231 0.171 0
'
= 1.5

After three iterations, the approximate root of 𝑓(𝑥) is 𝑥$ = 1.5.

Prepared by: Ahmad Nurfaidhi Rizalman

23

QUESTION 2.4
Find the highest root of the quadratic function below using three iterations of the bisection
method. Use initial guesses, 𝑥: = 5 and 𝑥1 = 10. Then, compute approximate percent relative
error, 𝜀" and true percent relative error, 𝜀- after each iteration process.

𝑓 𝑥 = −0.6𝑥 ' + 2.4𝑥 + 5.5

Prepared by: Ahmad Nurfaidhi Rizalman

24

12
3/21/21

SOLUTIONS TO QUESTION 2.4


Note that to find 𝜀" and 𝜀- , the true (or exact) value of 𝑥 needed to calculated first. Therefore,
since the function 𝑓(𝑥) is a quadratic function, the true value can be calculated by using the
quadratic formula as follows:

5'.9± '.9 1 59(53.8)(>.>)


𝑥 = '(53.8)
= 2 ± −3.6286
𝑥 = −1.6286, 5.6286

Since the question specify for the highest root, therefore the true value selected in this
problem is 𝑥- = 5.6286.

Prepared by: Ahmad Nurfaidhi Rizalman

25

SOLUTIONS TO QUESTION 2.4


Then, estimate the root of 𝑓(𝑥) by using Bisection method with the given initial guess which
are 𝑥: = 5 and 𝑥1 = 10.

First iteration, 𝑥 ∈ 5,10


'
𝑓 5 = −0.6 5 + 2.4 5 + 5.5 = 2.5000
𝑓 10 = −0.6 5 ' + 2.4 5 + 5.5 = −30.5000

First estimate using bisection method formula,


>&63
𝑥$ = ' = 7.50
'
𝑓(7.5) = −0.6 7.5 + 2.4 7.5 + 5.5 = −10.25

Since 𝑓 𝑥" . 𝑓 𝑥$ < 0, the root lies in the lower subinterval. Then, 𝑥# = 7.5,
>.8'?85@.>3
𝜀- = >.8'?8
×100 = 33.23%, and 𝜀" = −.

Prepared by: Ahmad Nurfaidhi Rizalman

26

13
3/21/21

SOLUTIONS TO QUESTION 2.4


Second iteration, 𝑥 ∈ 5,7.5 .
Improve estimation using bisection method formula,
>&@.>
𝑥$ = ' = 6.25
𝑓(6.25) = −0.6(6.25)'+2.4 6.25 + 5.5 = −2.9375

Since 𝑓 𝑥" . 𝑓 𝑥$ < 0, the root lies in the lower subinterval. Then, 𝑥# = 6.25,
>.8'?858.'> 8.'>5@.>
𝜀- = >.8'?8
×100 = 11.04%, and 𝜀" = 8.'>
×100 = 20%

Prepared by: Ahmad Nurfaidhi Rizalman

27

SOLUTIONS TO QUESTION 2.4


Continue the third iteration for 𝑥 ∈ 5,6.25 and the computational process is summarized as
in the table.
𝑖 𝑥" 𝑥$ 𝑥% 𝑓(𝑥" ) 𝑓(𝑥$ ) 𝑓(𝑥% ) 𝑓 𝑥" . 𝑓 𝑥% 𝜀& (%) 𝜀" (%)
1 5 10 7.5 2.5 -30.5 -10.25 -25.626 33.25 -
2 5 7.5 6.25 2.5 -10.25 -2.9375 -7.3438 11.04 20.00
3 5 6.25 5.625 2.5 -2.9375 0.0156 0.0391 0.06 11.11

Therefore, after three iterations the approximate root of 𝑓(𝑥) is 𝑥$ = 5.6250 with 𝜀- =
0.06% and 𝜀" = 11.11%.

Prepared by: Ahmad Nurfaidhi Rizalman

28

14
3/21/21

QUESTION 2.5
Use bisection method to determine the root of sin 𝑥 = 𝑥 ! where 𝑥 is in radian. Employ initial
guesses, 𝑥" = 0.5 and 𝑥1 = 1. Perform the computation until 𝜀" < 𝜀" = 2%.

Prepared by: Ahmad Nurfaidhi Rizalman

29

SOLUTIONS TO QUESTION 2.5


Rewrite the function, 𝑓 𝑥 = sin 𝑥 − 𝑥 !.
𝑖 𝑥" 𝑥$ 𝑥% 𝑓(𝑥" ) 𝑓(𝑥$ ) 𝑓(𝑥% ) 𝑓 𝑥" . 𝑓 𝑥% 𝜀" (%)
1 0.5000 1.0000 0.7500 0.3544 -0.1585 0.2598 0.0921 -
2 0.7500 1.0000 0.8750 0.2598 -0.1585 0.0976 0.0254 14.29
3 0.8750 1.0000 0.9375 0.0976 -0.1585 -0.0179 -0.0017 6.67
4 0.8750 0.9375 0.9063 0.0976 -0.0179 0.0429 0.0042 3.45
5 0.9063 0.9375 0.9219 0.0429 -0.0179 0.0133 0.0006 1.69

Therefore, after five iterations the approximate root of 𝑓(𝑥) is 𝑥$ = 0.9219 with 𝜀" =
1.69% < 𝜀+ .

Prepared by: Ahmad Nurfaidhi Rizalman

30

15
3/21/21

QUESTION 2.6
The lateral surface area, 𝑆 is given by 𝑆 = 𝜋𝑟 𝑟 ' + ℎ' where 𝑟 is the radius of the base and ℎ
is the height. Determine the radius of a cone which has a surface area of 1500 𝑚' and a height
of 25 𝑚, by using bisection method. Perform the computation up to three iterations with the
initial guesses of 𝑟" = 15 and 𝑟# = 18.

Prepared by: Ahmad Nurfaidhi Rizalman

31

SOLUTIONS TO QUESTION 2.6


To find the approximate radius, the function of radius is written as
𝑓 𝑟 = 𝜋𝑟 𝑟 ' + 625 − 1500

𝑖 𝑥" 𝑥$ 𝑥% 𝑓(𝑥" ) 𝑓(𝑥$ ) 𝑓(𝑥% ) 𝑓 𝑥" . 𝑓 𝑥% 𝜀" (%)


1 15.0000 18.0000 16.5000 -126.1143 242.0294 52.7107 -6647.5765 -
2 15.0000 16.5000 15.7500 -126.1143 52.7107 -37.9807 4789.9136 4.7600
3 15.7500 16.5000 16.1250 -37.9807 52.7107 7.0410 -267.4219 2.3300

Therefore, after three iterations the approximate radius of a cone is 𝑟 = 16.125 𝑚.

Prepared by: Ahmad Nurfaidhi Rizalman

32

16
3/21/21

QUESTION 2.7
Given the graph of 𝑔 𝑥 = 𝑒 % and ℎ 𝑥 = cos 𝑥 over
the interval −2,2 .
a) Choose 𝑎, 𝑏 that satisfies 𝑏 − 𝑎 = 1. Then,
show that there is a negative value of 𝑥 with
𝑔 𝑥 = ℎ(𝑥) in the chosen 𝑎, 𝑏 by using
Intermediate Value Theorem.
b) Find the negative value with 𝑒 % = cos 𝑥 by using
bisection with 𝑏 − 𝑎 = 1. Do your calculation in
3 decimal places.
c) Find the negative value with 𝑒 % = cos 𝑥 by using
bisection with 𝑏 − 𝑎 = 1. Do your calculation in
9 decimal places. Approximate the value of 𝑥 to
within an absolute tolerance of 0.02.

Prepared by: Ahmad Nurfaidhi Rizalman

33

SOLUTIONS TO QUESTION 2.7


Solutions to Question 2.7a)
Let 𝑓 𝑥 = 𝑔 𝑥 − ℎ(𝑥)
𝑓 𝑥 = 𝑒 % − cos 𝑥, 𝑎, 𝑏 = −2, −1
𝑓 −2 = 0.551, 𝑓 −1 = −0.172.

Therefore,
𝑓 −2 𝑓(−1) < 0.

Thus, there is at least a negative value of 𝑥 with 𝑔 𝑥 = ℎ(𝑥) in the interval −2, −1 by using
Intermediate Value Theorem.

Prepared by: Ahmad Nurfaidhi Rizalman

34

17
3/21/21

SOLUTIONS TO QUESTION 2.7


Solutions to Question 2.7b)
𝑓 𝑥 = 𝑔 𝑥 − ℎ 𝑥 = 𝑒 % − cos 𝑥.
From a)
𝑎, 𝑏 = −2, −1
𝑖 𝑎' 𝑐' 𝑏' 𝑓(𝑎' ) 𝑓(𝑐' ) 𝑓(𝑏' )
0 -2 -1.5 -1 0.551 0.152 -0.172
1 -1.5 -1.250 -1 0.152 -0.029 -0172
2 -1.5 -1.375 -1.250 0.152 0.058 -0.029
3 -1.375 -1.313 -1.250 0.058 0.014 -0.029
4 -1.313 -1.282 -1.250 0.014 -0.007 -0.029
5 -1.313 -1.298 -1.282 0.014 0.004 -0.007
Since 𝑓 𝑐> = 0.004 < 𝜀 = 0.0005, so the negative root of 𝑒 % = cos 𝑥 is ≈ 𝑐> = −1.298.

Prepared by: Ahmad Nurfaidhi Rizalman

35

SOLUTIONS TO QUESTION 2.7


Solutions to Question 2.7c)
$(" ()(((!)
From 𝑟 − 𝑐' ≤ ./0 , where 𝑖 ≥ 0, hence 0.02 ≤ or 0.02 2',) ≤ 1 or 2',) ≤ 50. Take 𝑙𝑛 for
! !./0
both sides:
ln 2',) ≤ ln 50
𝑖 + 1 ln 2 ≤ ln 50
-. /0
(𝑖 + 1) ≤
-. !
𝑖 ≤ 4.644
∴𝑖 =4

Hence, to approximate the value of 𝑥 to within an absolute tolerance of 0.02, 𝑖 = 4 iteration is needed.

Prepared by: Ahmad Nurfaidhi Rizalman

36

18
3/21/21

SOLUTIONS TO QUESTION 2.7


Solutions to Question 2.7c)
𝑖 𝑎' 𝑏' 𝑐' 𝑓(𝑎' ) 𝑓(𝑏' ) 𝑓(𝑐' )
0 -2.0000 -1.000 -1.500 0.551482119 -0.172422864 0.152392958
1 -1.5000 -1.000 -1.250 0.152392958 -0.172422864 -0.028817565
2 -1.5000 -1.250 -1.375 0.152392958 -0.028817565 0.058291887
3 -1.3750 -1.250 -1.313 0.058291887 -0.028817565 0.013712581
4 -1.3125 -1.250 -1.282 0.013712581 -0.028817565 -0.007827495

For 𝑖 = 4, the negative root of 𝑒 % = cos x is ≈ 𝑐> = −1.28125.

Prepared by: Ahmad Nurfaidhi Rizalman

37

QUESTION 2.8
Given the function 𝑓 𝑥 = sin 2𝑥 + 𝑥 ! − 3. Find the root of 𝑓(𝑥) by using bisection method
with 𝑏 − 𝑎 = 1. Do your calculation in 9 decimal places. Approximate the value of 𝑥 to within
an absolute tolerance of 105!.

Solution
Root of the equation is 1.380859375 at 8th iteration.

Prepared by: Ahmad Nurfaidhi Rizalman

38

19
3/21/21

APPLICATIONS IN CIVIL ENGINEERING

Prepared by: Ahmad Nurfaidhi Rizalman

39

QUESTION 2.9 - LOCATION OF MAXIMUM BENDING MOMENT


A simply supported beam AB has an overall span of
9 𝑚. The beam is loaded with a variable load intensity
over a point of the span of 6 𝑚 in length as shown in
Figure(a). From the free-body diagram (Figure (b)), the
bending moment of the beam is expressed by

𝑓 𝑥 = 20 − 𝑥 ',

where 𝑥 is the length of the beam from point 𝐴.


a) Determine the location of the maximum bending
moment by using Bisection Method.
b) Given the true value 𝑥- is 4.4721359 𝑚, compute
the approximate percent relative error and true
percent relative error for each iteration.

Prepared by: Ahmad Nurfaidhi Rizalman

40

20

You might also like