SlideShare a Scribd company logo
1 of 16
Download to read offline
Storage Container Mathematics
Copyright c 2015, Paul Lutus
Most recent revision: June 5, 2015
Abstract
This is a collection of full and partial, volume and surface area equations for common storage tank types. Itā€™s
meant to serve as an easy-to-use reference for tank analysis methods and mathematics that are distributed across
many articles located in the storage tank modeling section1
of http://arachnoid.com.
The overarching purpose of this activity is to create summaries and accurate sensor height to volume tables for
various kinds of storage tanks. An additional goal is to provide full and partial surface area results when possible.
The mathematical treatments are arranged to progress from simple to complex, in most cases building on what
has already been presented.
Contents
1 Circle equations 2
1.1 Common conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Circle width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Circle partial area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Circle partial circumference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Common container geometries 4
2.1 Vertical cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Horizontal cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Elliptical end cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4.1 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4.2 Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4.3 Surface area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.4 Partial wetted area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.5 Partial wetted area algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.6 Python listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4.7 Content surface area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Practical Application 10
3.1 Example tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Measuring the tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.2 Choosing the equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.3 Example program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1
4 Overview 13
4.1 TankCalc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.1 Tilted tanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2.1 Sage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2.2 Texmaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.3 Inkscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2.4 Povray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
List of Figures
1 Partitioned Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Partial circle area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Partial circumference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4 Vertical cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5 Horizontal cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6 Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
7 Elliptical end cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
8 Example Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
9 TankCalc numerical strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
List of Tables
1 Deļ¬ned Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1 Circle equations
This section describes some basic equations from which most of the later equations are derived.
1.1 Common conventions
Certain common names used in geometry have diļ¬€erent assignments here, to remain consistent across uses and to
agree with the conventions used in TankCalc2
, the authorā€™s tank analysis program.
One convention seen here diļ¬€ers from TankCalc. In this and later sections, the y value, normally associated with
a content sensor height, has a range of 0 ā‰¤ y ā‰¤ 2R, which I think is more consistent and logical than the prior
convention. This convention diļ¬€ers from that in the TankCalc documentation, where āˆ’R ā‰¤ y ā‰¤ R. This change
produces a number of changes in the dependent equations, and readers should expect to see equation forms that
diļ¬€er from those on the arachnoid.com website.
2
Figure 1: Partitioned Circle
1.2 Circle width
We ļ¬rst compute w (green line in ļ¬gure 1), the width across the circle deļ¬ned by the y bisector argument:
w = 2 (2 R āˆ’ y)y (1.1)
This equation can be easily used to compute a cylinderā€™s content surface area ā€“ just multiply its result by the
length of the cylinder: a = 2 (2 R āˆ’ y)yL.
1.3 Circle partial area
By integrating equation (1.1) on the interval 0 ā‰¤ z ā‰¤ y, we acquire an equation for the area of the blue shaded
segment in ļ¬gure 1. This result is later used to compute end cap partial areas and volumes, and cylindrical partial
volumes:
a =
y
0
2 (2 R āˆ’ z)z dz =
1
2
Ļ€R2
+ R2
arcsin
y āˆ’ R
R
āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) (1.2)
Equation (1.2) produces this result for R = 1:
Figure 2: Partial circle area
3
1.4 Circle partial circumference
We also require the partial circumference deļ¬ned by the y bisector argument and represented by the red line in ļ¬gure
1, later used as a term in cylinder partial surface area equations:
c = Ļ€R āˆ’ 2 R arcsin
R āˆ’ y
R
(1.3)
Equation (1.3) produces this result for R = 1:
Figure 3: Partial circumference
The equations to come are, to the extent practical, derived from these basic equations.
2 Common container geometries
For each of the following storage container types, equations are provided for:
Description Variable Notes
Content height y the location of the top of the containerā€™s contents
Full Volume v container full volume
Content Partial volume vy content volume from container base to coordinate y (blue tint)
Full Area a container full surface area
Content wetted area wy wetted area (liquid/wall interface)
from container base to coordinate y (blue tint)
Content surface area sy surface area (liquid/gas interface) at coordinate y (green tint)
Table 1: Deļ¬ned Variables
4
2.1 Vertical cylinder
Figure 4: Vertical cylinder
A vertical cylinder is the simplest storage tank element, unfortunately not often used in the ļ¬eld. Its equations are:
v = Ļ€R2
L (2.1)
vy = Ļ€R2
y (2.2)
a = 2Ļ€R2
+ 2Ļ€RL (2.3)
wy = Ļ€R2
+ 2Ļ€Ry (2.4)
sy = Ļ€R2
(2.5)
If only all storage tanks were this simple.
5
2.2 Horizontal cylinder
Figure 5: Horizontal cylinder
For a horizontal cylinder, computing partial volume and surface area becomes a bit more complex. Referring to the
variables deļ¬ned in table 1:
Full volume v:
v = Ļ€R2
L (2.6)
vy is acquired by multiplying equation (1.2) by L:
vy =
1
2
Ļ€R2
āˆ’ 2 R2
arcsin
R āˆ’ y
R
āˆ’ 2 2 Ry āˆ’ y2(R āˆ’ y) L (2.7)
Full surface area a (including ļ¬‚at end caps):
a = 2Ļ€R2
+ 2Ļ€RL (2.8)
Full surface area a (excluding end caps):
a = 2Ļ€RL (2.9)
wy represents the partial surface area of two circular end caps (2 Ɨ equation (1.2)), plus the partial surface area
of the cylindrical section (L Ɨ equation (1.3)):
wy = 2
1
2
Ļ€R2
+ R2
arcsin
y āˆ’ R
R
āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) + L Ļ€R + 2 R arcsin
y āˆ’ R
R
(2.10)
After combining/canceling terms, wy becomes:
wy = Ļ€LR + Ļ€R2
+ 2 LR + R2
arcsin
y āˆ’ R
R
āˆ’ 2 2 Ry āˆ’ y2(R āˆ’ y) (2.11)
6
Remember about the above equations that, in some tank analyses, one may wish to only compute the cylinderā€™s
surface area, without end caps. For that case, use this equation (the right-hand part of equation (2.10)):
wy = L Ļ€R + 2 R arcsin
y āˆ’ R
R
(2.12)
sy, content surface area (green plane in ļ¬gure 4), is acquired by multiplying equation (1.1) by L:
sy = 2L (2 R āˆ’ y)y (2.13)
2.3 Sphere
Figure 6: Sphere
A spherical section, often a hemisphere or ellipse at each end of a cylinder, is included in many kinds of tanks. Most
tanks use one or another kind of ellipse or spheroid, more diļ¬ƒcult to analyze. A sphereā€™s equations are:
v =
4
3
Ļ€R3
(2.14)
vy = Ļ€Ry2
āˆ’
1
3
Ļ€y3
(2.15)
a = 4Ļ€R2
(2.16)
wy = 2Ļ€Ry (2.17)
sy = Ļ€(2 R āˆ’ y)y (2.18)
7
2.4 Elliptical end cap
This section analyzes a class of storage tank end cap whose minor radius varies between ļ¬‚at and hemispherical.
The analysis and equations described here are normally added as terms to an equation for the entire tank, one
whose ļ¬nal form has the height variable y common to all its sections.
Figure 7: Elliptical end cap
2.4.1 Notes
Because ellipses possess major and minor radii, this section adopts the convention that R refers to both the cen-
tral cylinderā€™s radius and the ellipseā€™s major radius, and r refers to the ellipseā€™s minor radius, which explains the
unconventional variable names used above.
Elliptical end caps (technically, spheroids3
) have some complex properties, but for a horizontal tank, computing
an end capā€™s full and partial volumes is often a simple matter of computing a spherical result and scaling the result.
Each such end cap is half an oblate spheroid4
, rotated 90ā—¦
from the usual convention, and with major (y-axis) radius
R equal to the tankā€™s primary radius, and a minor (x-axis) radius r lying in the range 0 ā‰¤ r ā‰¤ R.
2.4.2 Volume
The full volume of such an end cap is equal to 1
2 the volume of an oblate spheroid with its described dimensions, or:
v =
2
3
Ļ€R2
r (2.19)
The partial volume equation vy requires some changes to equation (2.15) to accommodate the two required radii,
and remembering that this result is for a single end cap, i.e. 1
2 the volume of an oblate spheroid:
vy =
3 Ļ€Rry2
āˆ’ Ļ€ry3
6 R
(2.20)
8
2.4.3 Surface area
An oblate spheroid end capā€™s full surface area a (half that of an oblate spheroid) requires this equation:
a =
Ļ€r2
tanhāˆ’1 R2āˆ’r2
R2 + Ļ€R2 R2āˆ’r2
R2
R2āˆ’r2
R2
, 0 < r < R (2.21)
Note the valid range of the r argument: 0 < r < R:
ā€¢ For r = 0 (ļ¬‚at end cap), instead use a = Ļ€R2
.
ā€¢ For r = R (spherical end cap), instead use a = 2Ļ€R2
(one end cap).
2.4.4 Partial wetted area
Computing wy, an oblate spheroid wetted area, is more diļ¬ƒcult:
ā€¢ If the minor radius r = 0 (ļ¬‚at end cap), use a circle area partitioned by sensor height y: equation (1.2).
ā€¢ If the minor radius r = R (spherical end cap), use a spherical surface area partitioned by sensor height y: apply
equation (2.17) but multiply the result by r
2R (one end cap):
wy = 2Ļ€Ry
r
2R
(2.22)
ā€¢ If the minor radius r lies in the range 0 < r < R, this is a special case requiring a method like that described
below.
2.4.5 Partial wetted area algorithm
In the event that 0 < r < R, things become even more diļ¬ƒcult. Thereā€™s no closed form equation for partial surface
areas of an oblate spheroid, instead a numerical method must be used. Hereā€™s a description of the authorā€™s method
used in TankCalc:
1. Remember that R = ellipse major radius, and r = ellipse minor radius (ļ¬gure 7).
2. Choose a number of iterations n, larger values produce greater accuracy but require more running time.
3. For each iteration i, generate an x value in the range 0 ā‰¤ x ā‰¤ 1:
x = i
n
4. Use the x value from item (3) to acquire a radius within a modeled quarter-circle:
r =
āˆš
1 āˆ’ x2
5. Using two sequential (i.e. one from iteration i, one from iteration i āˆ’ 1) radius values from item (4) (name
them r1 and r2), compute the area of an equivalent conical frustum5
using the end capsā€™s minor radius divided
by the number of iterations (r/n) as a height:
a = Ļ€(r1 + r2) (r1 āˆ’ r2)2 + (r/n)2
6. Acquire a partitioned area value p using the sensor height argument y and an average of the two computed
radii (ra = (r1 + r2)/2):
(a) if y ā‰¤ 0, p = 0
(b) if y > 2ra, p = a
9
(c) if 0 < y < 2ra, p = a cosāˆ’1 R āˆ’ y
ra
/Ļ€
7. Accumulate the adjusted areas in a sum s:
s = s +
p
n
8. The result should approximate the partial surface area (wetted area) of an elliptical end cap.
2.4.6 Python listing
Hereā€™s Python code for the algorithm described above:
from math import āˆ—
# p a r t i t i o n based on sensor height y
def py(y , r ) :
i f (y <= āˆ’r ) : return 0
e l i f (y >= r ) : return 1
else : return acos (āˆ’(y/ r )) / pi
# p a r t i a l spheroid area
def psa (y , n , r ,R) :
y āˆ’= R
sx = 1.0/n
hsq = ( r /n)āˆ—āˆ—2
a = 0
x = 0
r1 = None
for i in range(n+1):
r2 = sqrt (1āˆ’xāˆ—āˆ—2) āˆ— R
i f ( r1 != None ) :
rsum = r1+r2
# compute frustum surface area
z = pi āˆ— rsum āˆ— sqrt (( r1āˆ’r2 )āˆ—āˆ—2 + hsq )
# s ca l e the r e s u l t based on sensor height y
a += z āˆ— py(y , rsum āˆ— 0.5)
r1 = r2
x += sx
return a
2.4.7 Content surface area
The last equation for an end cap, sy or content surface area, is surprisingly simple ā€“ itā€™s a variation of that used for
a sphere (equation (2.18)), with the result scaled to the spheroidā€™s dimensions:
sy = Ļ€(2R āˆ’ y)y
r
2R
(2.23)
The term at the right serves to adjust the result to correspond to the dimensions of a single, possibly elliptical,
end cap.
3 Practical Application
10
In this section we will apply the prior content to an example tank ā€“ a horizontal cylindrical section with end caps
that can assume some common shapes, and that may diļ¬€er from each other. To avoid excessive complexity, this
example considers a horizontal tank, which means, with a single exception, itā€™s accessible to closed-form analysis,
i.e. using clearly deļ¬ned equations and no numerical calculus methods required. (The one exception involves ļ¬nding
the partial wetted area of an elliptical end cap, as explained above.) The end result will be a table that correlates
sensor heights and tank partial volumes.
Hereā€™s an outline to follow when analyzing a storage tank:
ā€¢ Measure the tank, keeping in mind that an accurate analysis requires the tankā€™s internal dimensions.
ā€¢ Consider the tank as three sections ā€“ a central cylinder and two end caps. If the end caps diļ¬€er, apply
appropriate equations and measurement values for each.
ā€¢ Remember that the tankā€™s three sections have one variable in common ā€“ the sensor height. This makes it
possible to generate a single sensor to volume table.
ā€¢ Choose a suitable method for processing the tank. For common tank types and small workloads, use TankCalc6
,
my free Java program. For more ambitious projects, and in particular if developing code to be used widely, I
recommend Python for the development phase.
ā€¢ Always include equations and results for full tank volume and surface area. This serves multiple purposes,
including a veriļ¬cation check of the data tableā€™s results. As one testing example, for a horizontal tank with a
cylindrical cross-section, the volume value at a sensor height that is half the tankā€™s height should be exactly 1
2
the full volume.
ā€¢ Remember that, unless a program like TankCalc is in use, all the measurements should use the same units,
and the results will be expressed in the chosen units squared (surface area) and cubed (volume).
3.1 Example tank
Figure 8: Example Tank Diagram
11
3.1.1 Measuring the tank
For this example, letā€™s say we have a tank like that shown in ļ¬gure (8) ready for analysis. We need to acquire
measurements and translate them into the values required by this method. The values are:
ā€¢ Cylinder length (L):
ā€“ This is the easiest measurement to make.
ā€“ Many tanks have a clear weld line at the intersection of the cylindrical section and the end caps, which
simpliļ¬es this measurement.
ā€“ Because this measurement is taken parallel to the tank wall, the wallā€™s thickness is not an issue.
ā€¢ Major radius (R):
ā€“ If thereā€™s any confusion about the meaning of this term, imagine a line extending from the tankā€™s centerline
to the inside of the cylinder wall.
ā€“ The radius is half the tankā€™s diameter, but remember that most ways to measure a tankā€™s diameter will
need to subtract the tankā€™s wall thickness.
ā€“ One way to acquire a value for R is to take a ļ¬‚exible tape measure and pass it around the cylinderā€™s
circumference, then divide the result by 2Ļ€ (Circumference C = 2Ļ€R).
ā€“ A correction can be made to the above measurement for wall thickness ā€“ if you know the tankā€™s wall
thickness, multiply it by 2Ļ€ and subtract that from the above result.
ā€¢ Minor radius (r):
ā€“ This is the most diļ¬ƒcult measurement ā€“ thereā€™s often no easy way to acquire it from outside the tank.
ā€“ One method is to use a plumb line, make chalk marks at the base of the tank, and measure the distance
between the marks.
ā€“ Remember to subtract the wall thickness from the measured value.
ā€“ If the end caps diļ¬€er, take two measurements and process them independently.
ā€“ Remember that for a ļ¬‚at end cap, assign an r value of zero.
Remember also that, if manufacturer documentation is available for the tank, this might be a better way to
acquire the needed values.
3.1.2 Choosing the equations
This becomes easier with experience. For the example tank, and assuming we want full and partial volumes and
content surface area, we would acquire:
ā€¢ Central cylinder:
ā€“ Full volume: equation (2.6).
ā€“ Partial volume based on sensor height y: equation (2.7).
ā€“ Full surface area excluding end caps: equation (2.9).
ā€“ Content surface area based on sensor height y: equation (1.1), multiply the result by L.
ā€¢ End Caps:
ā€“ Full volume: equation (2.19).
ā€“ Partial volume based on sensor height y: equation (2.20).
ā€“ Full surface area: equation (2.21).
ā€“ Content surface area based on sensor height y: equation (2.22).
For two identical end caps, one may multiply by 2 the result for one equation.
12
3.1.3 Example program
Follow this link7
for an example Python program that performs all the tasks outlined in the prior section, prints a
summary list of tank properties, then prints a table of values correlating sensor height, volume, and content surface
area. At the top of the program is a set of user-deļ¬nable values that permit the user to customize the results.
Examination of this Python program should give readers a sense of how to proceed in crafting a solution for many
types of common storage tanks.
4 Overview
4.1 TankCalc
Figure 9: TankCalc numerical strategy
The methods this article describes are valid for horizontal or (in a few cases) vertical tanks, but if the tank is tilted at
an angle to the local horizon (meaning the tankā€™s contents rest at an angle with respect to the tank itself), closed-form
methods fail. This is because the methods used to describe the relationship between a tank and its contents require
that they have a reference plane in common, either parallel or orthogonal.
4.1.1 Tilted tanks
When I ļ¬rst described methods for analyzing storage tanks, they were much like those in this article ā€“ straightforward
and closed-form. I soon began to receive inquiries from people with actual storage tanks, who asked whether my
methods could be applied to tilted tanks. I was initially mystiļ¬ed ā€“ who would do such a thing to a perfectly good
tank? But my correspondents educated me ā€“ there are very good reasons to tilt a tank, one being that it sequesters
impurities in a waste area and allows relatively pure product to be drawn from the tank until itā€™s nearly empty.
So to meet this need I wrote TankCalc, which, unlike the closed-form methods described in this article, uses
a numerical scheme. In some ways TankCalc is simpler and easier to understand than this articleā€™s methods ā€“ it
relies on a relatively simple numerical Calculus scheme that iteratively generates disks that are partitioned by the
tankā€™s contents (using a version of equation (1.2)), and sums their two-dimensional partial areas to construct a
three-dimensional partial volume (as shown in ļ¬gure 9 ā€“ imagine thousands of disks) ā€“ but in other ways itā€™s less
satisfactory. One drawback to the TankCalc approach is that the results are approximate ā€“ quite accurate, but never
exact. Another drawback is that, unlike the closed-form equations in this article, TankCalcā€™s numerical methods
canā€™t be easily manipulated to get diļ¬€erent kinds of results.
13
To me, TankCalc exempliļ¬es the collision between pure and applied mathematics, and supports Einsteinā€™s famous
aphorism: ā€As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain,
they do not refer to reality.ā€
4.2 Tools
In the process of creating mathematical results for articles like this one, I rely on a number of tools including Sage8
,
IPython9
and much past experience in storage tank analysis.
4.2.1 Sage
Sage in particular has turned out to be a valuable resource for both symbolic and numerical results. Because Sage
relies on Python, itā€™s a relatively simple matter to produce a new symbolic result in Sage, then transfer it to a Python
working script for further analysis and tuning. Hereā€™s an example:
I start with an equation that, if presented with a y coordinate within a circle of radius R, will return the circleā€™s
width at that coordinate ā€“ see equation (1.1) and ļ¬gure (1) above. The equation:
w = 2 (2 R āˆ’ y)y (4.1)
First I want to be sure the equation produces the hoped-for result, that is, a width corresponding to a given y
coordinate within a circle. So to ļ¬nd out I provide Sage with the equation and plotting instructions:
f(y,R) = 2 * sqrt ((2*R-y) * y)
plot(f(y,10),y,0,20, axes_labels =(ā€™yā€™,ā€™result ā€™),gridlines=True ,figsize =(5 ,3))
show(f(y,R))
latex(f(y,R))
Sage responds with:
2 (2 R āˆ’ y)y
2 , sqrt{{left(2 , R - yright)} y}
The ļ¬nal printed result above allows me to easily copy LaTeX code from Sage into an article like this one.
At this point I realize that, if I integrate the above equation on the interval 0 ā‰¤ z ā‰¤ y, I will have an equation
for partial circle area, useful in a number of ways. So I instruct Sage thus:
14
assume(y > 0)
assume(R > 0)
fi(y,R) = integrate(f(z,R),z,0,y)
plot(fi(y,10),y,0,20, axes_labels =(ā€™yā€™,ā€™result ā€™),gridlines=True ,figsize =(5 ,3))
show(fi(y,R))
Sage responds with:
āˆ’R2
arcsin
āˆš
R2(Rāˆ’y)
R2 + R2
arcsin
āˆš
R2
R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y)
The graph shows me that the integration result is valid, providing an equation for the partial area of a circle,
but looking at the equation I suspect it might not be written in the most concise way (when I see an expression likeāˆš
R2, my alarm bells go oļ¬€), so I tell Sage:
fi(y,R) = fi(y,R). full_simplify ()
show(fi(y,R))
Sage responds with:
1
2 Ļ€R2
āˆ’ R2
arcsin Rāˆ’y
R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y)
Much better.
4.2.2 Texmaker
Iā€™m sure there are as many views about the ideal LaTeX editor as there are users of such programs. At the moment
my favorite is Texmaker10
, a rather nice, free LaTeX editor with versions for all common platforms.
Texmaker greatly simpliļ¬es the task of LaTeX creation and editing compared to programs available only a few
years ago. It certainly represents an improvement over how I once created LaTeX ā€“ by hand-entering everything,
then submitting it to a renderer/converter to see where I had gone wrong.
15
Along with Inkscape and Povray described below, Texmaker belongs to my favorite class of programs ā€“ those
that are created and maintained by people who just want the best tools, and who can aļ¬€ord to build them without
thought of commercial gain.
The availability and ease of use of programs like Texmaker, and some others, is producing a change in how I create
Web content. A long-time static HTML page creator using my Web creation tool Arachnophilia11
, I have recently
been writing articles with more mathematical content, which requires extra eļ¬€ort in HTML. Also my numbered
footnote/reference lists have become longer and therefore harder to edit and maintain. Finally, people have begun
to ask for PDF versions of some of my more widely read articles, which requires a conversion from HTML to PDF,
with sometimes mediocre results.
This change of direction in recent articles means the article source is a plain-text LaTeX document, with a PDF
rendering, and ļ¬nally an HTML version of the LaTeX source using a Python conversion script. This arrangement
means the PDF version is often a much better rendering than the HTML.
4.2.3 Inkscape
Most of the diagrams in this article were captioned using Inkscape12
. Inkscape is a very good drawing program,
much better than one expects in a program category that for some reason seems to attract mediocrity and bugginess.
Itā€™s not often that I see a program that already oļ¬€ers the features I think I need after working with it for a spell.
Inkscape has a lot of useful features, more than I have ļ¬gured out yet.
4.2.4 Povray
Povray13
is a venerable ray tracing14
program that has existed in various forms for almost 30 years, and that keeps
getting better. I keep expecting something better to come along ā€“ a program that joins a convenient modeler like
Blender15
to the ability to perform the kind of ray tracing that graphics perfectionists expect. But that goal remains
out of reach, and Povray continues to be my choice for images like those in this article, in which, to pictorialize
how TankCalc creates numerical partial volume results, I needed transparent, realistic 3D renderings with multiple
elements. After a bit of coding and testing, Povray produced them.
Click this link to see what Povray can do, and why the ray tracing method is regarded as superior to other graphic
rendering methods.
References
1StorageTank Modeling ā€“ a collection of tank modeling articles at http://arachnoid.com.
2TankCalc ā€“ the authorā€™s tank analysis program.
3Spheroid ā€“ an ellipse of revolution.
4Oblate spheroid ā€“ an ellipse of revolution whose polar axis is smaller than its equatorial diameter.
5Conical Frustum ā€“ a geometric element whose methods aid storage tank analysis.
6TankCalc (see note 2)
7Example Tank Analysis ā€“ a Python program that summarizes this articleā€™s methods.
8Sage ā€“ a powerful, free, open-source mathematical environment.
9IPython ā€“ a Python-based mathematical environment, requires less storage and horsepower than Sage.
10Texmaker ā€“ a free, open-source, cross-platform LaTeX editor.
11Arachnophilia ā€“ my free Web development environment.
12Inkscape (after image generation using Povray ā€“see below) ā€“ a terriļ¬c, free, open-source drawing program.
13Povray ā€“ the Persistence Of Vision raytracer.
14Ray Tracing (graphics) ā€“ a method for producing very realistic graphic renderings.
15Blender ā€“ an animation and photorealistic graphics workshop.
16

