write a code in MATLAB by using the BISECTION METHOD to solve the problem below.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please write a code in MATLAB by using the BISECTION METHOD to solve the problem below. Thank you!

Chapter 03.03
Bisection Method of Solving a Nonlinear Equation-
More Examples
Industrial Engineering
Example 1
You are working for a start-up computer assembly company and have been asked to
determine the minimum number of computers that the shop will have to sell to make a profit.
The equation that gives the minimum number of computers n to be sold after considering the
total costs and the total sales is
f(n)=40n¹5-875n+35000 = 0
Use the bisection method of finding roots of equations to find the minimum number of
computers that need to be sold to make a profit. Conduct three iterations to estimate the root
of the above equation. Find the absolute relative approximate error at the end of each
iteration and the number of significant digits at least correct at the end of each iteration.
Solution
Let us assume
n =50, n =100
Check if the function changes sign between n, and ₁.
f(n) = f(50) = 40(50)¹5-875(50) + 35000 = 5392.1
f(n) = f(100) = 40(100)¹5-875(100) + 35000 = -12500
Hence
ƒ(n)ƒ(n) = f(50)ƒ(100)=(5392.1)(-12500) <0
So there is at least one root between n, and n₁, that is, between 50 and 100.
Iteration 1
The estimate of the root is
nm
ngtr
2
50+100
=
2
= 75
f(nm) = f(75) = 40(75)¹5-875(75)+35000 = -4.6442×10³
f(n)f(n)=f(50)ƒ(75)= (5392.1)-4.6442×10³) <0
03.03.1
=
Transcribed Image Text:Chapter 03.03 Bisection Method of Solving a Nonlinear Equation- More Examples Industrial Engineering Example 1 You are working for a start-up computer assembly company and have been asked to determine the minimum number of computers that the shop will have to sell to make a profit. The equation that gives the minimum number of computers n to be sold after considering the total costs and the total sales is f(n)=40n¹5-875n+35000 = 0 Use the bisection method of finding roots of equations to find the minimum number of computers that need to be sold to make a profit. Conduct three iterations to estimate the root of the above equation. Find the absolute relative approximate error at the end of each iteration and the number of significant digits at least correct at the end of each iteration. Solution Let us assume n =50, n =100 Check if the function changes sign between n, and ₁. f(n) = f(50) = 40(50)¹5-875(50) + 35000 = 5392.1 f(n) = f(100) = 40(100)¹5-875(100) + 35000 = -12500 Hence ƒ(n)ƒ(n) = f(50)ƒ(100)=(5392.1)(-12500) <0 So there is at least one root between n, and n₁, that is, between 50 and 100. Iteration 1 The estimate of the root is nm ngtr 2 50+100 = 2 = 75 f(nm) = f(75) = 40(75)¹5-875(75)+35000 = -4.6442×10³ f(n)f(n)=f(50)ƒ(75)= (5392.1)-4.6442×10³) <0 03.03.1 =
03.03.2
Chapter 03.03
Hence the root is bracketed between n, and n, that is, between 50 and 75. So, the lower
and upper limits of the new bracket are
n =50, n = 75
At this point, the absolute relative approximate error || cannot be calculated, as we do not
have a previous approximation.
Iteration 2
The estimate of the root is
ntr
2
50+75
=
2
= 62.5
f(n) = f(62.5)=40(62.5)¹5-875(62.5) +35000 = 76.735
f(n)f(n) = f(50)ƒ(62.5)=(5392.1)(76.735)>0
Hence, the root is bracketed between n and n, that is, between 62.5 and 75. So the lower
and upper limits of the new bracket are
n =62.5,n = 75
The absolute relative approximate error, Eat the end of Iteration 2 is
new
old
nm
x100
n
"m
62.5-75
x100
62.5
= 20%
None of the significant digits are at least correct in the estimated root
nm = 62.5
as the absolute relative approximate error is greater that 5%.
Iteration 3
The estimate of the root is
ntr
2
62.5+75
=
2
= 68.75
f(n)=f(68.75)= 40(68.75)¹5-875(68.75)+35000 = -2.3545×10³
f(n)f(n)=f(62.5)ƒ(68.75)=(76.735-2.3545×10³) <0
Hence, the root is bracketed between n and n, that is, between 62.5 and 68.75. So the
lower and upper limits of the new bracket are
n =62.5, n =68.75
The absolute relative approximate error ea at the end of Iteration 3 is
Bisection Method-More Examples: Industrial Engineering
03.03.3
old
72
n
new
x100
n
68.75-62.5
68.75
x100
=9.0909%
Still none of the significant digits are at least correct in the estimated root of the equation, as
the absolute relative approximate error is greater than 5%. The estimated minimum number
of computers that need to be sold to break even at the end of the third iteration is 69. Seven
more iterations were conducted and these iterations are shown in the Table 1.
Table 1 Root of f(x)=0 as a function of the number of iterations for bisection method.
n₂
n
nm
Iteration
1
50
100
75
2
50
3
-4.6442×10³
76.735
-2.3545×10³
-1.1569x10³
-544.68
4
5
6
62.5
62.5
62.5
62.5
62.5
62.5
62.5
62.598
75
62.5
20
75
68.75 9.0909
68.75 65.625 4.7619
65.625 64.063 2.4390
64.063 63.281 1.2346
63.281 62.891 0.62112
62.891 62.695 0.31153
62.695 62.598 0.15601
62.695 62.646 0.077942
7
-235.12
-79.483
-1.4459
8
9
37.627
10
18.086
At the end of the 10th iteration,
|E₂|= 0.077942%
Hence the number of significant digits at least correct is given by the largest value of m for
which
€≤0.5×10²-
0.077942 ≤0.5×10²-m
0.15588 <10²-m
log (0.15588) ≤2-m
m≤2-bog (0.15588) = 2.8072
So
m = 2
The number of significant digits at least correct in the estimated root 62.646 is 2.
Transcribed Image Text:03.03.2 Chapter 03.03 Hence the root is bracketed between n, and n, that is, between 50 and 75. So, the lower and upper limits of the new bracket are n =50, n = 75 At this point, the absolute relative approximate error || cannot be calculated, as we do not have a previous approximation. Iteration 2 The estimate of the root is ntr 2 50+75 = 2 = 62.5 f(n) = f(62.5)=40(62.5)¹5-875(62.5) +35000 = 76.735 f(n)f(n) = f(50)ƒ(62.5)=(5392.1)(76.735)>0 Hence, the root is bracketed between n and n, that is, between 62.5 and 75. So the lower and upper limits of the new bracket are n =62.5,n = 75 The absolute relative approximate error, Eat the end of Iteration 2 is new old nm x100 n "m 62.5-75 x100 62.5 = 20% None of the significant digits are at least correct in the estimated root nm = 62.5 as the absolute relative approximate error is greater that 5%. Iteration 3 The estimate of the root is ntr 2 62.5+75 = 2 = 68.75 f(n)=f(68.75)= 40(68.75)¹5-875(68.75)+35000 = -2.3545×10³ f(n)f(n)=f(62.5)ƒ(68.75)=(76.735-2.3545×10³) <0 Hence, the root is bracketed between n and n, that is, between 62.5 and 68.75. So the lower and upper limits of the new bracket are n =62.5, n =68.75 The absolute relative approximate error ea at the end of Iteration 3 is Bisection Method-More Examples: Industrial Engineering 03.03.3 old 72 n new x100 n 68.75-62.5 68.75 x100 =9.0909% Still none of the significant digits are at least correct in the estimated root of the equation, as the absolute relative approximate error is greater than 5%. The estimated minimum number of computers that need to be sold to break even at the end of the third iteration is 69. Seven more iterations were conducted and these iterations are shown in the Table 1. Table 1 Root of f(x)=0 as a function of the number of iterations for bisection method. n₂ n nm Iteration 1 50 100 75 2 50 3 -4.6442×10³ 76.735 -2.3545×10³ -1.1569x10³ -544.68 4 5 6 62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.598 75 62.5 20 75 68.75 9.0909 68.75 65.625 4.7619 65.625 64.063 2.4390 64.063 63.281 1.2346 63.281 62.891 0.62112 62.891 62.695 0.31153 62.695 62.598 0.15601 62.695 62.646 0.077942 7 -235.12 -79.483 -1.4459 8 9 37.627 10 18.086 At the end of the 10th iteration, |E₂|= 0.077942% Hence the number of significant digits at least correct is given by the largest value of m for which €≤0.5×10²- 0.077942 ≤0.5×10²-m 0.15588 <10²-m log (0.15588) ≤2-m m≤2-bog (0.15588) = 2.8072 So m = 2 The number of significant digits at least correct in the estimated root 62.646 is 2.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education