Post Reply 
41 Cistern Program
08-19-2016, 01:13 PM (This post was last modified: 08-19-2016 07:31 PM by Gerson W. Barbosa.)
Post: #34
RE: 41 Cistern Program
(08-19-2016 05:03 AM)Gerson W. Barbosa Wrote:  
(08-17-2016 04:51 PM)aurelio Wrote:  Here they take in account also the different shape of the heads, unfortunately not a case of sloped vessels..
This can help of course, but is not actually what we are looking for, cause it is a "on-line" calculation.

The Oil & Gas article has the formulas. For instance, my unoptimized program for the elliptical head case (237 bytes) gives 0.916297857295 m^3 for D=1m, L=2m, a=0.25m and H=0.5m.
No stack-only code this time :-)

(08-19-2016 05:03 AM)Gerson W. Barbosa Wrote:  
(08-17-2016 04:51 PM)aurelio Wrote:  Here they take in account also the different shape of the heads, unfortunately not a case of sloped vessels..
This can help of course, but is not actually what we are looking for, cause it is a "on-line" calculation.

The Oil & Gas article has the formulas. For instance, my unoptimized program for the elliptical head case (237 bytes) gives 0.916297857295 m^3 for D=1m, L=2m, a=0.25m and H=0.5m.
No stack-only code this time :-)

Code:

%%HP: T(3)A(D)F(.);
\<< \-> L D a h
  \<< 'SQ(D)/4.*(L*(IM(ACOSH(1.-2.*h/D))-2./D*(1.-2.*h/D)*\v/(h*(D-h)))+2.*a*\pi/D*(h+4./(3.*SQ(D))*(D/2.-h)^3.-D/6.))' EVAL
  \>>
\>>

Fill the stack with L, D, a, h. For a spherical tank, just make L=0 and a = D/2 (for instance, L=0, D=4, a=2 and h=4 --> a full spherical tank).

This can be simplified as

Code:


%%HP: T(3)A(D)F(.);
\<< \-> L D a h
  \<< 'SQ(D)/4.*L*IM(ACOSH(1.-2.*h/D))+\pi*a*SQ(h)*(1.-2.*h/(3.*D))+L*\v/(h*(D-h))*(h-D/2.)' EVAL
  \>>
\>>


The angle mode is irrelevant on the HP 50g if IM(ACOSH) is used instead of ACOS. Size has now been reduced to 191 bytes.

2 1 0.25 0.5 --> 0.916297857295

0 4 2 4 --> 33.5103216383 (32*π/3)

0 4 2 2 -->16.7551608191 (16*π/3)

Is the latter half full or half empty? :-)

----------------------------------------------------------------------------------------

[Image: 28987150362_c3cdcf3319.jpg]


\(V= L\left [ \frac{D^{2}}{4}\cos^{-1}\left ( 1-\frac{2h}{D} \right )+ \sqrt{h\left ( D-h \right )}\left ( h-\frac{D}{2} \right ) \right ] +\pi a h^{2}\left ( 1-\frac{2h}{3D} \right )\)

Edited to include diagram and equation
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
41 Cistern Program - SlideRule - 08-11-2016, 12:46 PM
RE: 41 Cistern Program - wojtek - 08-13-2016, 08:29 AM
RE: 41 Cistern Program - SlideRule - 08-13-2016, 12:18 PM
RE: 41 Cistern Program - wojtek - 08-13-2016, 06:29 PM
RE: 41 Cistern Program - aurelio - 08-15-2016, 05:20 PM
RE: 41 Cistern Program - wojtek - 08-15-2016, 07:06 PM
RE: 41 Cistern Program - aurelio - 08-15-2016, 08:25 PM
RE: 41 Cistern Program - wojtek - 08-15-2016, 07:28 PM
RE: 41 Cistern Program - Werner - 08-13-2016, 11:06 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-13-2016, 09:41 PM
RE: 41 Cistern Program - Massimo Gnerucci - 08-14-2016, 07:07 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-14-2016, 02:26 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-16-2016, 07:08 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-17-2016, 04:47 AM
RE: 41 Cistern Program - wojtek - 08-17-2016, 06:08 AM
RE: 41 Cistern Program - Ángel Martin - 08-17-2016, 06:46 AM
RE: 41 Cistern Program - aurelio - 08-17-2016, 09:03 AM
RE: 41 Cistern Program - Dieter - 08-17-2016, 01:30 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-18-2016, 02:44 AM
RE: 41 Cistern Program - wojtek - 08-13-2016, 06:44 PM
RE: 41 Cistern Program - wojtek - 08-13-2016, 09:57 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-14-2016, 04:34 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-14-2016, 05:19 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-16-2016, 05:49 AM
RE: 41 Cistern Program - wojtek - 08-15-2016, 09:08 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-16-2016, 01:56 AM
RE: 41 Cistern Program - wojtek - 08-17-2016, 02:13 PM
RE: 41 Cistern Program - aurelio - 08-17-2016, 04:51 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-19-2016, 05:03 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-19-2016 01:13 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-19-2016, 08:37 PM
RE: 41 Cistern Program - 4ster - 08-17-2016, 02:22 PM
RE: 41 Cistern Program - Csaba Tizedes - 08-19-2016, 08:23 AM
RE: 41 Cistern Program - aurelio - 08-19-2016, 11:54 AM
RE: 41 Cistern Program - wojtek - 08-19-2016, 12:49 PM
RE: 41 Cistern Program - Csaba Tizedes - 08-19-2016, 04:55 PM
RE: 41 Cistern Program - Csaba Tizedes - 08-19-2016, 05:07 PM
RE: 41 Cistern Program - wojtek - 08-19-2016, 07:18 PM
RE: 41 Cistern Program - aurelio - 08-19-2016, 10:05 PM
RE: 41 Cistern Program - Csaba Tizedes - 08-19-2016, 11:29 PM
RE: 41 Cistern Program - aurelio - 08-20-2016, 07:51 AM
RE: 41 Cistern Program - Csaba Tizedes - 08-20-2016, 09:16 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-20-2016, 05:34 AM
RE: 41 Cistern Program - aurelio - 08-20-2016, 08:02 AM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-20-2016, 03:40 PM
RE: 41 Cistern Program - Csaba Tizedes - 08-20-2016, 06:57 PM
RE: 41 Cistern Program - Gerson W. Barbosa - 08-20-2016, 07:54 PM



User(s) browsing this thread: 5 Guest(s)