More Related Content

What's hot

Mathematics grade-3-1.1
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1Benficious
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 18
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 18Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 18
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 18Grey Enterprise Holdings, Inc.
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 17
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 17Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 17
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 17Grey Enterprise Holdings, Inc.
Ā 
Christian Mystics Part One A Full Library of Over One Hundred Christian Mystics
Christian Mystics Part One A Full Library of Over One Hundred Christian MysticsChristian Mystics Part One A Full Library of Over One Hundred Christian Mystics
Christian Mystics Part One A Full Library of Over One Hundred Christian MysticsSister Lara
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 11
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 11Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 11
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 11Grey Enterprise Holdings, Inc.
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 05
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 05Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 05
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 05Grey Enterprise Holdings, Inc.
Ā 
Stronghold manual
Stronghold manualStronghold manual
Stronghold manualToni Harianto
Ā 
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...Sister Lara
Ā 
R Ints
R IntsR Ints
R IntsAjay Ohri
Ā 
Doctrine Manual
Doctrine ManualDoctrine Manual
Doctrine ManualTanvir Ahmad
Ā 
Maintenance&amp;service unpaved roads
Maintenance&amp;service unpaved roadsMaintenance&amp;service unpaved roads
Maintenance&amp;service unpaved roadsSierra Francisco Justo
Ā 
8 florida maintenance&amp;service unpaved roads
8 florida maintenance&amp;service unpaved roads8 florida maintenance&amp;service unpaved roads
8 florida maintenance&amp;service unpaved roadsSierra Francisco Justo
Ā 
Creating Scientific Posters
Creating Scientific PostersCreating Scientific Posters
Creating Scientific Postersemphemory
Ā 
Drivers licence
Drivers licenceDrivers licence
Drivers licenceguest0dc49c4
Ā 
Master cc&amp;r's 2002-482548-082902
Master cc&amp;r's 2002-482548-082902Master cc&amp;r's 2002-482548-082902
Master cc&amp;r's 2002-482548-082902Steve Alexander
Ā 
Rocket and spacecraft propulsion
Rocket and spacecraft propulsionRocket and spacecraft propulsion
Rocket and spacecraft propulsionLsquirrel
Ā 
The Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologyThe Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologySister Lara
Ā 

