Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with it, Urgent! R 2.4 (9 pts) A cylindrical storage tank has a conical bottom to facilitate drainage. One particular tank design

image text in transcribed

Please help me with it, Urgent!image text in transcribed

R 2.4 (9 pts) A cylindrical storage tank has a conical bottom to facilitate drainage. One particular tank design specifies a radius of R, a total height of 4R, and the height of the conical bottom to be R. Write an m-file function tank_volume.m that calculates the volume of liquid in such a tank if the liquid level is h. Function: tank_volume.m 3R Inputs: R: an array of R values representing the radius of the tank. h h: an array of liquid height values measured from the bottom of the tank R Outputs: V: an array of tank volumes, of the same shape as the input data R and d Your function should have two checks: Issue an error statement if the arrays R and h are not the same shape Issue an error if, for any value of h, h > 4R (tank overflow!). Hint: typing "doc any at the command line will show a simple suggestion for testing all values in an array simultaneously. There are other ways to test this, as well, such as using loops. Driver Script: HW2_4.m Create a simple script that uses your tank_volume function to generate a plot (on a single set of axes) of the liquid volume vs. liquid level for R = 1 m and R = 2 m. Your plot should be properly labeled (axes, title, legend). No output from the function file or the driver file should be displayed other than the plot when the driver file is executed. Hint: The volume of a cone with ar21 radius r and length 1 is worked / 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles and Modern Applications of Mass Transfer Operations

Authors: Jaime Benitez

2nd edition

470181788, 470181782, 978-1-119-0427, 978-0470181782

More Books

Students also viewed these Chemical Engineering questions

Question

Verify the result C(XTX) = C(XT) for X= 1 2 -1 0 1 1

Answered: 1 week ago