Question

A water tank is designed with a conical section and a cylindrical section and all dimensions related to the radius, R, as sho

what to type on your function
thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Tank 70 r 60 40 30 20 10 0 0.5 15 22.5 3 3.5 4 4.5 depthvolume values Columns 1 through 11 3.5343 7.7754 12.0166 16.2577 20.4989 24.7400 28.9812 33.2223 37.4635 41.7046 45.9458 Colu

Add a comment
Know the answer?
Add Answer to:
A water tank is designed with a conical section and a cylindrical section and all dimensions rela...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 7 Water is flowing into the top of an open cylindrical tank (diameter D) at a...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT