Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB Use Matlab to write a script and post the script and the result. A water

ID: 3814523 • Letter: M

Question

MATLAB

Use Matlab to write a script and post the script and the result.

A water tank consists of a cylindrical part of radius r and heighth, and a hemispherical top. The tank is to be constructed to hold 500 meter^3 of fluid when filled. The cost to construct the cylindrical part of the tank is $300 per square meter of the surface area; the hemispherical part costs $400 per square meter. Determine the radius that results in the least cost and compute the corresponding height and the cost using graphical approach. V your results using the calculus approach.

Explanation / Answer

Given Total Capacity/Volume of the tank = 500 m3

Cylinderical part cost = 300/m2

Hemispherical part cost = 400/m2

Therefore , we can solve as

The surface area of cylindrical part = 2* pi* r* h

the surface area of hemispherical top = 2*pi*r2

Total_Vol = 500

Radius r = linspace(2, 10, 1000);

height h = (500 - ((2*pi*r.^3)/3))./(pi * (r.^2));      where (2*pi*r.^3)/3 is the volume of cylinderical part and (pi * (r.^2) is the volume of hemispherical top part

Total_Cost = (300*2*pi.*r.*h) + (400*2*pi*r2);     where 2*pi.*r.*h -The surface area of cylindrical part and 2*pi*r2 -the surface area of hemispherical top

To determine minumum cost and correspondence radius

[Min_Cost, Index] = min(Total_Cost)

Min_r = r(Index)

Corresponding_h = h(Index)

plot(r,Total_Cost)

xlabel ('Radius (Meter)')

ylabel ('Cost ($)')

title ('Cost versus Radius').