The lateral surface area of a cone is given by: S = pi r Squareroot r^2 + h^2 Wh
ID: 3788066 • Letter: T
Question
The lateral surface area of a cone is given by: S = pi r Squareroot r^2 + h^2 Where r is the radius of the cone, h is its height. a) Determine the radius of a cone which has a surface area of 1200 m^2 and a height of 20 m using the bisection method (do not use bisect.p--write code to solve) b) Determine the height of a cone which has a surface area of 1300 m^2 and a radius of 18 m using the false position method (do not use falsepos.p-write code to solve) Select your own initial guesses. Use a stopping criterion of 4 sig figs. Display the answers in informative sentences, using fprintf.Explanation / Answer
Matlab code for Part a) using bisection method
% a program to determin the radius of a cone for a given
% Surface area and height using bisection method
S = 1200; % the surface area of the cone given
h = 20; % the height of the cone given
f = @(r) pi*r*sqrt(r.^2+h.^2)-S; % the function
tol = 10^-4; % Tolerence
a=0;% a and b are selected in such a way that f(a) and
b=20; % f(b) are of oposit sign
u=feval(f,a); % Evaluating f @ a
v=feval(f,b); % Evaluate f @ b
c=(a+b)*0.5;% obtain the midle of a and b
err=abs(b-a)*0.5;
while (err>tol)
w=feval(f,c); % Evaluating f @ c
% replace a or b with c such that f(a) and f(b) are oposit sign
if (w*u<0)
b=c;v=w;
end
if (w*u>0)
a=c;u=w;
end
c=(a+b)*0.5; % again find the midle
err=abs(b-a)*0.5;
end
fprintf('The radius of the cone = %f m ',c); % printing the result
OUTPUT
The radius of the cone = 15.204082 m
Matlab code for Part b) using false position method
% a program to determin the height of a cone for a given
% Surface area and radius using false position method
S = 1300; % the surface area of the cone given
r = 18; % the radius of the cone given
f = @(h) pi*r*sqrt(r.^2+h.^2)-S; % the function
tol = 10^-4; % Tolerence
a=0;% a and b are selected in such a way that f(a) and
b=20; % f(b) are of oposit sign
while (abs(b-a)>tol) % loop til root is less than tolerence
% calculating the point p
h = (a*f(b)-b*f(a))/(f(b)-f(a));
% Checking the sign of f(r) and f(a)
if((f(a) > 0 && f(h) > 0) || (f(a) < 0 && f(h) < 0))
a = h;
else
b = h;
end
end
fprintf('The height of the cone = %f m ',h); % printing the result
OUTPUT
The height of the cone = 14.300220 m
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.