What's hot (19)

Mathematics grade-3-1.1
Mathematics grade-3-1.1Mathematics grade-3-1.1
Mathematics grade-3-1.1
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 18
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 18Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 18
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 18
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 17
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 17Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 17
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 17
Ā 
Tasc II
Tasc IITasc II
Tasc II
Ā 
Christian Mystics Part One A Full Library of Over One Hundred Christian Mystics
Christian Mystics Part One A Full Library of Over One Hundred Christian MysticsChristian Mystics Part One A Full Library of Over One Hundred Christian Mystics
Christian Mystics Part One A Full Library of Over One Hundred Christian Mystics
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 11
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 11Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 11
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 11
Ā 
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 05
Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 05Perryā€™s Chemical Engineersā€™ Handbook  7ma Ed Chap 05
Perryā€™s Chemical Engineersā€™ Handbook 7ma Ed Chap 05
Ā 
Stronghold manual
Stronghold manualStronghold manual
Stronghold manual
Ā 
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...
Archaeology in the Holy Bible List of Artifacts in Biblical Studies of Archae...
Ā 
R Ints
R IntsR Ints
R Ints
Ā 
Doctrine Manual
Doctrine ManualDoctrine Manual
Doctrine Manual
Ā 
Maintenance&amp;service unpaved roads
Maintenance&amp;service unpaved roadsMaintenance&amp;service unpaved roads
Maintenance&amp;service unpaved roads
Ā 
8 florida maintenance&amp;service unpaved roads
8 florida maintenance&amp;service unpaved roads8 florida maintenance&amp;service unpaved roads
8 florida maintenance&amp;service unpaved roads
Ā 
01 sepulveda
01 sepulveda01 sepulveda
01 sepulveda
Ā 
Creating Scientific Posters
Creating Scientific PostersCreating Scientific Posters
Creating Scientific Posters
Ā 
Drivers licence
Drivers licenceDrivers licence
Drivers licence
Ā 
Master cc&amp;r's 2002-482548-082902
Master cc&amp;r's 2002-482548-082902Master cc&amp;r's 2002-482548-082902
Master cc&amp;r's 2002-482548-082902
Ā 
Rocket and spacecraft propulsion
Rocket and spacecraft propulsionRocket and spacecraft propulsion
Rocket and spacecraft propulsion
Ā 
The Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God EthomologyThe Eagle The Beautiful Creation of God Ethomology
The Eagle The Beautiful Creation of God Ethomology
Ā 

Similar to Storage container tank mathematics

1987 army-corps-wetlands-delineation-manual
1987 army-corps-wetlands-delineation-manual1987 army-corps-wetlands-delineation-manual
1987 army-corps-wetlands-delineation-manualJA Larson
Ā 
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...Aditya Singh
Ā 
More solutions for sticky problems
More solutions for sticky problemsMore solutions for sticky problems
More solutions for sticky problemsLuis Ciaffardini
Ā 
Manual for the design of pipe systems and pumps
Manual for the design of pipe systems and pumpsManual for the design of pipe systems and pumps
Manual for the design of pipe systems and pumpsSandro Marques Solidario
Ā 
Solar Energy Equipment: Design of a solar plant for a building
Solar Energy Equipment: Design of a solar plant for a buildingSolar Energy Equipment: Design of a solar plant for a building
Solar Energy Equipment: Design of a solar plant for a buildingPietro Galli
Ā 
Circuitikzmanual
CircuitikzmanualCircuitikzmanual
CircuitikzmanualFrank Rojas
Ā 
Quantum Mechanics: Lecture notes
Quantum Mechanics: Lecture notesQuantum Mechanics: Lecture notes
Quantum Mechanics: Lecture notespolariton
Ā 
Review of completion_technologies(1)
Review of completion_technologies(1)Review of completion_technologies(1)
Review of completion_technologies(1)Lawrence Kwende
Ā 
Heat exchanger - Training course material
Heat exchanger - Training course materialHeat exchanger - Training course material
Heat exchanger - Training course materialBassem Eleaba, MEng
Ā 
Martin_Ness_Bachelor_Thesis
Martin_Ness_Bachelor_ThesisMartin_Ness_Bachelor_Thesis
Martin_Ness_Bachelor_ThesisMartĆ­n Ness
Ā 
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docx
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docxPhysics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docx
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docxmattjtoni51554
Ā 
MH - FINAL - CS
MH - FINAL - CSMH - FINAL - CS
MH - FINAL - CSLulu Buford
Ā 
03-Misiti_-_Wavelets_and_Their_Applications.pdf
03-Misiti_-_Wavelets_and_Their_Applications.pdf03-Misiti_-_Wavelets_and_Their_Applications.pdf
03-Misiti_-_Wavelets_and_Their_Applications.pdfJESUSELVISCASTAEDACA
Ā 
Basics of Air cooler design and inspection
Basics of Air cooler design and inspectionBasics of Air cooler design and inspection
Basics of Air cooler design and inspectionAekachai Ngernsomthong
Ā 
Preliminary Design of a FOWT
Preliminary Design of a FOWTPreliminary Design of a FOWT
Preliminary Design of a FOWTPietro Rosiello
Ā 

Similar to Storage container tank mathematics (20)

