function [root, fx, ea, iter] -bisect (func, xl, xu, es, maxit, varargin) bisect: root location zeroes % [root, fx, ea, iter]=bisect (func, xl, xu, es, maxit, p1, p2,...): % uses bisection method to find the root of func % input: % func = name of function % x1, xu = lower and upper guesses % es = desired relative error (default = 0.0001%) % maxit = maximum allowable iterations (default = 50) p1, p2,... = additional parameters used by func % output: % root = real root % fx = function value at root % ea = approximate relative error (%) %iter = number of iterations if nargin<3, error('at least 3 input arguments required'), end test = func (x1, varargin{:}) *func (xu, varargin{:}); if test>0, error('no sign change'), end if nargin<4|isempty(es), es=0.0001; end if nargin<5|isempty (maxit), maxit=50; end iter = 0; xrxl; ea = 100; while (1) end xrold = xr; xr = (x1 + xu)/2; iter = iter + 1; if xr = 0,ea = abs ((xrxrold)/xr) * 100; end test = func(x1, varargin{:}) *func (xr, varargin{:}); if test < 0 xu = xr; elseif test > 0 else end x1 = xr; ea = 0; if ea <=es | iter >= maxit, break, end root = xr; fx = func(xr, varargin{:}); Problem 05.001 - Solving a root problem using bisection method Use bisection method to determine the drag coefficient needed so that a 95-kg bungee jumper has a velocity of 46 m/s after 9 s of free fall. Star with initial guesses of x = 0.2 and x = 0.5 and iterate until the approximate relative error falls below 5% Note: The acceleration of gravity is 9.81 m/s². (Round the final answer to four decimal places.) The required drag coefficient is cd 0.4062 ± 0.0001 kg/m. Explanation: The function to evaluate is gm f (ca) =V tanh | v(t) m On substituting the given values f(ca)=√ 981(35) tanh 9.81c49-46 95 The first iteration is 0.2+0.5 x = 2 = 0.35 f(0.2)f (0.35) 12.706474 (2.3387193) = 29.716876 Therefore, the root is in the second interval and the lower guess is redefined as x, = 0.35. The second iteration is x = 0.35+0.5 2 = 0.425 0.425-0.35 E₁ = 0.425 x 100% 17.65% f(0.35)f (0.425) = 2.3387193 (-1.2809449) = -2.99577 i 1(x₁) Xu f(x) xx 1(x1) |εal f(x)(x) 1 0.2 12.706474 0.5 2 0.35 2.338719 0.5 3 0.35 2.338719 0.425 4 0.3875 0.434088 0.425 -4.2485678 -4.2485678 -1.2809449 -1.2809449 0.35 0.425 0.3875 0.40625 2.3387193 -1.2809449 0.4340883 -0.4452446 29.716876 17.65% 9.68% -2.995770 1.015211 4.62% -0.193275 Thus, after four iterations, a root estimate of 0.40625 is obtained with an approximate error of 4.62%, which is below the desired estimate of 5%.

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

This for Matlab

Please modify the script bisect.m to report/create the iteration table. 

