what to type on your function
thanks
if you see the given image,
we can divide the tank in three sections
1)cone section
with radius=R and height=R
2)lower cylinder
with radius=R and height=d-R
3)upper cylinder
with radius=R and height=R
%%%%%%%%%%%%%%%%%MATLAB main code%%%%%%%%%%%%%%%%%
clc;
close all;
clear all;
d=0:0.3:4.5;%%%%depth value from 0 to 4.5 with step size 0.3
R=1.5;
for i=1:length(d)
volume(i)=tank(d(i),R);
end
plot(d,volume);
xlabel('depth');
ylabel('volume');
title('Tank');
disp('volume values');
disp(volume);
%%%%%%%%%%%%%FUCNTION%%%%%%%%%%%%%%%
function volume=tank(d,R)
if(d>(3*R))
volume=999;
else
v1=2*pi*(R^2)*(R);%%%%%%%%%%%%%%%volume of cylinder
v2=2*pi*(R^2)*(d-R);%%%%%%%%%%%%%%%volume of cylinder
v3=(pi*(R^3))/3;%%%%%%%%%%%%%%%volume of cone
volume=v1+v2+v3;
end
end
A water tank is designed with a conical section and a cylindrical section and all dimensions rela...
7 Water is flowing into the top of an open cylindrical tank (diameter D) at a volume flow rate of e and out of a hole in the bottom at a rate of O The tank is made of wood that is very porous and the water is leaking out through the wall uniformly at a rate of q per unit of wetted surface area. The initial depth of water in the tank is 2,. Derive an equation for the...