1987 army-corps-wetlands-delineation-manual
1987 army-corps-wetlands-delineation-manual1987 army-corps-wetlands-delineation-manual
1987 army-corps-wetlands-delineation-manual
Ā 
Pst eucl-doc
Pst eucl-docPst eucl-doc
Pst eucl-doc
Ā 
thesis
thesisthesis
thesis
Ā 
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...
Xin-She Yang - Introductory Mathematics for Earth Scientists -Dunedin Academi...
Ā 
More solutions for sticky problems
More solutions for sticky problemsMore solutions for sticky problems
More solutions for sticky problems
Ā 
Manual for the design of pipe systems and pumps
Manual for the design of pipe systems and pumpsManual for the design of pipe systems and pumps
Manual for the design of pipe systems and pumps
Ā 
Die casting2
Die casting2Die casting2
Die casting2
Ā 
Solar Energy Equipment: Design of a solar plant for a building
Solar Energy Equipment: Design of a solar plant for a buildingSolar Energy Equipment: Design of a solar plant for a building
Solar Energy Equipment: Design of a solar plant for a building
Ā 
Circuitikzmanual
CircuitikzmanualCircuitikzmanual
Circuitikzmanual
Ā 
Quantum Mechanics: Lecture notes
Quantum Mechanics: Lecture notesQuantum Mechanics: Lecture notes
Quantum Mechanics: Lecture notes
Ā 
Review of completion_technologies(1)
Review of completion_technologies(1)Review of completion_technologies(1)
Review of completion_technologies(1)
Ā 
Heat exchanger - Training course material
Heat exchanger - Training course materialHeat exchanger - Training course material
Heat exchanger - Training course material
Ā 
Martin_Ness_Bachelor_Thesis
Martin_Ness_Bachelor_ThesisMartin_Ness_Bachelor_Thesis
Martin_Ness_Bachelor_Thesis
Ā 
MastersThesis
MastersThesisMastersThesis
MastersThesis
Ā 
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docx
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docxPhysics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docx
Physics 101 Lab ManualDr. W.A.AtkinsonSouthern Illinois .docx
Ā 
MH - FINAL - CS
MH - FINAL - CSMH - FINAL - CS
MH - FINAL - CS
Ā 
Zettili.pdf
Zettili.pdfZettili.pdf
Zettili.pdf
Ā 
03-Misiti_-_Wavelets_and_Their_Applications.pdf
03-Misiti_-_Wavelets_and_Their_Applications.pdf03-Misiti_-_Wavelets_and_Their_Applications.pdf
03-Misiti_-_Wavelets_and_Their_Applications.pdf
Ā 
Basics of Air cooler design and inspection
Basics of Air cooler design and inspectionBasics of Air cooler design and inspection
Basics of Air cooler design and inspection
Ā 
Preliminary Design of a FOWT
Preliminary Design of a FOWTPreliminary Design of a FOWT
Preliminary Design of a FOWT
Ā 

More from Usama Khan

The humble check_valve
The humble check_valveThe humble check_valve
The humble check_valveUsama Khan
Ā 
Explosion of a sulphuric acid tank
Explosion of a sulphuric acid tankExplosion of a sulphuric acid tank
Explosion of a sulphuric acid tankUsama Khan
Ā 
British women chemists and world war 1
British women chemists and world war 1British women chemists and world war 1
British women chemists and world war 1Usama Khan
Ā 
Oilivia gasolino upstream_en
Oilivia gasolino upstream_enOilivia gasolino upstream_en
Oilivia gasolino upstream_enUsama Khan
Ā 
Liquid chlorine incident
Liquid chlorine incidentLiquid chlorine incident
Liquid chlorine incidentUsama Khan
Ā 
Results phe works 2.0 2
Results phe works 2.0 2Results phe works 2.0 2
Results phe works 2.0 2Usama Khan
Ā 
A non-Iterative way for preliminary designing Plate & Frame Exchanger
A non-Iterative way for preliminary designing Plate & Frame ExchangerA non-Iterative way for preliminary designing Plate & Frame Exchanger
A non-Iterative way for preliminary designing Plate & Frame ExchangerUsama Khan
Ā 
Asahi AKC electrolyzer magazine
Asahi AKC electrolyzer magazineAsahi AKC electrolyzer magazine
Asahi AKC electrolyzer magazineUsama Khan
Ā 
Understanding units of gas concentration
Understanding units of gas concentrationUnderstanding units of gas concentration
Understanding units of gas concentrationUsama Khan
Ā 
The psychrometric chart theory and application
The psychrometric chart theory and applicationThe psychrometric chart theory and application
The psychrometric chart theory and applicationUsama Khan
Ā 
Wet Binary Hydrogen & Chlorine
Wet Binary Hydrogen & ChlorineWet Binary Hydrogen & Chlorine
Wet Binary Hydrogen & ChlorineUsama Khan
Ā 
VLE VAPOR LIQUID EQUILIBRIUM - Introduction
VLE VAPOR LIQUID EQUILIBRIUM -  Introduction VLE VAPOR LIQUID EQUILIBRIUM -  Introduction
VLE VAPOR LIQUID EQUILIBRIUM - Introduction Usama Khan
Ā 
Kf units Electrolytic Cell Volt Regression
Kf units Electrolytic Cell Volt RegressionKf units Electrolytic Cell Volt Regression
Kf units Electrolytic Cell Volt RegressionUsama Khan
Ā 
Vocabulary For Engineering Resumes
Vocabulary For Engineering ResumesVocabulary For Engineering Resumes
Vocabulary For Engineering ResumesUsama Khan
Ā 
Compressor Polytropic Efficiency Calculation
Compressor Polytropic Efficiency CalculationCompressor Polytropic Efficiency Calculation
Compressor Polytropic Efficiency CalculationUsama Khan
Ā 
details_calculated
details_calculateddetails_calculated
details_calculatedUsama Khan
Ā 

More from Usama Khan (17)

The humble check_valve
The humble check_valveThe humble check_valve
The humble check_valve
Ā 
Explosion of a sulphuric acid tank
Explosion of a sulphuric acid tankExplosion of a sulphuric acid tank
Explosion of a sulphuric acid tank
Ā 
British women chemists and world war 1
British women chemists and world war 1British women chemists and world war 1
British women chemists and world war 1
Ā 
Oilivia gasolino upstream_en
Oilivia gasolino upstream_enOilivia gasolino upstream_en
Oilivia gasolino upstream_en
Ā 
Liquid chlorine incident
Liquid chlorine incidentLiquid chlorine incident
Liquid chlorine incident
Ā 
Results phe works 2.0 2
Results phe works 2.0 2Results phe works 2.0 2
Results phe works 2.0 2
Ā 
A non-Iterative way for preliminary designing Plate & Frame Exchanger
A non-Iterative way for preliminary designing Plate & Frame ExchangerA non-Iterative way for preliminary designing Plate & Frame Exchanger
A non-Iterative way for preliminary designing Plate & Frame Exchanger
Ā 
Asahi AKC electrolyzer magazine
Asahi AKC electrolyzer magazineAsahi AKC electrolyzer magazine
Asahi AKC electrolyzer magazine
Ā 
Understanding units of gas concentration
Understanding units of gas concentrationUnderstanding units of gas concentration
Understanding units of gas concentration
Ā 
The psychrometric chart theory and application
The psychrometric chart theory and applicationThe psychrometric chart theory and application
The psychrometric chart theory and application
Ā 
Wet Binary Hydrogen & Chlorine
Wet Binary Hydrogen & ChlorineWet Binary Hydrogen & Chlorine
Wet Binary Hydrogen & Chlorine
Ā 
VLE VAPOR LIQUID EQUILIBRIUM - Introduction
VLE VAPOR LIQUID EQUILIBRIUM -  Introduction VLE VAPOR LIQUID EQUILIBRIUM -  Introduction
VLE VAPOR LIQUID EQUILIBRIUM - Introduction
Ā 
Kf units Electrolytic Cell Volt Regression
Kf units Electrolytic Cell Volt RegressionKf units Electrolytic Cell Volt Regression
Kf units Electrolytic Cell Volt Regression
Ā 
Vocabulary For Engineering Resumes
Vocabulary For Engineering ResumesVocabulary For Engineering Resumes
Vocabulary For Engineering Resumes
Ā 
Compressor Polytropic Efficiency Calculation
Compressor Polytropic Efficiency CalculationCompressor Polytropic Efficiency Calculation
Compressor Polytropic Efficiency Calculation
Ā 
Folders
FoldersFolders
Folders
Ā 
details_calculated
details_calculateddetails_calculated
details_calculated
Ā 

Recently uploaded

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
Ā 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
Ā 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
Ā 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
Ā 
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
Ā 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
Ā 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
Ā 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
Ā 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
Ā 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĆ£o Esperancinha
Ā 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
Ā 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
Ā 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
Ā 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
Ā 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
Ā 

