Tank Volume

See all articles from Sinc-Link v11 n4
Author(s): Bob Wilson
Publication: Sinc-Link
Pub Details: Sinc-Link v11 n4 (Volume 11, Issue 4)
Date: July/August 1993
Pages: 9

Here is a TS1000 program listing written by one of our club members to calculate the volume of a tank based on the depth of fluid in the tank. It is a good example of the kind of programs that can simplify the work of the user.

R. Bruneau

TANK VOLUME listing and sample screen
TANK VOLUME listing and sample screen
1 REM ** TANK VOLUME **               ** BOB WILSON **
10 PRINT TAB 11;"TANK VOLUME"
15 PRINT
20 PRINT ;" \..\..\..\..\..\..\..\..\..\..\|'\|'\..\..\..\..\..\..\..\..\.."
30 PRINT ;" \.' \'."
40 PRINT ;" \.' \'."
50 PRINT ;" D \: \ :"
60 PRINT ;" \'.-----------------------\.'"
70 PRINT ;" \'. H \.'"
80 PRINT ;" \''\::\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\::\''"
90 PRINT
100 PRINT " >B<> L <>B<"
110 PRINT
115 REM ** INPUT **
120 PRINT "INPUT DIMENSIONS IN INCHES"
130 PRINT
140 PRINT "TANK DIAMETER ""D"""
150 INPUT D
160 PRINT AT 14,27;"=";D
170 PRINT "CYLINDRICAL PART LENGTH ""L"""
180 INPUT L
190 PRINT AT 15,27;"=";L
200 PRINT "BULBOUS PART ""B"""
210 INPUT B
220 PRINT AT 16,27;"=";B
230 PRINT "HEIGHT OF LIQUID ""H"""
240 INPUT H
250 PRINT AT 17,27;"=";H
260 GOSUB 400
270 PRINT
280 PRINT "TANK VOL. IN IMP. GAL.=";VI
290 PRINT " U.S. GAL.=";VU
300 PRINT " LITRES=";VL
310 STOP
390 REM ** VOLUME CALCULATION **
400 LET X=ACS (1-(2*H/D))
410 LET AS=D**2*X/4
420 LET AT=D/2*ABS (D/2-H)*SIN X
430 IF H<=D/2 THEN LET V=(AS-AT)*L
440 IF H>D/2 THEN LET V=(AS+AT)*L
450 LET U=ASN ((H-D/2)/(D/2))
460 LET W=D**2*B/24*(4*COS U*COS U*COS U*SIN U+6*(U+SIN (2*U)/2)+3*PI)
470 LET VI=INT ((V+W)/277*100+.5)/100
480 LET VU=INT ((V+W)/230.64959*100+.5)/100
490 LET VL=INT ((V+W)/61.03*100+.5)/100
500 RETURN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.