`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
Bisection method
clear all
clc
f = @(x) -5*x^5+14*x^3+20*x^2+10*x;
e=0.18;
a=-2;
b=4;
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
fplot(f,[-2,4]);
hold on;
plot(p,f(p),'*r');
FALSE POSITION METHOD
clc
f = @(x) -5*x^5+14*x^3+20*x^2+10*x;
e=1e-2;
x0=2;
x1=5;
i=0;
imax=200;
x2=x1+1;
flag=1;
while (abs(x2-x1)>e)
if(i~=0)
x1=x2;
end
x2=x1-((f(x1)/(f(x1)-f(x0)))*(x1-x0));
x0=x1;
i=i+1;
if(i==200)
disp('the required
accuracy is not reached in 100 iterations');
flag=0;
end
end
if(flag==1)
root=x2
else
root=[];
end
NEWTON METHOD
clc
clear all
close all
f = @(x) -5*x^5+14*x^3+20*x^2+10*x;
g=@(x) - 25*x^4 + 42*x^2 + 40*x + 10;
x0=-1;
e=0.01;
maxit=100;
x1=x0;
x0=0;
N=0;
err=[];
while 1
if abs(f(x1))>e
x0=x1;
x1=x0-(f(x0)/g(x0));
N=N+1;
else
break;
end
if(N==maxit)
break;
end
end
root=x1;
iter=N;
disp('So, final approximation is')
(root)
fprintf('Number of iteration is %d\n',N);
fprintf('Approximate absolute relative error is
%f\n',abs(x1-x0)/abs(x1));
Note: Brother according to HOMEWORKLIB RULES we are only allowed to answer 3 part if there are many. So, I request you to post other part as separate posts.
Kindly revert for any queries
Thanks.
L. Determine the real root(s) off(x)--5xs + 14x3 + 20x2 + 10x a. Graphically on a graph paper. b....
2) (15 points) a) Determine the roots of f(x)=-12 – 21x +18r? - 2,75x' graphically. In addition, determine the first root of the function with b) bisection and c) false-position. For (b) and (c), use initial guesses of x, =-land x, = 0, and a stopping criterion of 1%. 3) (25 points) Determine the highest real root of f(x) = 2x – 11,7x² +17,7x-5 a) Graphically, b) Fixed-point iteration method (three iterations, x, = 3) c) Newton-Raphson method (three iterations,...
6.5 Employ the Newton-Raphson method to determine a real root for 4x20.5 using initial guesses of (a) 4.52 f(x) 15.5x Pick the best numerical technique, justify your choice and then use that technique to determine the root. Note that it is known that for positive initial guesses, all techniques except fixed-point iteration will eventually converge. Perform iterations until the approximate relative error falls below 2 %. If you use a bracket- ing method, use initial guesses of x 0 and...
(la) Determine the root of the x – ez* + 5 = 0 using the Newton-Raphson method with equation initial guess of xo = 1. Perform the computation until the percentage error is less than 0.03%. (1b) Employ bisection method to determine the root of the f(x)=x* – 3x + 7 =0) using equation two initial guesses of x; =-2.1 and x;, =-1.8 . Perform three iterations and calculate the approximate relative error for the third iteration. What is the...
3. (30 pts) (Problem 6.2) Determine the highest real root of f(x) 2x3- 11.7x2 + 17.7x -5 a) Graphically. b) Write a MATLAB program using the fixed-point method to determine the root with xo- Write a MATLAB program using the Newton-Raphson method to determine the root with Xo-3. c) d) Write a MATLAB program using the secant method to determine the root with x-1-3 and Xo- 4. e) Compare the relative errors between these three methods at the third iteration...
2. A comparative problem: Determine the highest real root of flx)-2x3-11.7x'+17.7x-5 You will achieve this by performing 3 iterations of the following methods. In each case, calculate the approximate relative error at each iteration (a) The bisection method with starting guesses x 3 and u-4 (b) New Raphson method using Xo 3 as a starting guess. (c) Fixed point iteration usingx 3 as a starting guess but make sure that the method will work (see question 1.b above). (d) Which...
3. Find the positive root of In(x²) = 0.7 20-points a) Using three iterations of the bisection method with initial guesses of Xi on method with initial guesses of x = 0.5 and Xu 2, and b) Using three iterations of the Secant method, with the same initial guesses as in .
Need solution for question 5.6 using
python?
tation to within e, 5.11 Determine the real root of x 80: (a) analytically and (b) with the false-position method to within e, = 2.5%. Use initial guesses of 2.0 and 5.0. Compute the estimated error Ea and the true error after each 1.0% teration 5.2 Determine the real root of (x) 5r - 5x2 + 6r -2 (a) Graphically (b) Using bisection to locate the root. Employ initial guesses of 5.12 Given...
4) (16 points) The function f(x)= x? – 2x² - 4x+8 has a double root at x = 2. Use a) the standard Newton-Raphson, b) the modified Newton-Raphson to solve for the root at x = 2. Compare the rate of convergence using an initial guess of Xo = 1,2. 5) (14 points) Determine the roots of the following simultaneous nonlinear equations using a) fixed-point iteration and b) the Newton-Raphson method: y=-x? +x+0,75 y + 5xy = r? Employ initial...
Matlab only
What is the function value at the estimated root after one iteration of the bisection method for the root finding equation: f(x) = x^3 -x -11 with xl = -4 and xu = 2.5? Select one: a.-0.7500 x O b.-3.2500 o co d. -10.6719 Which of the following statements is false? All open methods for root finding: Select one: a. Is sensitive to the shape of the function X b. Require two initial guesses to begin the algorithm...
Determine the lowest positive root of f (x) = 8sin(x)e–x – 1:(a) Graphically.(b) Using the Newton-Raphson method (three iterations, xi = 0.3).(c) Using the secant method (three iterations, xi–1 = 0.5 and xi = 0.4.(d) Using the modified secant method (five iterations, xi = 0.3, δ = 0.01).