Recently uploaded (20)

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Ā 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
Ā 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
Ā 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
Ā 
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
šŸ”9953056974šŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
Ā 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
Ā 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Ā 
young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Serviceyoung call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
Ā 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Ā 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
Ā 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Ā 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
Ā 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Ā 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
Ā 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
Ā 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
Ā 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
Ā 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
Ā 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
Ā 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
Ā 

Storage container tank mathematics

  • 1. Storage Container Mathematics Copyright c 2015, Paul Lutus Most recent revision: June 5, 2015 Abstract This is a collection of full and partial, volume and surface area equations for common storage tank types. Itā€™s meant to serve as an easy-to-use reference for tank analysis methods and mathematics that are distributed across many articles located in the storage tank modeling section1 of http://arachnoid.com. The overarching purpose of this activity is to create summaries and accurate sensor height to volume tables for various kinds of storage tanks. An additional goal is to provide full and partial surface area results when possible. The mathematical treatments are arranged to progress from simple to complex, in most cases building on what has already been presented. Contents 1 Circle equations 2 1.1 Common conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Circle width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Circle partial area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Circle partial circumference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Common container geometries 4 2.1 Vertical cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Horizontal cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 Elliptical end cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4.1 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4.2 Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4.3 Surface area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4.4 Partial wetted area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4.5 Partial wetted area algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4.6 Python listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4.7 Content surface area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3 Practical Application 10 3.1 Example tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.1 Measuring the tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1.2 Choosing the equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1.3 Example program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1
  • 2. 4 Overview 13 4.1 TankCalc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.1.1 Tilted tanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.2.1 Sage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.2.2 Texmaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.2.3 Inkscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.2.4 Povray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 List of Figures 1 Partitioned Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Partial circle area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 Partial circumference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 Vertical cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 Horizontal cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 Elliptical end cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 8 Example Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9 TankCalc numerical strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 List of Tables 1 Deļ¬ned Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1 Circle equations This section describes some basic equations from which most of the later equations are derived. 1.1 Common conventions Certain common names used in geometry have diļ¬€erent assignments here, to remain consistent across uses and to agree with the conventions used in TankCalc2 , the authorā€™s tank analysis program. One convention seen here diļ¬€ers from TankCalc. In this and later sections, the y value, normally associated with a content sensor height, has a range of 0 ā‰¤ y ā‰¤ 2R, which I think is more consistent and logical than the prior convention. This convention diļ¬€ers from that in the TankCalc documentation, where āˆ’R ā‰¤ y ā‰¤ R. This change produces a number of changes in the dependent equations, and readers should expect to see equation forms that diļ¬€er from those on the arachnoid.com website. 2
  • 3. Figure 1: Partitioned Circle 1.2 Circle width We ļ¬rst compute w (green line in ļ¬gure 1), the width across the circle deļ¬ned by the y bisector argument: w = 2 (2 R āˆ’ y)y (1.1) This equation can be easily used to compute a cylinderā€™s content surface area ā€“ just multiply its result by the length of the cylinder: a = 2 (2 R āˆ’ y)yL. 1.3 Circle partial area By integrating equation (1.1) on the interval 0 ā‰¤ z ā‰¤ y, we acquire an equation for the area of the blue shaded segment in ļ¬gure 1. This result is later used to compute end cap partial areas and volumes, and cylindrical partial volumes: a = y 0 2 (2 R āˆ’ z)z dz = 1 2 Ļ€R2 + R2 arcsin y āˆ’ R R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) (1.2) Equation (1.2) produces this result for R = 1: Figure 2: Partial circle area 3
  • 4. 1.4 Circle partial circumference We also require the partial circumference deļ¬ned by the y bisector argument and represented by the red line in ļ¬gure 1, later used as a term in cylinder partial surface area equations: c = Ļ€R āˆ’ 2 R arcsin R āˆ’ y R (1.3) Equation (1.3) produces this result for R = 1: Figure 3: Partial circumference The equations to come are, to the extent practical, derived from these basic equations. 2 Common container geometries For each of the following storage container types, equations are provided for: Description Variable Notes Content height y the location of the top of the containerā€™s contents Full Volume v container full volume Content Partial volume vy content volume from container base to coordinate y (blue tint) Full Area a container full surface area Content wetted area wy wetted area (liquid/wall interface) from container base to coordinate y (blue tint) Content surface area sy surface area (liquid/gas interface) at coordinate y (green tint) Table 1: Deļ¬ned Variables 4
  • 5. 2.1 Vertical cylinder Figure 4: Vertical cylinder A vertical cylinder is the simplest storage tank element, unfortunately not often used in the ļ¬eld. Its equations are: v = Ļ€R2 L (2.1) vy = Ļ€R2 y (2.2) a = 2Ļ€R2 + 2Ļ€RL (2.3) wy = Ļ€R2 + 2Ļ€Ry (2.4) sy = Ļ€R2 (2.5) If only all storage tanks were this simple. 5
  • 6. 2.2 Horizontal cylinder Figure 5: Horizontal cylinder For a horizontal cylinder, computing partial volume and surface area becomes a bit more complex. Referring to the variables deļ¬ned in table 1: Full volume v: v = Ļ€R2 L (2.6) vy is acquired by multiplying equation (1.2) by L: vy = 1 2 Ļ€R2 āˆ’ 2 R2 arcsin R āˆ’ y R āˆ’ 2 2 Ry āˆ’ y2(R āˆ’ y) L (2.7) Full surface area a (including ļ¬‚at end caps): a = 2Ļ€R2 + 2Ļ€RL (2.8) Full surface area a (excluding end caps): a = 2Ļ€RL (2.9) wy represents the partial surface area of two circular end caps (2 Ɨ equation (1.2)), plus the partial surface area of the cylindrical section (L Ɨ equation (1.3)): wy = 2 1 2 Ļ€R2 + R2 arcsin y āˆ’ R R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) + L Ļ€R + 2 R arcsin y āˆ’ R R (2.10) After combining/canceling terms, wy becomes: wy = Ļ€LR + Ļ€R2 + 2 LR + R2 arcsin y āˆ’ R R āˆ’ 2 2 Ry āˆ’ y2(R āˆ’ y) (2.11) 6
  • 7. Remember about the above equations that, in some tank analyses, one may wish to only compute the cylinderā€™s surface area, without end caps. For that case, use this equation (the right-hand part of equation (2.10)): wy = L Ļ€R + 2 R arcsin y āˆ’ R R (2.12) sy, content surface area (green plane in ļ¬gure 4), is acquired by multiplying equation (1.1) by L: sy = 2L (2 R āˆ’ y)y (2.13) 2.3 Sphere Figure 6: Sphere A spherical section, often a hemisphere or ellipse at each end of a cylinder, is included in many kinds of tanks. Most tanks use one or another kind of ellipse or spheroid, more diļ¬ƒcult to analyze. A sphereā€™s equations are: v = 4 3 Ļ€R3 (2.14) vy = Ļ€Ry2 āˆ’ 1 3 Ļ€y3 (2.15) a = 4Ļ€R2 (2.16) wy = 2Ļ€Ry (2.17) sy = Ļ€(2 R āˆ’ y)y (2.18) 7
  • 8. 2.4 Elliptical end cap This section analyzes a class of storage tank end cap whose minor radius varies between ļ¬‚at and hemispherical. The analysis and equations described here are normally added as terms to an equation for the entire tank, one whose ļ¬nal form has the height variable y common to all its sections. Figure 7: Elliptical end cap 2.4.1 Notes Because ellipses possess major and minor radii, this section adopts the convention that R refers to both the cen- tral cylinderā€™s radius and the ellipseā€™s major radius, and r refers to the ellipseā€™s minor radius, which explains the unconventional variable names used above. Elliptical end caps (technically, spheroids3 ) have some complex properties, but for a horizontal tank, computing an end capā€™s full and partial volumes is often a simple matter of computing a spherical result and scaling the result. Each such end cap is half an oblate spheroid4 , rotated 90ā—¦ from the usual convention, and with major (y-axis) radius R equal to the tankā€™s primary radius, and a minor (x-axis) radius r lying in the range 0 ā‰¤ r ā‰¤ R. 2.4.2 Volume The full volume of such an end cap is equal to 1 2 the volume of an oblate spheroid with its described dimensions, or: v = 2 3 Ļ€R2 r (2.19) The partial volume equation vy requires some changes to equation (2.15) to accommodate the two required radii, and remembering that this result is for a single end cap, i.e. 1 2 the volume of an oblate spheroid: vy = 3 Ļ€Rry2 āˆ’ Ļ€ry3 6 R (2.20) 8
  • 9. 2.4.3 Surface area An oblate spheroid end capā€™s full surface area a (half that of an oblate spheroid) requires this equation: a = Ļ€r2 tanhāˆ’1 R2āˆ’r2 R2 + Ļ€R2 R2āˆ’r2 R2 R2āˆ’r2 R2 , 0 < r < R (2.21) Note the valid range of the r argument: 0 < r < R: ā€¢ For r = 0 (ļ¬‚at end cap), instead use a = Ļ€R2 . ā€¢ For r = R (spherical end cap), instead use a = 2Ļ€R2 (one end cap). 2.4.4 Partial wetted area Computing wy, an oblate spheroid wetted area, is more diļ¬ƒcult: ā€¢ If the minor radius r = 0 (ļ¬‚at end cap), use a circle area partitioned by sensor height y: equation (1.2). ā€¢ If the minor radius r = R (spherical end cap), use a spherical surface area partitioned by sensor height y: apply equation (2.17) but multiply the result by r 2R (one end cap): wy = 2Ļ€Ry r 2R (2.22) ā€¢ If the minor radius r lies in the range 0 < r < R, this is a special case requiring a method like that described below. 2.4.5 Partial wetted area algorithm In the event that 0 < r < R, things become even more diļ¬ƒcult. Thereā€™s no closed form equation for partial surface areas of an oblate spheroid, instead a numerical method must be used. Hereā€™s a description of the authorā€™s method used in TankCalc: 1. Remember that R = ellipse major radius, and r = ellipse minor radius (ļ¬gure 7). 2. Choose a number of iterations n, larger values produce greater accuracy but require more running time. 3. For each iteration i, generate an x value in the range 0 ā‰¤ x ā‰¤ 1: x = i n 4. Use the x value from item (3) to acquire a radius within a modeled quarter-circle: r = āˆš 1 āˆ’ x2 5. Using two sequential (i.e. one from iteration i, one from iteration i āˆ’ 1) radius values from item (4) (name them r1 and r2), compute the area of an equivalent conical frustum5 using the end capsā€™s minor radius divided by the number of iterations (r/n) as a height: a = Ļ€(r1 + r2) (r1 āˆ’ r2)2 + (r/n)2 6. Acquire a partitioned area value p using the sensor height argument y and an average of the two computed radii (ra = (r1 + r2)/2): (a) if y ā‰¤ 0, p = 0 (b) if y > 2ra, p = a 9
  • 10. (c) if 0 < y < 2ra, p = a cosāˆ’1 R āˆ’ y ra /Ļ€ 7. Accumulate the adjusted areas in a sum s: s = s + p n 8. The result should approximate the partial surface area (wetted area) of an elliptical end cap. 2.4.6 Python listing Hereā€™s Python code for the algorithm described above: from math import āˆ— # p a r t i t i o n based on sensor height y def py(y , r ) : i f (y <= āˆ’r ) : return 0 e l i f (y >= r ) : return 1 else : return acos (āˆ’(y/ r )) / pi # p a r t i a l spheroid area def psa (y , n , r ,R) : y āˆ’= R sx = 1.0/n hsq = ( r /n)āˆ—āˆ—2 a = 0 x = 0 r1 = None for i in range(n+1): r2 = sqrt (1āˆ’xāˆ—āˆ—2) āˆ— R i f ( r1 != None ) : rsum = r1+r2 # compute frustum surface area z = pi āˆ— rsum āˆ— sqrt (( r1āˆ’r2 )āˆ—āˆ—2 + hsq ) # s ca l e the r e s u l t based on sensor height y a += z āˆ— py(y , rsum āˆ— 0.5) r1 = r2 x += sx return a 2.4.7 Content surface area The last equation for an end cap, sy or content surface area, is surprisingly simple ā€“ itā€™s a variation of that used for a sphere (equation (2.18)), with the result scaled to the spheroidā€™s dimensions: sy = Ļ€(2R āˆ’ y)y r 2R (2.23) The term at the right serves to adjust the result to correspond to the dimensions of a single, possibly elliptical, end cap. 3 Practical Application 10
  • 11. In this section we will apply the prior content to an example tank ā€“ a horizontal cylindrical section with end caps that can assume some common shapes, and that may diļ¬€er from each other. To avoid excessive complexity, this example considers a horizontal tank, which means, with a single exception, itā€™s accessible to closed-form analysis, i.e. using clearly deļ¬ned equations and no numerical calculus methods required. (The one exception involves ļ¬nding the partial wetted area of an elliptical end cap, as explained above.) The end result will be a table that correlates sensor heights and tank partial volumes. Hereā€™s an outline to follow when analyzing a storage tank: ā€¢ Measure the tank, keeping in mind that an accurate analysis requires the tankā€™s internal dimensions. ā€¢ Consider the tank as three sections ā€“ a central cylinder and two end caps. If the end caps diļ¬€er, apply appropriate equations and measurement values for each. ā€¢ Remember that the tankā€™s three sections have one variable in common ā€“ the sensor height. This makes it possible to generate a single sensor to volume table. ā€¢ Choose a suitable method for processing the tank. For common tank types and small workloads, use TankCalc6 , my free Java program. For more ambitious projects, and in particular if developing code to be used widely, I recommend Python for the development phase. ā€¢ Always include equations and results for full tank volume and surface area. This serves multiple purposes, including a veriļ¬cation check of the data tableā€™s results. As one testing example, for a horizontal tank with a cylindrical cross-section, the volume value at a sensor height that is half the tankā€™s height should be exactly 1 2 the full volume. ā€¢ Remember that, unless a program like TankCalc is in use, all the measurements should use the same units, and the results will be expressed in the chosen units squared (surface area) and cubed (volume). 3.1 Example tank Figure 8: Example Tank Diagram 11
  • 12. 3.1.1 Measuring the tank For this example, letā€™s say we have a tank like that shown in ļ¬gure (8) ready for analysis. We need to acquire measurements and translate them into the values required by this method. The values are: ā€¢ Cylinder length (L): ā€“ This is the easiest measurement to make. ā€“ Many tanks have a clear weld line at the intersection of the cylindrical section and the end caps, which simpliļ¬es this measurement. ā€“ Because this measurement is taken parallel to the tank wall, the wallā€™s thickness is not an issue. ā€¢ Major radius (R): ā€“ If thereā€™s any confusion about the meaning of this term, imagine a line extending from the tankā€™s centerline to the inside of the cylinder wall. ā€“ The radius is half the tankā€™s diameter, but remember that most ways to measure a tankā€™s diameter will need to subtract the tankā€™s wall thickness. ā€“ One way to acquire a value for R is to take a ļ¬‚exible tape measure and pass it around the cylinderā€™s circumference, then divide the result by 2Ļ€ (Circumference C = 2Ļ€R). ā€“ A correction can be made to the above measurement for wall thickness ā€“ if you know the tankā€™s wall thickness, multiply it by 2Ļ€ and subtract that from the above result. ā€¢ Minor radius (r): ā€“ This is the most diļ¬ƒcult measurement ā€“ thereā€™s often no easy way to acquire it from outside the tank. ā€“ One method is to use a plumb line, make chalk marks at the base of the tank, and measure the distance between the marks. ā€“ Remember to subtract the wall thickness from the measured value. ā€“ If the end caps diļ¬€er, take two measurements and process them independently. ā€“ Remember that for a ļ¬‚at end cap, assign an r value of zero. Remember also that, if manufacturer documentation is available for the tank, this might be a better way to acquire the needed values. 3.1.2 Choosing the equations This becomes easier with experience. For the example tank, and assuming we want full and partial volumes and content surface area, we would acquire: ā€¢ Central cylinder: ā€“ Full volume: equation (2.6). ā€“ Partial volume based on sensor height y: equation (2.7). ā€“ Full surface area excluding end caps: equation (2.9). ā€“ Content surface area based on sensor height y: equation (1.1), multiply the result by L. ā€¢ End Caps: ā€“ Full volume: equation (2.19). ā€“ Partial volume based on sensor height y: equation (2.20). ā€“ Full surface area: equation (2.21). ā€“ Content surface area based on sensor height y: equation (2.22). For two identical end caps, one may multiply by 2 the result for one equation. 12
  • 13. 3.1.3 Example program Follow this link7 for an example Python program that performs all the tasks outlined in the prior section, prints a summary list of tank properties, then prints a table of values correlating sensor height, volume, and content surface area. At the top of the program is a set of user-deļ¬nable values that permit the user to customize the results. Examination of this Python program should give readers a sense of how to proceed in crafting a solution for many types of common storage tanks. 4 Overview 4.1 TankCalc Figure 9: TankCalc numerical strategy The methods this article describes are valid for horizontal or (in a few cases) vertical tanks, but if the tank is tilted at an angle to the local horizon (meaning the tankā€™s contents rest at an angle with respect to the tank itself), closed-form methods fail. This is because the methods used to describe the relationship between a tank and its contents require that they have a reference plane in common, either parallel or orthogonal. 4.1.1 Tilted tanks When I ļ¬rst described methods for analyzing storage tanks, they were much like those in this article ā€“ straightforward and closed-form. I soon began to receive inquiries from people with actual storage tanks, who asked whether my methods could be applied to tilted tanks. I was initially mystiļ¬ed ā€“ who would do such a thing to a perfectly good tank? But my correspondents educated me ā€“ there are very good reasons to tilt a tank, one being that it sequesters impurities in a waste area and allows relatively pure product to be drawn from the tank until itā€™s nearly empty. So to meet this need I wrote TankCalc, which, unlike the closed-form methods described in this article, uses a numerical scheme. In some ways TankCalc is simpler and easier to understand than this articleā€™s methods ā€“ it relies on a relatively simple numerical Calculus scheme that iteratively generates disks that are partitioned by the tankā€™s contents (using a version of equation (1.2)), and sums their two-dimensional partial areas to construct a three-dimensional partial volume (as shown in ļ¬gure 9 ā€“ imagine thousands of disks) ā€“ but in other ways itā€™s less satisfactory. One drawback to the TankCalc approach is that the results are approximate ā€“ quite accurate, but never exact. Another drawback is that, unlike the closed-form equations in this article, TankCalcā€™s numerical methods canā€™t be easily manipulated to get diļ¬€erent kinds of results. 13
  • 14. To me, TankCalc exempliļ¬es the collision between pure and applied mathematics, and supports Einsteinā€™s famous aphorism: ā€As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality.ā€ 4.2 Tools In the process of creating mathematical results for articles like this one, I rely on a number of tools including Sage8 , IPython9 and much past experience in storage tank analysis. 4.2.1 Sage Sage in particular has turned out to be a valuable resource for both symbolic and numerical results. Because Sage relies on Python, itā€™s a relatively simple matter to produce a new symbolic result in Sage, then transfer it to a Python working script for further analysis and tuning. Hereā€™s an example: I start with an equation that, if presented with a y coordinate within a circle of radius R, will return the circleā€™s width at that coordinate ā€“ see equation (1.1) and ļ¬gure (1) above. The equation: w = 2 (2 R āˆ’ y)y (4.1) First I want to be sure the equation produces the hoped-for result, that is, a width corresponding to a given y coordinate within a circle. So to ļ¬nd out I provide Sage with the equation and plotting instructions: f(y,R) = 2 * sqrt ((2*R-y) * y) plot(f(y,10),y,0,20, axes_labels =(ā€™yā€™,ā€™result ā€™),gridlines=True ,figsize =(5 ,3)) show(f(y,R)) latex(f(y,R)) Sage responds with: 2 (2 R āˆ’ y)y 2 , sqrt{{left(2 , R - yright)} y} The ļ¬nal printed result above allows me to easily copy LaTeX code from Sage into an article like this one. At this point I realize that, if I integrate the above equation on the interval 0 ā‰¤ z ā‰¤ y, I will have an equation for partial circle area, useful in a number of ways. So I instruct Sage thus: 14
  • 15. assume(y > 0) assume(R > 0) fi(y,R) = integrate(f(z,R),z,0,y) plot(fi(y,10),y,0,20, axes_labels =(ā€™yā€™,ā€™result ā€™),gridlines=True ,figsize =(5 ,3)) show(fi(y,R)) Sage responds with: āˆ’R2 arcsin āˆš R2(Rāˆ’y) R2 + R2 arcsin āˆš R2 R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) The graph shows me that the integration result is valid, providing an equation for the partial area of a circle, but looking at the equation I suspect it might not be written in the most concise way (when I see an expression likeāˆš R2, my alarm bells go oļ¬€), so I tell Sage: fi(y,R) = fi(y,R). full_simplify () show(fi(y,R)) Sage responds with: 1 2 Ļ€R2 āˆ’ R2 arcsin Rāˆ’y R āˆ’ 2 Ry āˆ’ y2(R āˆ’ y) Much better. 4.2.2 Texmaker Iā€™m sure there are as many views about the ideal LaTeX editor as there are users of such programs. At the moment my favorite is Texmaker10 , a rather nice, free LaTeX editor with versions for all common platforms. Texmaker greatly simpliļ¬es the task of LaTeX creation and editing compared to programs available only a few years ago. It certainly represents an improvement over how I once created LaTeX ā€“ by hand-entering everything, then submitting it to a renderer/converter to see where I had gone wrong. 15
  • 16. Along with Inkscape and Povray described below, Texmaker belongs to my favorite class of programs ā€“ those that are created and maintained by people who just want the best tools, and who can aļ¬€ord to build them without thought of commercial gain. The availability and ease of use of programs like Texmaker, and some others, is producing a change in how I create Web content. A long-time static HTML page creator using my Web creation tool Arachnophilia11 , I have recently been writing articles with more mathematical content, which requires extra eļ¬€ort in HTML. Also my numbered footnote/reference lists have become longer and therefore harder to edit and maintain. Finally, people have begun to ask for PDF versions of some of my more widely read articles, which requires a conversion from HTML to PDF, with sometimes mediocre results. This change of direction in recent articles means the article source is a plain-text LaTeX document, with a PDF rendering, and ļ¬nally an HTML version of the LaTeX source using a Python conversion script. This arrangement means the PDF version is often a much better rendering than the HTML. 4.2.3 Inkscape Most of the diagrams in this article were captioned using Inkscape12 . Inkscape is a very good drawing program, much better than one expects in a program category that for some reason seems to attract mediocrity and bugginess. Itā€™s not often that I see a program that already oļ¬€ers the features I think I need after working with it for a spell. Inkscape has a lot of useful features, more than I have ļ¬gured out yet. 4.2.4 Povray Povray13 is a venerable ray tracing14 program that has existed in various forms for almost 30 years, and that keeps getting better. I keep expecting something better to come along ā€“ a program that joins a convenient modeler like Blender15 to the ability to perform the kind of ray tracing that graphics perfectionists expect. But that goal remains out of reach, and Povray continues to be my choice for images like those in this article, in which, to pictorialize how TankCalc creates numerical partial volume results, I needed transparent, realistic 3D renderings with multiple elements. After a bit of coding and testing, Povray produced them. Click this link to see what Povray can do, and why the ray tracing method is regarded as superior to other graphic rendering methods. References 1StorageTank Modeling ā€“ a collection of tank modeling articles at http://arachnoid.com. 2TankCalc ā€“ the authorā€™s tank analysis program. 3Spheroid ā€“ an ellipse of revolution. 4Oblate spheroid ā€“ an ellipse of revolution whose polar axis is smaller than its equatorial diameter. 5Conical Frustum ā€“ a geometric element whose methods aid storage tank analysis. 6TankCalc (see note 2) 7Example Tank Analysis ā€“ a Python program that summarizes this articleā€™s methods. 8Sage ā€“ a powerful, free, open-source mathematical environment. 9IPython ā€“ a Python-based mathematical environment, requires less storage and horsepower than Sage. 10Texmaker ā€“ a free, open-source, cross-platform LaTeX editor. 11Arachnophilia ā€“ my free Web development environment. 12Inkscape (after image generation using Povray ā€“see below) ā€“ a terriļ¬c, free, open-source drawing program. 13Povray ā€“ the Persistence Of Vision raytracer. 14Ray Tracing (graphics) ā€“ a method for producing very realistic graphic renderings. 15Blender ā€“ an animation and photorealistic graphics workshop. 16