I need help about my homework. It shold be answered in code as in MATLAB Thanks
ID: 3544656 • Letter: I
Question
I need help about my homework. It shold be answered in code as in MATLAB
Thanks
A water tank consists of a cylindrical part of radius r and height h, and a hemispherical top. The tank is to be constructed to hold 500 m3 of uid when lled. The surface area of the cylindrical part is 2 t pi rh, and its volume is pi r2 h. The surface area of the hemispherical top is given by 2 pi r2, and its volume is given by 2 pi r3/3. The cost to construct the cylindrical part of the tank is $300/m2 of surface area; the hemispherical part costs $400/m2. Plot the cost versus r for 2 10 m, and determine the radius that results in the least cost. Compute the corresponding height h.Explanation / Answer
pi=3.14;
% Volume V=pi*r^2*h+(2/3)*pi*r^3 = 500;
% 500=pi r^2 h+ 2/3 pi r^3
% writing h in terms of r --> h =(500-2/3 pi r^3)/(pi r^2)
r=2:0.2:10;
h=(500-(2/3)*pi*r.^3)./(pi*r.^2);
% Cost
C=2*pi*r.*h*300+2*pi*r.^2*400;
plot(r,C);
minimum at r=5m,
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.