-Given the function f (x ) = x^4 – 2x^3 -13x^2 +14x +24 Applying a graphical met
ID: 3167451 • Letter: #
Question
-Given the function f (x ) = x^4 – 2x^3 -13x^2 +14x +24 Applying a graphical method from x= - 5 to x= 5 to estimate the roots, one can determine
-Applying an incremental search to the function in problem one, using 100 subintervals (ns=100) between 0 and 10 indicates there are ______ brackets with a sign change.
-Performing a bisection on the functionf (x ) = x^4 – 2x^3 -13x^2 +14x +24 between x=3 and x=10 results in identifying the root in how many iterations? and
error, no sign change or root=7, root=4, root 2,
-Employing the Newton Raphson Method with an initial guess of xr=0 will identify the root in how many iterations?
- Employing the Newton Raphson Method with an initial guess of xr=0 will identify which root?
Employing the built-in function fzero, with an initial guess of 10, MATLAB will identify which of the following roots?4, -3,2,-1
-Employing the built-in function fzero within the bracket of [0 3] will reveal which of the following roots: 2,4, -1,-3
error, no sign change or root=7, root=4, root 2,
-Employing the Newton Raphson Method with an initial guess of xr=0 will identify the root in how many iterations?
- Employing the Newton Raphson Method with an initial guess of xr=0 will identify which root?
Employing the built-in function fzero, with an initial guess of 10, MATLAB will identify which of the following roots?4, -3,2,-1
-Employing the built-in function fzero within the bracket of [0 3] will reveal which of the following roots: 2,4, -1,-3
Explanation / Answer
%%% Matlab code %%%
clc;
clear all;
close all;
format long
% % % % % restoredefaultpath %%%%%
syms x
f=x^4-2*x^3-13*x^2+14*x+24;
h=0:0.1:10;
for n=1:length(h)
g=subs(f,h(n));
if (g >1);
k(n)=1;
else
k(n)=-1;
end
end
z=diff(k);
% % % Roots location
p=1;
for l=1:length(z)
if ( z(l) >0)
I(p)= l;
p=p+1;
else
if(z(l) < 0)
I(p)=l+1;
p=p+1;
end
end
end
%%% Actual roots value;
for m=1:length(I);
r(m)=h(I(m));
end
fprintf(' using increamental search Number of sign changes = %d ', length(r));
fprintf(' incremental search give root at = %d ', r);
%%% bisection method
a=3;
b=10;
for n=1:100;
l1=subs(f,a);
l2=subs(f,b);
c=(a+b)/2;
l3=subs(f,c);
if (abs(l3) < 0.000000001)
break;
end
if ( l3 < 0 )
a=c;
else
b=c;
end
end
fprintf(' Bisection give roots in %d iteration and roots is %f ',n,c);
%%% Newton Raphson method
s(1)=0;
for n=1:100
l1=subs(f,s(n));
l2=subs(diff(f),s(n));
s(n+1)=s(n)-l1/l2;
e=abs((s(n+1)-s(n))/s(n+1));
if (e < 0.0000001)
break;
end
end
fprintf(' Newton Raphson give roots in %d iteration and roots is %f ',n,s(end));
%%% Using inbuilt function
f= @(x) x^4-2*x^3-13*x^2+14*x+24;
r=fzero(f,10);
fprintf('Using built in function fzero with initial guess x0=10 matlab identified roots at x= %d ',r);
r=fzero(f,[0 3]);
fprintf('Using built in function fzero with [0 3] matlab identified roots at x= %d ',r);
OUTPUT:
using increamental search Number of sign changes = 2
incremental search give root at = 2
incremental search give root at = 4
Bisection give roots in 38 iteration and roots is 4.000000
Newton Raphson give roots in 6 iteration and roots is -1.000000
Using built in function fzero with initial guess x0=10 matlab identified roots at x= 4
Using built in function fzero with [0 3] matlab identified roots at x= 2
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.