(41) Bulk Cylindrical Tank - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-41C Software Library (/forum-11.html) +--- Thread: (41) Bulk Cylindrical Tank (/thread-11553.html) |
RE: (41) Bulk Cylindrical Tank - SlideRule - 10-13-2018 11:38 AM some excerpts (pgs 130-132 w/ illustrations) from the second edition; [attachment=6451] [attachment=6450] [attachment=6449] The illustrations add additional information. Acquiring full access to the second edition is forthcoming. BEST! SlideRule RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 11:43 AM (10-11-2018 07:38 PM)Dieter Wrote: The volume calculation is even easier, the formula is quite short. We can use this equation for the ellipse: \(\frac{x^2}{a^2}+\frac{y^2}{b^2}=1\) When we set \(a=r\) and \(b=v_0\) this becomes: \(\frac{x^2}{r^2}+\frac{y^2}{v_0^2}=1\) From which we conclude: \(x^2=r^2\left ( 1-\frac{y^2}{v_0^2} \right )\) Then \(\pi x^2\) is the area of the surface of the water. We can integrate that to get the volume of the water in the dome: \( \begin{align*} V_d(v) &= \int_{0}^{v}\pi x^2dy \\ &= \pi \int_{0}^{v}r^2\left ( 1-\frac{y^2}{v_0^2} \right )dy \\ &= \pi r^2 \left ( y-\frac{y^3}{3v_0^2} \right )\bigg|_{y=0}^{y=v} \\ &= \pi r^2 \left ( v-\frac{v^3}{3v_0^2} \right ) \\ &= \pi r^2 v \left ( 1-\tfrac{1}{3}(\frac{v}{v_0})^2 \right ) \end{align*} \) In the given example \(r=72"\), \(h_0=12"\), \(d=180"\) and \(v_0=36"\) For the JUICE LEVEL \(H_t=195"\) we get \(v=H_t-d-h_0=195"-180"-12"=3"\). Thus: \(V_d(3)=211.0171\ gal\) The rest of the tank is \(\pi r^2(d+\tfrac{h_0}{2})=13113.4157\ gal\). Thus we end up with \(13324.4328 \ gal\). For the JUICE LEVEL \(H_t=198"\) we get \(v=H_t-d-h_0=198"-180"-12"=6"\). Thus: \(V_d(6)=419.0966\ gal\) Here we end with \(13532.5124\ gal\). Both results agree with Dieter's previous post#14. Here's a program for the HP-42S: Code: 00 { 38-Byte Prgm } Cheers Thomas RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 12:15 PM (10-12-2018 10:41 PM)Thomas Klemm Wrote: Instead this formula can be used: For \(x=0\) this leads to \(V(0)=\tfrac{2}{3}Hr^2\) which surprised me because it doesn't contain \(\pi\). This means the slanted part of the cylinder is exactly \(\frac{1}{6}\) of the square box that envelops it. Kind regards Thomas RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 12:57 PM (10-13-2018 09:37 AM)Dieter Wrote: But I still don't understand why it's wrong. The liquid surface is a circle with a chopped of segment. If this area is known, why is the volume not area · h/2 ? Imagine the situation where \(x=0\): The body formed by the water is completely different from the body that lies beneath. However for a rectangular cuboid both are the same. I assume that's the reason for the misconception. Quote:You should add a RAD statement to make sure that radians mode is set. You are right of course. I happen to just forget about that. Quote:Maybe you can finally post the complete formula in terms of the variables in the paper, i.e. with h and h0 instead of x and H. I suggest to use Wolfram|Alpha instead. You can use /. x = … to replace \(x\) with something in a formula. HTH Thomas RE: (41) Bulk Cylindrical Tank - David Hayden - 10-13-2018 01:41 PM Thanks Albert, but I think you misunderstand my confusion. I understand the formulas. It's the HP41C program at the end of the paper that I'm having trouble with. (10-12-2018 10:34 PM)Albert Chan Wrote:(10-12-2018 08:34 PM)Dieter Wrote: For the record: with R = 90" the results are 13318 and 13509 gallons. RE: (41) Bulk Cylindrical Tank - Dieter - 10-13-2018 04:02 PM (10-13-2018 01:41 PM)David Hayden Wrote: Thanks Albert, but I think you misunderstand my confusion. I understand the formulas. It's the HP41C program at the end of the paper that I'm having trouble with. The basic problem (yours as well as mine) is the fact that the program in appendix C is only loosely related to the formulas in chapter 25, including the example in table 25–3. The program expects the hatch height and hatch depth (the latter is not mentioned anywhere before) while there is no input for the radius R that is given in the example. I wonder if R is somehow calculated from the hatch position (cf. line 44...79). The program comment even says that the user enters "...the distances from the hatch to the juice level" (sic!) and not from the bottom – ?!? What about a completely new program that implements some insights of this thread? I did a version for the HP41 that accepts the tank diameter and the heights of the three tank sections and returns the volume. The units can be metric (centimeters and liters) or imperial (inches and gallons), and the calculation can assume either an elliptical or a shperical dome top. In the latter case the calculated radius R is displayed and may be overwritten by the user. This way you can get the same values as in table 25–3. ;-) Except for the slant bottom part: Here I implemented the formula by Thomas Klemm, which I suppose is the correct one. OK, I used a slightly modified version that works in any angular mode so that the current user setting is maintained. If someone is interested I'll do some more tests and post it here. Dieter RE: (41) Bulk Cylindrical Tank - Albert Chan - 10-13-2018 04:20 PM (10-13-2018 09:37 AM)Dieter Wrote:(10-12-2018 10:41 PM)Thomas Klemm Wrote: The slanted cylinder isn't a slanted cuboid. Top and bottom are not the same. Volume = area * h/2 is just an estimate. Actual volume require integration. Let x = 2 h/h0 - 1, we get tan(θ) = r/1 = (r-y)/(1+x), thus y = -r x Substitute y = -r x in equation 25-1, Vb = ∫ Aseg dx, you get this: \(V(x)=\left [ {\pi x} / 2 + x sin^{-1}x + \sqrt{1-x^2}(2+x^2)/3 \right ]Hr^2\) Result is in ArcSin , but is equivalent, since acos(x) = Pi/2 - asin(x) --- ArcSin form is actual better for numerical estimation. Except for the first term, others are even function, and can approximate as this: \(V(x) = \left [ 1.571 x+ 0.667 + x^2 - 0.094 x^4 \right ]Hr^2\) The curve match very well to exact V(x): http://m.wolframalpha.com/input/?i=plot+1.571x+%2B+0.667+%2B+x%5E2+-+0.094+x%5E4+and+x%28pi+-+acos%28x%29%29+%2B+sqrt%281-x%5E2%29*%28x%5E2%2B2%29%2F3%2C++from+-1+to+1 This is calculated volume (r = 72", H=12/2=6"), exact vs approx: Code: Inches Exact Approx (gallons) RE: (41) Bulk Cylindrical Tank - Dieter - 10-13-2018 06:40 PM (10-13-2018 11:43 AM)Thomas Klemm Wrote: Both results agree with Dieter's previous post#14. Sure, I used the same approach (with x and y swapped) and got the same result. ;-) So the calculation is quite easy and straightforward. Which brings us back to the question whether an elliptical dome is realistic or not, better or worse than calculating a radius for a shperical dome top. If in real life an elliptical top is nonsense I'll drop that part of my already mentioned HP41 program. Dieter RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 06:42 PM (10-13-2018 01:41 PM)David Hayden Wrote: I understand the formulas. It's the HP41C program at the end of the paper that I'm having trouble with. There's a typo in formula (25-11): the square on \(v_0\) is missing. Instead it should be: \(V_{seg\ sphere} = \pi v_0^2(3R - v_0)/693\) Cf. Spherical Cap This formula is then used twice. Once with \(h=v_0\) and then again with \(h=v_0-v\). The difference between them is formula (25-12). In both cases the radius \(R\) of the sphere is used. But we can do without: Spherical Segment \(V=\tfrac{1}{6}\pi h(3a^2+3b^2+h^2)\) We know \(a=r\) and \(h=v\) but we have to calculate \(b\). Quote:The hatch depth is the distance from the lower lip of the hatch to the edge of the tank. I assume that this is the horizontal distance from the hatch to the circumference of the cylinder. In lines 44-48 the distance \(v\) from the upper border of the cylinder to the juice level is calculated. In lines 49-53 this value is then multiplied by the hatch depth and divided by the hatch height. We could interpret this as an approximation of the difference \(\Delta r = r - b\). At least something like this is calculated in lines 56-58. However there are these strange X≠0? commands and I assume that the X<>Y command in line 55 is a bug. Or then it should rather be X=0? instead of X≠0? in the line prior to that. Lines 59-68 calculate \(r^3-b^3=(r-b)(r^2+rb+b^2)=\Delta r(r^2+rb+b^2)\). In line 69-70 this is multiplied by the hatch height and then in lines 75-77 it's divided again by the hatch depth. Thus we have a somewhat convoluted way to calculate \(v(r^2+rb+b^2)\). The third term \(\tfrac{1}{3}v^2\) is missing but we might consider \(v\) rather small compared to \(r\) and \(b\) and thus neglect the term. But there's still the mixed term \(rb\). What should we do with that? Lines 80-98 just calculate the rest of the tank. Maybe I could shed some light on that program and the formulas that were used but I must admit that I still don't fully understand it. Kind regards Thomas RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 07:04 PM (10-11-2018 10:53 PM)Albert Chan Wrote: The slant bottom equation can also rephrase as fractions of a cylinder volume (radius r, height h) (10-13-2018 04:20 PM)Albert Chan Wrote: Volume = area * h/2 is just an estimate. I would call that neither close nor an estimate. Here's the graph of both functions: Cheers Thomas PS: I scaled your function by the factor \(2\pi\) so that we can compare them. RE: (41) Bulk Cylindrical Tank - Albert Chan - 10-13-2018 07:37 PM (10-13-2018 07:04 PM)Thomas Klemm Wrote: I scaled your function by the factor \(2\pi\) so that we can compare them. Factor were applied wrong. f(x) was fractions of cylinder volume, radius r, height h Using your notation, x = 2 h/h0 - 1 = h/H - 1, so h = (x + 1) H V(x) = f(x) * Pi r^2 h = (f(x) * Pi (x + 1)) r^2 H For comparison, correct scaling factor should be (x + 1) Pi. RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-13-2018 08:12 PM (10-13-2018 07:37 PM)Albert Chan Wrote: For comparison, correct scaling factor should be (x + 1) Pi. This is much closer now: Please excuse that I didn't grasp the meaning of your function. However for \(x=0\) there's still the difference between \(\frac{\pi}{4}\) and \(\frac{2}{3}\) which is about 17.8%. But this might not be a problem in citrus juice management. Cheers Thomas RE: (41) Bulk Cylindrical Tank - Albert Chan - 10-13-2018 08:51 PM Hi, Thomas Klemm I define f(x) this way because the curve can be fit nicely as a straight line. With your corrected V(x), f(x) plot appeared amazingly straight With slanted bottom 30% full or more, a very simple rule-of-thumb can be used. Vb = Pi r^2 h f(x) ~ Pi r^2 h (57% (h/h0) - 7%)) Example, for h=8", h0=12", r=72", effective height = 8 * (57% (8/12) - 7%) = 2.48" Vb = Pi * 72² * 2.48 = 40389 in^3 = 175 gallons (match post #27) RE: (41) Bulk Cylindrical Tank - SlideRule - 10-13-2018 10:35 PM No reply, yet, from the author: til then, I rediscovered the article Simple Program Calculates Partial Liquid Volumes in Vessels in the Technology section of Oil & Gas Journal, 13 April 1992; pgs 54-57, by Pierre Koch which describes an HP-41 program to calculate volumes for a range of storage tanks. Although the program listing was not included with the article, the four attached figures / illustrations seem appropriate. Hopefully, they add value to the current discussion. [attachment=6460] [attachment=6459] [attachment=6458] [attachment=6457] BEST! SlideRule RE: (41) Bulk Cylindrical Tank - Thomas Klemm - 10-14-2018 01:47 PM Here's another approach for the HP-42S using numeric integration. For the dome an ellipsoid is used. Code: 00 { 60-Byte Prgm } Code: 00 { 44-Byte Prgm } Make sure to initialise these variables and set the calculator to RAD mode: Code: h0= 12.0000 Set the accuracy ACC to something reasonable like \(10^{-8}\). Examples 3 XEQ "TANK" 16.9551 8 XEQ "TANK" 175.0894 112 XEQ "TANK" 7,473.2363 195 XEQ "TANK" 13,324.4312 198 XEQ "TANK" 13,532.5136 Compare this to the examples given in table 25-3 of the paper: \( \begin{matrix} \textbf{Measurement #} & \textbf{H (total vertical level)} & \textbf{# Gallons} \\ 1 & 3" & 21 \\ 2 & 8" & 200 \\ 3 & 112" & 7,473 \\ 4 & 195" & 13,284 \\ 5 & 198" & 13,444 \end{matrix} \) Kind regards Thomas RE: (41) Bulk Cylindrical Tank - Albert Chan - 10-14-2018 03:47 PM (10-13-2018 06:40 PM)Dieter Wrote: So the calculation is quite easy and straightforward. Which brings us back to the question whether I like the elliptical dome approach, but I also like graphically matching dome volume. So, I propose combining them ... Let unit of 1" cyclinder volume = "slice = Pi * 72² * 1 = 5184 Pi in³ = 70.50 gallon Assuming Kimball graphically fitted R were correct: Vdome = volume of cap with R = 78, h = 78 - sqrt(78² - 72²) = 48 = Pi h^2 (R - h/3) = 142848 Pi in³ (= 1943 gallon) = 27.56 "slice Since v0 = 36", ratio of 27.56/36 = 77% suggest the dome is very flat. Even flatter than a elliptical dome (ratio = 2/3 ~ 67%) To keep tank total height and total volume the same, adjust dome dimension. Solve for a new v0, (throw away old v0 of 36"): 2/3 v0 = 27.56" + (v0 - 36") v0 = 3 * (36" - 27.56") = 25.33" Original tank: height = 12 + 180 + 36 = 228", volume = 6 + 180 + 27.56 = 213.56 "slice = 15056 gallon Adjusted tank: height = 12 + 190.67 + 25.33 = 228", volume = 6 + 190.67 + 2/3*25.33 = 213.56 "slice Example: liquid level of 220" (almost full) v = 220 - 12 - 190.67 = 17.33", effective height = v*(1 - (v/v0)²/3) = 14.63" Volume = 6 + 190.67 + 14.63 = 211.30 "slice = 14897 gallon RE: (41) Bulk Cylindrical Tank - SlideRule - 10-14-2018 10:01 PM (10-14-2018 03:47 PM)Albert Chan Wrote: I also like graphically matching dome volume...In the first (leftmost) graphic attachment from Citrus Processing {pg 132} in post #21, the author's position of measuring the curve of the dome and transposing it to paper and graphically measuring the radius fig. 4-19 and your position seems to have a high degree of agreement. BEST! SlideRule RE: (41) Bulk Cylindrical Tank - Dieter - 10-14-2018 10:15 PM (10-14-2018 01:47 PM)Thomas Klemm Wrote: Here's another approach for the HP-42S using numeric integration. My HP67 program and the HP41 version return the same values. OK, the last two results differ in the third decimal. (10-14-2018 01:47 PM)Thomas Klemm Wrote: Compare this to the examples given in table 25-3 of the paper: The paper uses a "different" formula for the slant bottom section and assumes a spherical dome top with a given radius (which is different from the calculated radius). I can reproduce the results for the top section if mý HP41 program is set to assume a spherical dome top and the calculated radius is overwritten by R=78" as assumed in the paper. Dieter RE: (41) Bulk Cylindrical Tank - Albert Chan - 10-14-2018 10:50 PM (10-13-2018 06:42 PM)Thomas Klemm Wrote: Spherical Segment Solving for b, Spherical Segment Volume is actually very simple. Let d be shortest distance from sphere center to dome bottom (call this hatch depth ?) b² = R² - (d + h)² = (r² + d²) - (d² + 2 d h + h²) = r² - 2 d h - h² V = Pi h/6 (3r² + 3r² - 6 d h - 3h² + h²) V = Pi h (r² - d h - h²/3) Example, same tank, but assumed Spherical Segment Dome Top: Using above formula, with Vdome = 1943 gallon, calculated d = 21.78" (R = 75.22") Graphical fitted R is still useful. Its longer length is easier to measure. d can be easily calculated. Code: level h Liquid Volume (gallon) RE: (41) Bulk Cylindrical Tank - Dieter - 10-15-2018 12:33 PM (10-14-2018 10:50 PM)Albert Chan Wrote: Let d be shortest distance from sphere center to dome bottom (call this hatch depth ?) "Hatch depth" ?!? Where do you see a hatch here ?-) (10-14-2018 10:50 PM)Albert Chan Wrote: Example, same tank, but assumed Spherical Segment Dome Top: 1. Where do you get the 1943 gallons from? Why is this the volume of the dome top section? 2. If the dome top section is actually spherical there is exactly one solution: the radius R must be 90". Take a look at this sketch which should be quite exactly to scale: Red solid line: elliptical dome top Blue dotted line: spherical dome top Now imagine a radius of 75,22". That's not much more than the tank radius r, so the dome top section would be much higher than v0 = 36" (53,4", to be precise). I do not think this makes any sense. But maybe I am misunderstanding your point: how would you say the 75,22" dome top would look like? A sketch would be helpful. Dieter |