In: Physics
Question #1.
The lateral surface area, S, of a cone is given by: ? = ?*SQRT(?^2 + ℎ^2) , where r is the radius of the base and h is the height. Determine the radius of a cone that has a surface area of 1200 m2 and a height of 20 m. Solve by using the bisection iteration method. Start with rl = 15 m, ru = 16 m and calculate the first four(4) iterations.
Question #2.
Determine the fourth (4) root of 200 by finding the numerical solution of the equation x4 - 200 = 0. Use False position method. Start with xl = 3, xu = 4 and carry out the first four(4) iterations.
I need a script using Matlab, Thank You.
Question1
clc;
clear;
f = @(r) pi*r*sqrt(r^2+20^2) -1200;
rl=input('Enter the first value of guess interval:');
ru=input('Enter the end value of guess interval:');
while f(ru)*f(rl)>0
fprintf('%d and %d', f(ru),f(rl))
fprintf('The guess is incorrect! Enter new guesses\n');
rl=input('Enter the first value of guess interval:') ;
ru=input('Enter the end value of guess interval:');
end
for i=1:4
rr=(ru+rl)/2;
if f(ru)*f(rr)<0
rl=rr;
else
ru=rr;
end
fprintf('Root after %i interation is: %ff \n',i,rr);
end
fprintf('The required root of the equation is:%f',rr)
Question1
clc;
clear;
f = @(x) x^4-200;
xl=input('Enter the first value of guess interval:');
xu=input('Enter the end value of guess interval:');
while f(xu)*f(xl)>0
fprintf('The guess is incorrect! Enter new guesses\n');
xl=input('Enter the first value of guess interval:') ;
xu=input('Enter the end value of guess interval:');
end
for i=1:4
xr = xu - f(xu)* (xu-xl)/(f(xu)-f(xl));
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
fprintf('Root after %i interation is: %d \n',i,xr);
end
fprintf('The required root of the equation is:%d',xr)