\[ \begin{align}\begin{aligned}\newcommand\blank{~\underline{\hspace{1.2cm}}~}\\% Bold symbols (vectors) \newcommand\bs[1]{\mathbf{#1}}\\% Poor man's siunitx \newcommand\unit[1]{\mathrm{#1}} \newcommand\num[1]{#1} \newcommand\qty[2]{#1~\unit{#2}}\\\newcommand\per{/} \newcommand\squared{{}^2} \newcommand\cubed{{}^3} % % Scale \newcommand\milli{\unit{m}} \newcommand\centi{\unit{c}} \newcommand\kilo{\unit{k}} \newcommand\mega{\unit{M}} % % Percent \newcommand\percent{\unit{\%}} % % Angle \newcommand\radian{\unit{rad}} \newcommand\degree{\unit{{}^\circ}} % % Time \newcommand\second{\unit{s}} \newcommand\s{\second} \newcommand\minute{\unit{min}} \newcommand\hour{\unit{h}} % % Distance \newcommand\meter{\unit{m}} \newcommand\m{\meter} \newcommand\inch{\unit{in}} \newcommand\foot{\unit{ft}} % % Force \newcommand\newton{\unit{N}} \newcommand\kip{\unit{kip}} % kilopound in "freedom" units - edit made by Sri % % Mass \newcommand\gram{\unit{g}} \newcommand\g{\gram} \newcommand\kilogram{\unit{kg}} \newcommand\kg{\kilogram} \newcommand\grain{\unit{grain}} \newcommand\ounce{\unit{oz}} % % Temperature \newcommand\kelvin{\unit{K}} \newcommand\K{\kelvin} \newcommand\celsius{\unit{{}^\circ C}} \newcommand\C{\celsius} \newcommand\fahrenheit{\unit{{}^\circ F}} \newcommand\F{\fahrenheit} % % Area \newcommand\sqft{\unit{sq\,\foot}} % square foot % % Volume \newcommand\liter{\unit{L}} \newcommand\gallon{\unit{gal}} % % Frequency \newcommand\hertz{\unit{Hz}} \newcommand\rpm{\unit{rpm}} % % Voltage \newcommand\volt{\unit{V}} \newcommand\V{\volt} \newcommand\millivolt{\milli\volt} \newcommand\mV{\milli\volt} \newcommand\kilovolt{\kilo\volt} \newcommand\kV{\kilo\volt} % % Current \newcommand\ampere{\unit{A}} \newcommand\A{\ampere} \newcommand\milliampereA{\milli\ampere} \newcommand\mA{\milli\ampere} \newcommand\kiloampereA{\kilo\ampere} \newcommand\kA{\kilo\ampere} % % Resistance \newcommand\ohm{\Omega} \newcommand\milliohm{\milli\ohm} \newcommand\kiloohm{\kilo\ohm} % correct SI spelling \newcommand\kilohm{\kilo\ohm} % "American" spelling used in siunitx \newcommand\megaohm{\mega\ohm} % correct SI spelling \newcommand\megohm{\mega\ohm} % "American" spelling used in siunitx % % Inductance \newcommand\henry{\unit{H}} \newcommand\H{\henry} \newcommand\millihenry{\milli\henry} \newcommand\mH{\milli\henry} % % Power \newcommand\watt{\unit{W}} \newcommand\W{\watt} \newcommand\milliwatt{\milli\watt} \newcommand\mW{\milli\watt} \newcommand\kilowatt{\kilo\watt} \newcommand\kW{\kilo\watt} % % Energy \newcommand\joule{\unit{J}} \newcommand\J{\joule} % % Composite units % % Torque \newcommand\ozin{\unit{\ounce}\,\unit{in}} \newcommand\newtonmeter{\unit{\newton\,\meter}} % % Pressure \newcommand\psf{\unit{psf}} % pounds per square foot \newcommand\pcf{\unit{pcf}} % pounds per cubic foot \newcommand\pascal{\unit{Pa}} \newcommand\Pa{\pascal} \newcommand\ksi{\unit{ksi}} % kilopound per square inch \newcommand\bar{\unit{bar}} \end{aligned}\end{align} \]

Oct 24, 2024 | 548 words | 5 min read

13.3.1. Task 1#

Introduction#

Cylindrical steel tanks have many outdoor uses. They are used in oil and gas refining, food production, farming, liquified gas storage, and more! On top of that, these tanks can have various shape of end cap such as flat, elliptical, or spherical.

Your company uses cylindrical tanks with flat end caps (see Fig. 13.1). The tank is an outdoor storage container and will be used to store water. Not only that, the tank has liquid measuring sensors along its height, which alert an operator once the liquid has reached the height of a particular sensor. From these height measurements, the volume of the tank can be calculated. As the sensors are inside the tank, all measurements are internal measurements, so the tank wall thickness is not relevant nor required for this application. When a cylindrical tank with flat ends is installed horizontally, the fluid volume at any fluid height within the tank can be calculated using the function:

(13.1)#\[V_f = L \left( \cos^{-1} \left(\frac{r-h}{r}\right) r^2 - (r-h) \sqrt{2rh - h^2} \right)\]

Where

  • \(V_f\) is the fluid volume

  • \(h\)is the fluid height measured from the tank bottom

  • \(r\) is the tank radius

  • \(L\) is the length of cylindrical section of the tank

../../../../../_images/cylindrical_tank.png

Fig. 13.1 A model of a horizontal cylindrical tank#

Now, you are given a task to design a tank fill measurement system for a tank that is installed horizontally. To be specific, the client wants to be alerted when the volume in the tank is less than 20% of the maximum volume. The fluid height is not measured instantaneously in this system. As the tank is progressively emptied, sensors are tripped, indicating that the fluid has reached the height of a particular sensor.

Task Instructions#

  1. Open up MATLAB and type edit in the Command Window. Then save your file as ma2_ind_1_username.m. Make sure to use the MATLAB Template (ENGR133_MATLAB_Template.m).

  2. Write a script that follows the flowchart below to simulate the tank emptying process and meet the safety needs of the system. The script will need a fluid height vector with decreasing increments of \(0.1m\) and to step through the vector while calculating the volume at every height, triggering an alert just after the fluid has fallen below \(20%\) of the maximum volume.

    ../../../../../_images/flowchart2.png

    Fig. 13.2 Flowchart for MA2 Individual Task 1#

    1. In the %% INITIALIZATIONsection, define the testing values as variables:

      1. The tank has an inner radius of \(1.25m\), an inner length of \(5.5m\).

      2. Assume the tank starts off completely full when the emptying begins.

      3. The tank has sensors placed every \(0.1m\) in height along the tank.

      4. The client wants to know when the volume of the tank falls below \(20%\) capacity.

    2. In the %% CALCULATIONS section:

      1. Calculate the maximum tank volume.

      2. Calculate the tank fill capacity that will trigger an alert.

      3. Create a vector of fluid height values and a vector of corresponding volumes using a while loop.

      1. Stop adding elements to the vector as close as possible to the fill capacity, just going below it.

    3. In the %% OUTPUTS section, display the number of iterations to fall below \(20%\) capacity, final fluid height, final fluid volume, and a warning that the volume is too low in a well-formatted print statements.

  3. Publish your script as ma2_ind_1_username.pdf and submit your deliverables to Gradescope.

Sample Output#

Sample Output

>> ma2_ind_1_username Number of iterations = 19 Remaining volume = 4.98 m^3 Fluid height= 0.60 m WARNING: The tank is now below 20% capacity. Please refill.