Please show all work and the out put The tank in a water tower has the geometry
ID: 3800722 • Letter: P
Question
Please show all work and the out put The tank in a water tower has the geometry shown in the figure (the lower part is a cylinder and the upper part is an inverted frustum cone). Inside the tank there is a float that indicates the level of the water. Write a script file that determines the volume (m^3) of water in the tank from the position (height h in meters) of the float. The volume of the cone portion can be determined by the following equation V = 1/3 pi(h - 19)(12.5^2 + 12.5r_h + r^2_h) Where r_h = 12.5 + 10.5/14 (h - 19) Run the program for heights of 8 m, 20 m and 25.7 m.Explanation / Answer
function V=det_volume(h)
%Calculate the value of rh for given height.
rh=12.5+(10.5/14)*(h-19)
%Calculate the volume of given height.
V=(1/3)*pi*(h-19)*((12.5*12.5)+(12.5*rh)+(rh*rh))
%IF we considered the above formula calculates the volume of cone portion containing water then uncomment following line to
%add volume of cylinder also
%V+=pi*(12.5*12.5)*h % ADD VOLUME OF CYLINDER
end
disp ("Volume of height 8 is :")
disp (det_volume(8))
disp ("Volume of height 20 is :")
disp (det_volume(20))
disp ("Volume of height 25.7 is :")
disp (det_volume(25.7))
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.