function [root, fx, ea, iter] -bisect (func, xl, xu, es, maxit, varargin)
bisect: root location zeroes
% [root, fx, ea, iter]=bisect (func, xl, xu, es, maxit, p1, p2,...):
% uses bisection method to find the root of func
% input:
% func = name of function
% x1, xu = lower and upper guesses
% es = desired relative error (default
=
0.0001%)
% maxit = maximum allowable iterations (default = 50)
p1, p2,... = additional parameters used by func
% output:
% root = real root
% fx = function value at root
% ea = approximate relative error (%)
%iter = number of iterations
if nargin<3, error('at least 3 input arguments required'), end
test = func (x1, varargin{:}) *func (xu, varargin{:});
if test>0, error('no sign change'), end
if nargin<4|isempty(es), es=0.0001; end
if nargin<5|isempty (maxit), maxit=50; end
iter =
0; xrxl; ea = 100;
while (1)
end
xrold = xr;
xr = (x1 + xu)/2;
iter = iter + 1;
if xr = 0,ea = abs ((xrxrold)/xr) * 100; end
test = func(x1, varargin{:}) *func (xr, varargin{:});
if test < 0
xu = xr;
elseif test > 0
else
end
x1 = xr;
ea = 0;
if ea <=es | iter >= maxit, break, end
root = xr; fx = func(xr, varargin{:});
Transcribed Image Text:function [root, fx, ea, iter] -bisect (func, xl, xu, es, maxit, varargin) bisect: root location zeroes % [root, fx, ea, iter]=bisect (func, xl, xu, es, maxit, p1, p2,...): % uses bisection method to find the root of func % input: % func = name of function % x1, xu = lower and upper guesses % es = desired relative error (default = 0.0001%) % maxit = maximum allowable iterations (default = 50) p1, p2,... = additional parameters used by func % output: % root = real root % fx = function value at root % ea = approximate relative error (%) %iter = number of iterations if nargin<3, error('at least 3 input arguments required'), end test = func (x1, varargin{:}) *func (xu, varargin{:}); if test>0, error('no sign change'), end if nargin<4|isempty(es), es=0.0001; end if nargin<5|isempty (maxit), maxit=50; end iter = 0; xrxl; ea = 100; while (1) end xrold = xr; xr = (x1 + xu)/2; iter = iter + 1; if xr = 0,ea = abs ((xrxrold)/xr) * 100; end test = func(x1, varargin{:}) *func (xr, varargin{:}); if test < 0 xu = xr; elseif test > 0 else end x1 = xr; ea = 0; if ea <=es | iter >= maxit, break, end root = xr; fx = func(xr, varargin{:});
Problem 05.001 - Solving a root problem using bisection method
Use bisection method to determine the drag coefficient needed so that a 95-kg bungee jumper has a velocity of 46 m/s after 9 s of free fall. Star
with initial guesses of x = 0.2 and x = 0.5 and iterate until the approximate relative error falls below 5%
Note: The acceleration of gravity is 9.81 m/s². (Round the final answer to four decimal places.)
The required drag coefficient is cd
0.4062 ± 0.0001 kg/m.
Explanation:
The function to evaluate is
gm
f (ca) =V tanh |
v(t)
m
On substituting the given values
f(ca)=√
981(35) tanh
9.81c49-46
95
The first iteration is
0.2+0.5
x =
2
= 0.35
f(0.2)f (0.35) 12.706474 (2.3387193) = 29.716876
Therefore, the root is in the second interval and the lower guess is redefined as x, = 0.35.
The second iteration is
x =
0.35+0.5
2
= 0.425
0.425-0.35
E₁ =
0.425
x 100% 17.65%
f(0.35)f (0.425) = 2.3387193 (-1.2809449) = -2.99577
i
1(x₁)
Xu
f(x)
xx
1(x1)
|εal
f(x)(x)
1
0.2
12.706474
0.5
2
0.35
2.338719
0.5
3
0.35
2.338719
0.425
4
0.3875
0.434088
0.425
-4.2485678
-4.2485678
-1.2809449
-1.2809449
0.35
0.425
0.3875
0.40625
2.3387193
-1.2809449
0.4340883
-0.4452446
29.716876
17.65%
9.68%
-2.995770
1.015211
4.62%
-0.193275
Thus, after four iterations, a root estimate of 0.40625 is obtained with an approximate error of 4.62%, which is below the desired estimate of 5%.
Transcribed Image Text:Problem 05.001 - Solving a root problem using bisection method Use bisection method to determine the drag coefficient needed so that a 95-kg bungee jumper has a velocity of 46 m/s after 9 s of free fall. Star with initial guesses of x = 0.2 and x = 0.5 and iterate until the approximate relative error falls below 5% Note: The acceleration of gravity is 9.81 m/s². (Round the final answer to four decimal places.) The required drag coefficient is cd 0.4062 ± 0.0001 kg/m. Explanation: The function to evaluate is gm f (ca) =V tanh | v(t) m On substituting the given values f(ca)=√ 981(35) tanh 9.81c49-46 95 The first iteration is 0.2+0.5 x = 2 = 0.35 f(0.2)f (0.35) 12.706474 (2.3387193) = 29.716876 Therefore, the root is in the second interval and the lower guess is redefined as x, = 0.35. The second iteration is x = 0.35+0.5 2 = 0.425 0.425-0.35 E₁ = 0.425 x 100% 17.65% f(0.35)f (0.425) = 2.3387193 (-1.2809449) = -2.99577 i 1(x₁) Xu f(x) xx 1(x1) |εal f(x)(x) 1 0.2 12.706474 0.5 2 0.35 2.338719 0.5 3 0.35 2.338719 0.425 4 0.3875 0.434088 0.425 -4.2485678 -4.2485678 -1.2809449 -1.2809449 0.35 0.425 0.3875 0.40625 2.3387193 -1.2809449 0.4340883 -0.4452446 29.716876 17.65% 9.68% -2.995770 1.015211 4.62% -0.193275 Thus, after four iterations, a root estimate of 0.40625 is obtained with an approximate error of 4.62%, which is below the desired estimate of 5%.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY