USING MATLAB USING MATLAB The volume V and paper surface area A of a conical pap
ID: 3853525 • Letter: U
Question
USING MATLAB
USING MATLAB
The volume V and paper surface area A of a conical paper cup are given by V = 1/3 pi r^2 h A = pi r squareroot r^2 + h^2 where r is the radius of the base of the cone and h is the height of the cone. a. By eliminating h, obtain the expression for A as a function of r and V. b. Create a user-defined function that accepts R as the only argument and computes A for a given value of V. Declare V to be global within the function. C. For V = 10 n.^3, use the function with the fminbnd function to compute the value of r that minimizes the area A. What is the corresponding value of the height h? Investigate the sensitivity of the solution by plotting V versus r. How much can R vary about its optimal value before the area increases 10 percent above its minimum value?Explanation / Answer
solution 1 and 2
function Area=Cone(R)
V=10;
syms r h v A% all variables
eq1=v==1/3*pi*r^2*h;%eqution1
fprintf('h=1');
h_value=solve(eq1,h);%new h value for equation disp(h_value);
eq2=A==pi*r*sqrt(r^2+h_value^2);%equation 2 with new h value
fprintf('A=');
sol=solve(eq2,A);%solve equation 2 for A as a function of V and r
disp(sol);
solution=solve(eq2,v==V,r==R);
Area=double(solution.A);
end
Solution 3:
clc;
clear all;
v=10;
syms r h A % all variables
eq1=v==1/3*pi*r^2*h;%eqution 1
fprintf('h=');
h_value=solve(eq1,h);% new h value for eqution
disp(h_value);
eq2=A==pi*r*sqrt(r^2+h_value2);% eqution 2 with new h value
fprintf('A=');
sol=solve(eq2,A);% solve equation 2 for A as a function of V and r
func=matlabFuction(sol);
disp(func);
x1=0;
x2=10000000000;
x=fminbnd(func.x1,x2);
h_sol=solve(eq1,r==x);
fprintf('Min value of r=%f, New h value:%f ',x,double(h_sol.h));
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.