Roots-Numerical Methods-Part 2
Roots-Numerical Methods-Part 2
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
•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.
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Solution.
The first step in bisection is to guess two values of the
unknown (in the present problem, m) that give values for f(m)
with different signs.
From the graphical solution in Example 1, we can see that
the function changes sign between values of 50 and 200
Therefore, the initial estimate of the root xr lies at the
midpoint of the interval
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
125
Note that:
The exact value of the root is 142.7376.
This means that the value of 125 calculated here
has a true percent relative error of
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
125
125
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
162.5
143.75
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Recall that the true percent relative error for the root
estimate of 162.5 was 13.85%. Therefore, |εa| is
greater than |εt|. This behavior is manifested for the
other iterations:
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
if test < 0
xu = xr;
elseif test > 0
xl = xr;
else
ea = 0;
end
if ea <= es | iter >= maxit,break,end
end
root = xr; fx = func(xr, varargin{:});
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
Dr. Maya M. Emarah Assistant Professor, Mechatronics Department. The High Institute of Engineering, City of Science and Culture.
Mechatronics Engineering
MTE203- Numerical Methods
Level:200
fm = @(m,cd,t,v) sqrt(9.81*m/cd)*tanh(sqrt(9.81*cd/m)*t) − v;
[mass fx ea iter] = bisect(@(m) fm(m,0.25,4,36),40,200)
mass =
142.7377
fx =
4.6089e-007
ea =
5.345e-005
iter =
21