Question

Bisection Method Problem. Determine the real root of f(x) = 5x^3 - 5x^2 + 6x-2 Using...

Bisection Method Problem. Determine the real root of f(x) = 5x^3 - 5x^2 + 6x-2 Using Matlab

(a) plot the function using Matlab from x=0 t0 1 and guess the root

(b) Write a Matlab function to do the Bisection Method. Print the code the answer for an error tolerance of 0.01%

Homework Answers

Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
format long
f=@(x) 5*x.^3-5*x.^2+6*x-2;
fplot(f,[0,1]);
grid on;
e=0.01e-2;
a=0;
b=1;
iter = 0;
  
if f(a)*f(b)>=0

disp('No Root')

else

prev = (a+b)/2;
p=a;
while (abs(f(p))>e)
prev=p;

iter =iter+ 1;

p = (a+b)/2;

if f(p) == 0
p
q=1
break;

end

if f(a)*f(p)<0

b = p;

else

a = p;

end
fprintf('Iteration %d, root=%2.8f\n',iter,p);
if(iter==100)
disp('the required accuracy is not reached in 50 iterations');
end
end

end

Kindly revert for any queries

Thanks.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Use the Bisection Method to locate all solutions of the following equations. Sketch the function by...
Use the Bisection Method to locate all solutions of the following equations. Sketch the function by using Matlab’s plot command and identify three intervals of length one that contain a root. Then find the roots to six correct decimal places. (a) 2x3 − 6x − 1 = 0 (b) ex−2 + x3 − x = 0 (c) 1 + 5x − 6x3 − e2x = 0 **MUST BE DONE IN MATLAB AND NEEDS CODE
Solve the following problem using the MATLAB environment Write a function [approx_root, num_its] = bisection(f,a,b,tol) that...
Solve the following problem using the MATLAB environment Write a function [approx_root, num_its] = bisection(f,a,b,tol) that implements the bisection method. You function should take as input 4 arguments with the last argument being optional, i.e, if the user does not provide the accuracy tol use a default of 1.0e-6 (use varargin to attain this). Your function should output the approximate root, approx_root and the number of iterations it took to attain the root, num_its. However, if the user calls the...
Using Matlab, find an approximation by the method of false position for the root of function...
Using Matlab, find an approximation by the method of false position for the root of function f(x) = ex −x2 + 3x−2 accurate to within 10−5 (absolute error) on the interval [0,1]. Please answer and show code. Pseudo Code for Method of False Position: Given [a,b] containing a zero of f(x); tolerance = 1.e-7; nmax = 1000; itcount = 0; error = 1; while (itcount <=nmax && error >=tolerance) itcount = itcount + 1; x= a - ((b-a)/(f(b)-f(a)))f(a) error =abs(f(x));...
Newton's method for finding the root in MATLAB. I am stuck on the two lines of...
Newton's method for finding the root in MATLAB. I am stuck on the two lines of codes which are required to complete. can anyone give me a hint on this? function sample_newton(f, xc, tol, max_iter) % sample_newton(f, xc, tol, max_iter) % finds a root of the given function f over the interval [a, b] using Newton-Raphson method % IN: % f - the target function to find a root of % function handle with two outputs, f(x), f'(x) % e.g.,...
Find root of the equation cos (x) = xex using Bisection method. Make calculation for 4...
Find root of the equation cos (x) = xex using Bisection method. Make calculation for 4 iterations. Choose xl= 0 and xu= 1. Determine the approximate error in each iteration. Give the final answer in a tabular form.
find solution bisection method x^2-5x+2 limit 3%
find solution bisection method x^2-5x+2 limit 3%
17. I am using Newton’s method to find the negative root of f(x) = 3−x2. (a)...
17. I am using Newton’s method to find the negative root of f(x) = 3−x2. (a) What would be a good guess for x1? Draw the line tangent to f(x) at your x1 and explain why using Newton’s method would lead to the negative root of the function. (b) What would be a bad guess for x1? Draw the line tangent to f(x) at your x1 and explain why using Newton’s method would not lead to the negative root of...
Determine the real root of f (x) = −25 + 82x − 90x2 + 44x3 −8x4...
Determine the real root of f (x) = −25 + 82x − 90x2 + 44x3 −8x4 + 0.7x5: Using python in bisection to determine the root to s = 10%. Employ initial guesses of xl = 0.5 and xu = 1.0; pls use python
Using Matlab 1. Give the flowchart for finding the root of the function f(x) = [tanh⁡(x-2)]...
Using Matlab 1. Give the flowchart for finding the root of the function f(x) = [tanh⁡(x-2)] [sin⁡(x+3)+2] with the following methods (6 significant figures required): a) Modified Regula Falsi (Choose two reasonable integers as your initial upper and lower bounds) b) Newton’s Method (Choose one reasonable integer as your initial guess for the root)
Let f(x)=x-cos x. Use the bisection method to find a root in the interval [.25,1].  Continue until...
Let f(x)=x-cos x. Use the bisection method to find a root in the interval [.25,1].  Continue until two consecutive x values agree in the first 2 decimal places.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT