function v = watervol(h) % watervol calculates the volume of water in the tower. % Input argument % h Water level in meters % Output argument % v Water volume in cubic meters % Written by Alan Usas, 12/23/08 if h<=19 v = pi*12.5^2*h; else rh = 12.5 + 10.5*(h-19)/14; v = pi*12.5^2*19 + pi*(h-19)*(12.5^2 + 12.5*rh + rh^2)/3; end