Tp4: Roots of Equation: 1. Find The Roots of The Equation Below by Graphical Method F (X) X - 4x + 1 Code
Tp4: Roots of Equation: 1. Find The Roots of The Equation Below by Graphical Method F (X) X - 4x + 1 Code
Figure
From the figure the roots of equation are X1 = -2.1 ; X2 = 0.1 ; X3 = 1.7
𝐦𝐦𝐦𝐦
4. The parachute velocity is V = 𝐜𝐜 (1-e-ct/m) . what is the drag coefficient of
“ C ” needed to reach velocity of 40 m/s if m=68.1 kg; t=10s ;g=9.8m/s2.
Code
f=@(x)40-(((68.1)*(9.8))./x)+exp(-10*x./68.1)
x1=input('value x1:')
x2=input('value x2:')
if f(x1)*f(x2)>0
fprintf('no roots')
return
end
if f(x1)==0
fprintf('x1 is one of the roots')
return
elseif f(x2)==0
fprintf('x2 is one of the roots')
return
end
for i=0:100
xr=[x2*f(x1)-x1*f(x2)]./(f(x1)-f(x2))
if f(x1)*f(x2)<0
x2=xr
else x1=xr
end
if abs (f(xr))<0.01
break
end
end
fprintf ('the root is :%f',xr)
Suppose X1 = 1 ; X2 = 20