0% found this document useful (0 votes)
5 views6 pages

BASIC Soil Testing Program Overview

The computer program SOILAB was developed to help students process data from soil laboratory tests. SOILAB is written in BASIC to be accessible on many systems. It uses a modular structure where each test is a module that can be easily expanded or modified. The program interacts through a screen editor and outputs data to various devices. It aims to move beyond manual data processing to help students learn soil testing.

Uploaded by

Robert Saga
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

BASIC Soil Testing Program Overview

The computer program SOILAB was developed to help students process data from soil laboratory tests. SOILAB is written in BASIC to be accessible on many systems. It uses a modular structure where each test is a module that can be easily expanded or modified. The program interacts through a screen editor and outputs data to various devices. It aims to move beyond manual data processing to help students learn soil testing.

Uploaded by

Robert Saga
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BASIC Soil Testing

J.P. Bardet (1) and Gunawan Gunawan (2)

(1) Assistant professor, (2) Undergraduate student, Civil Engineering Department,


University of Southern California, Los Angeles, USA

ABSTRACT

A BASIC program has been developed for mini-computers to proces? data mea?ured ir laboratory soil testlrg. The
computer code has been written in the programming language BASIC for the sake of simplicity ard adaptability to various
operating systems. The main features of the code are: interactive irput through a screer editor, adaptabllltp to rew
types of experiments, and various output devices (video screen, pen-plotter, and graphic prirter). Thlc computer program
alms to help instructors teach soil testing to urdergraduate or graduate students in Civil Engireerlrg. Each type of soil
experiment 1s a module within a library which car be expanded easily and modified with ever a ltmlted krowledge ir
programmirg. All the modules share the same screen editor and graphical package. The structure of the irput and output
data is flexible enough to be extended to most of the experimerts ir material testing.

1. INTRODUCTION The code is composed of a modular library of experiments


which share a package of input and output UtllltleS. The
In the last ten years, mini-computers have largely shareable input/output package includes many user friendly
contributed to the improvement of measurement technfques techniques which explain how to use the program, and avoid
in material testing. Many data acquisition packages, the loss of data when an input mistake is made. All input
including hardware and software, have become commercially 1s controlled by using the INKEY$ command, which detects
available to acquire and process data measured during one by one the characters input from the keyboard before
laboratory testing. However these recent techniques St111 the code processes them. For inStance, when a real number
remain unaccesslble to most students in Geotechnlcal 1s expected for input, the only characters accepted by
Engineering. Most of the laboratory manuals and textbooks SOIL&B are the + or - signs, the decimal point and the
r-1,2,3,4,5,6] present soil testing in a conventional way: figures between 0 and 9. This rejection of unwanted
they use data sheets to be filled out by hand during the characters has become quite common in interactlve
laboratory session, which require tedious calculations on programming. A good review of these techniques can be
pocket calculators in order to process the raw data found in [7]. As a major departure from elementary BASIC
gathered during the experiment. It 1s only in one of the code, the input package uses the entire video screen
latest sol1 manual editions that Bowles [l] has added a rather than a single line. The cursor 1s free to move on
few FORTRANprograms to process laboratory measurements. the video screen, which permits the display of a complete
The computer code which 1s presented In this paper input page like a spreadsheet. The program will be
aims to help undergraduate and graduate students In Civil described In the following sections by folIOwing its Step
Engineering to become more famlllar with the computer by step progression, and illustrated with a particular
processing of laboratory measurements. It represents an experiment: the drained triaxial test with meaSUrem!?nt Of
attempt to move away from the usual data sheet and “number volume change. The features of the code are summarized in
crunching” with a hand calculator. The computer code, the flow chart of Flg.1.
which is called SOILAB, has been developed for
microcomputers to process data measured in laboratory soil 2.1 lkin menus
testing. The code has been developed ln a simple
programming language, BASIC, in order to be understood and As shown in Flg.2, the first menu displayed by the
adapted by most of the undergraduates students after only program is a list of all the available experiments. All
a few hours of training on the programming lnstructlons of the experiment names are stored ln the ASCII file named
BASIC. As it will be shown in a later section, new types LAB [Link]. This file, which 1s only read when the code
of experiments can be added to the library of experiment 1s called for the first time, can be modified or appended
with a limited knowledge of BASIC, without giving Up the to accommodate up to 20 experiments. The user selects one
advantages of graphic capabllltles and interactive screen experiment by moving the arrow pointer with the vertical
input which are generally only accessible to advanced arrow keys, then by pressing <return>. After the
computer programmers. experiment selection, a second page 1s displayed and
offers several options. As shown in Fig.1, the user may
(1) return to the main menu to select another type of
2. DESCRIPTIONOF PROGRAM experiment, (2) create a file to forward all lnput data,
(3) retrieve an old input data from a file previously
Like most computer codes, SOILAB has been developed by defined, (10 print an empty data sheet. In the first
trial and error, retalnlng the most interesting and option, the first menu is displayed again to change the
convenient features while rejecting those judged experiment type. In the second and thlrd cases, a
unnecessary or too complex. SOILAB was made simply so that directory of all the datafiles related to the experlment
it would fit in the usual memory allocated by most of the selected in the first menu is listed to remlrd the user of
BASIC languages, which rarely exceeds 64 Kbytes in size. all the data files wh!ch are stored on diskette.

02669463/86/020255 - 06 $2.00
8 COMPUTATIONAL. MECHANICSPUBLICATIONS 1986

MICROSOFIWARE FOR ENGINEERS, 1986, Vol. 2, No. 4. 255


BASIC Soil Testing: J.P. Bardet and Gunawan Gumwan

Data is stored in ASCII characters for ease of eventual


Figure 1. Structure of the computer code SOILAB
communication with other softwares. In the fourth case, an
empty data sheet is printed on the line printer. The data
sheet, which 1s to be filled during the laboratory
session, calls for all the required data. An example of
this empty data sheet is provided In Fig.3. for the case
of the drained frlaxlal test.

Figure 2. Selection of a type of experiment from the main


menu of S~ILAB.

-:i Create new data file


:: Retrieve existing data file BA*SIC SOIL TESTING
I
* Print empty data sheet by J. F. Bardet (version 1,0)

I
inputages output page

~~I._~~~

t t

t
CONTROLLER
drained trlaxlal test.
* t page (next page)
+e _ page (previous page)
* page (go to selected page)
* exit (return to main menu)
1 * save (save input data file)
--* print
--* plot
* data (input data)
,, + insert (insert . . . line)
* delete (delete . . . line)

IPlots: selectcommand
7

:i go
+* change
i exit

it-

256 MICROSOFWARE FOR ENQINEERS, 1986, Vol. 2, No. 4.


BASIC Soil Testing: J.P. Bardet and Gunawan Gunawan

2.2 Data structure As show” in Fig.4 , the location of the input 1” the
datasheet is indicated by a wide cursor which can be
The most important step in the conception of the displaced vertically and/or horlzontaliy by using the
program was the selection of a data structure which 1s arrow keys. Data is entered by preeslng either the arrow
general enough to be compatible With most types of keys or the <return> key. Pages are turned by using the
laboratory measurement. After comparing various possible alternate command menu which 1s called by pressing the
formats of data provided by various laboratory manuals escape key. Depending upon the page number the input is
cl .2,3,4,5,6], tt was decided to divide the data tnto stored in arrays DATAO$, DATA1, or DATA2. The entire input
input and output data. Input and output data are phase 1s controlled by the input package shared by all
subdivided into three and two main types, respectively. types of experiments.
The first input type 1s made of general information such
as title’of experiment, name of operator, date, remarks Figure 4. Input spreadsheet displayed by SOILAB in the
and comments taken during the experiment session. This case of the drained trlaxial test.
type of data, Which has a format independent of the kind
Of experiment, 1s stored In the character array DATAO$.
The second type of input data 1s made of a series of
numbers stored in the one-dimensional array DATAl. Soil
specific gravity, initial sample diameter, and inltlal
sample Weight are examples of such data in the case of
input for the drained trlaxlal test. The third and last
type of input data Is made of readings stored in the
two-dimensional array DATA2. This last set of data is
composed of values of the various quantltles measured at
simultaneous time during a given experiment. Values of
axial displacement. axial force, and volume change are
examples of such a data during a drained triaxlal
compressfon test. In contrast to DATAO$, DATA1 and DATA2
have a format de endent on the type of experiment. As
shown in the 11s e lng in appendix, the names of the
quantities stored in DATA1 and DATA2 are defined by the
user in the one-dimensional string arrays LABELl$ and
LABEL26 between lines 10000 and 11000 of the computer
code. LABELl$. LABEL2$; DATA1 and’DATA2 are dimensioned
according to the number of quantltles ln each types,
LABELl’I and LABEL21 respectively. NPTMAX1s the maximum
number of experimental points for DATA2. Similarly to the
input data, the output data Is stored after being 2.4 Input commands
calculated in the one-dimensional and two-dimensional
arrays, DATA3 and DATA4, with names defined by the one All the commands are accessible by pressing the ESC
dlrenslonal string array LABEL3$ and LABEL4$, and key. Once in the command menu, the user selects a fu”Ctl0”
dlensfon LABEL3%and LABELII%,respectively. An example of using the horizontal arrow keys (-> or <-). The commands
the definition of variables can be found in the appendix. are listed in the flow chart of Flg.1. One can turn pages
It a module corresponding to a new type of experiment is one by one forwards or backwards, or’one can jump directly
to be added to the present library of experiments, input to a selected page. The insert or delete commands permit
and output variables must be speclfled in a similar way. A one to insert or delete a selected range of data point In
particular group of data, e.g. DATAl, may be omitted by DATA2. The command SAVE is used to save from time to time
specifying a zero dimension, e.g. LABELlJ-0. as show” in the data on the file which has been defined in the second
Table 1, the output data is structured in a similar menu. The Plot and Print commands, which are selected to
way as the input data. After the calculation phase, the plot or print the input or output data, branches to two
output values are stored In the arrays DATA3 and DATA4 to different menus. Additional quantltles may be stored in
be accessible to the shareable printing and plotting DATA2 after the last input points. The end of the input
package. data point to be processed by the calculation module must
be specified by jumping a blank line. All the data entered
after thls blank line 1s stored in DATA2 but ignored
Table 1: Summary of input and output variables during the calculation phase. This optional definition of
addltlonal data Is especially useful to analyze particular
output results with the plot command.

Variable definition Name Values Dimension 2.5 Output commands

Input The input and output data, which 1s stored in arrays


General information ~ LABEL~$() DATAO$() LABELO% DATA1 to DATA4, can be displayed and analyzed using the
1st group (1D array) LABEL~
$( ) DATA1( ) LABEL1% plot and print commands.
2nd group (2D array) LABELP$() DATA2(,) LABEL2I;NPTS
2.5.1 Plot command
output The variables to be plotted are contained in the
tst group (7D array) LABEL3$() DATA3( ) LABEL38 two-dimensional arrays DATA2 or DATA4. They are selected
2nd group (2D array) LABEL4$() DATA4(,) LABEL4%,NPT% by using the select command and typing the letter A, B, C,
etc. corresponding to the selected variables. In the ta?e
of the drained trlaxial test, the first input variable
(displacement dial reading) 1s noted by the letter A, and
2.3 Data input the seventh and last output variable (Void ratlo) by the
letter G. The range of points to be plotted is also
A data sheet similar to the one which was generated selected by typing the number’ of the first and last data
in the second menu (see Fig.3) and completed during the points. The addftional points, which are separated from
laboratory session 1s displayed on the computer screen. the input points with a blank line, may also be selected.

MICROSOF-M’ARE FOR ENGINEERS, 1986, Vol. 2, No. 4. 257


BASIC Soil Testing: J.P. Bardet and Gunawan Gunawan

The cormsand CHANGEcalls the plotter menu to alter various Figure 6. An example of printout of input data
characteristics of the plot. By using this menu, the plot in the case of the drained trlaxlal test.
may be directed either on the screen, a graphics printer
or a pen plotter. The length of the vertical or horizontal r
axis, the titles and the number of divisions along an axis
can also be modified. Linear, semi-logarithmic, or
logarithmic axis, point or line plcttlng may also be
selected. In the plot example shown in Flg.5, the axis
title, minimum and maximumalong axis, length and orlgln
of vertical and horizontal axis. which the code defines by
default, have been changed using this menu so that the
stress-strain and volume change curves may be drawn on the
same piece of paper.

Figure 5. An example of stress-strain curve and volume


change curve plotted by SOILAB in the case of
the drained trlaxial test.

Drained triaxial tes

3c

I
axial strain 3:

Figure 7. An example of printout of processed data


in the case of the drained trlaxial test.

G
axial strain %

2.5.2 Print -d
The print command allows to print the input and/or
output data. An example of the printed report of input and
output data 1s given in Figs. 6 and 7.

2.6 Calculation wdules

As shown in the computer listing in appendix, all the


calculations specific to an experiment are contained in
the calculation module between line 15000 and 20000.

258 MICROSOFIWARE FOR ENGINEERS, 1986, Vol. 2, No. 4.


BASIC Soil Testing: J.P. Bardet and Gunawan Gunawan

The output arrays DATA3 and DATA4 are filled in this 5. Appendlx: Computer listing of the calculation module
section which 1s defined by the user. In the case of the for the drained trlaxlal test with measurement of
trlaxial test, the input variable are first transferred volume change.
from the input arrays DATA1 and DATA2 to some other
variables which have a more convenient notation. The
initial dry unit weight, axial strain and stress, lnltlal
Young modulus, maximum friction angle are calculated in a
conventional way C1,2,3.4,5,61 and transferred in the
output arrays DATA3 and DATA4 at the end of the
calculation for the results to be displayed in the output 10000 ‘*+***++*+***********4+************
1
pages. 10010 ‘46 DRAINED TRInXIaL. TEST *
10020 ‘~x**~***+***xx*x+*+~****~***~**~~
2.7 Mxllflcatlon of library of experiments 10030 ------------_----------------
10040 ’ ! Definition of all variables I
Calculation modules similar to the one shown in 10041 ’ I ------------_---------------- I
appendix have been created for the following experiments: 10042
sieve and hydrometer analysis, liquid and plastic limits, loos0 NPTMAX=50 ‘man number of data
unified soil claszlflcatlon, compaction test, constant and 10061 >
falling head permeability tests, unconfined compression 10062 ‘First group of input variables
test, direct shear test, consolidation test, and drained 10063 ,
and undrained triaxlal tests. This library can be extended 10070 LABEL1%=9 : DIM LABELl%(LABELl%):
or modified by adopting the same convention than the DATA 1( L-ABEL 1% )
drained trlaxlal test. Once the new module has been 10000 1ABELl%< 1 )=“Weight of dry sample
created using the BASIC editor, the file should be saved
as [Link] where 1 1s the lab number in the first menu. WO gram”
Then the main input/output package may be loaded and 10090 LABELl%(2)=“Initial average sample
executed. This input/output package shareable by all height
experiments keeps the coding zlmple while maintaining an Ho cm”
input with advanced user friendly technique in BASIC far 10100 L_ABEL1%(3)=“Initial average sample.
beyond the scope of a undergraduate course in Ceotechnical diameter
Engineering. DO crn~~
10110 LABELl%(4)=“Soil specific gravity
Gs”
3. CONCLUSION 10120 LABEL1%(5)=“Load ring calibration
factot-
The interactive computer code SOILAB which processes F lb/lo-4”
soil testing measurement has been briefly presented. The 10130 LABELl%(b)=“Constant confining
computer code has been written in the programming language pressure
BASIC for the sake of simplicity and adaptability to Sig3 psi ”
various computers and output devices. The main features of 10140 LABEL1%(7)=“Volume change during
the code are: interactive input through a screen editor, consolidation
adaptability to new types of experiments, and various DVW cm3”
output devices (video screen, pen-plotter, and graphic 10150 LAEiELl%(S)=“Back pressure
printer). This computer program alms to help instructors Ii0 psi”
teach soil testing to undergraduate or graduate students 10160 LABEL1%(9)=“Saturation coefficient
in Civil Engineering. Each type of soil experiment 1s a B”
module within a library which can be eazlly expanded and 10161
modified even with a limited skill in programming. All 10162 ‘Second group of input variables
modules share the same screen editor and graphical 10163 >
package. The structure of the input and output data 1s 10170 LABEL2%=3 : DIM LABEL2%(LABEL2%):
flexible enough to be extended to most of the experiments DhTA2(NPTMAX.L0BEL2%)
in material testing. The code still needs to be improved 10180 L ABEL2%( 1 )=“displacement dial reading
in various ways. Future verzlons will include linear and lo-3in”
nonlinear regression analysis and error calculation, and 10190 LABEL2%(2)=“Ioad dial reading
will be compatible with an A/D converter. lo-4in”
10200 LABEL2%(3)=“volume reading on burette
cm3”
4. BEFERENCES 10201
10202 ‘First group of output variables
Bowles, J.E., Engineering Properties of Soils and I
1. 10203
their Measurement, McGraw-Hill, Inc., 1986. 10210 LABEL.3%=7 : DIM LABEL36cLABEL3Y.j:
2. Daz, B., Sol1 Mechanics Laboratory Manual, Engineering DATA3(LABEL3%)
Press, Inc., 1986. 10220 L.ABEL3%(l)=“Initial void ratio
3. Laboratory Soils Testing, U.S. Army Engineer Waterways eo )b
Experiment Station, 1970 10230 LABEL3%(2)=“Initial dry unit weight
4. Lambe, T.W., Sol1 Testing for Engineers, John Wiley %
Sons, 1951. Go g/cm3”
5. Llu, C;, and J.i. Evett, Soil Properties, Testing, 10240 LABEL3%(3)=“Void ratio after
Measurement and Evaluation, Prentice-Hall, Inc., consol idat ion
Englewood Cliffs, 1984. ec 88
6. Wray, W.K., Measuring Engineering PPOpertfaS of Soil, 10250 LAEEL3%(4)=“Dry unit weight after
Prentice-Hall, Inc., Englewood Cliffs, 1986. consolidation
7. Cuellar, C., Advanced Programming Techniques in
Microsoft BASIC, Reston Computer Croup Book,
Prentice-Hall, Inc., 1984.

MICROSOFIWARE FOR ENGINEERS, 1986, Vol. 2, No. 4. 259


BASIC Soil Testing: J.P. Bardet and Gunawan Gunawan

10260 L ABEL3%(5)=“Peak friction angle 15000 WO= DATAI( HO= DATAl(2):


DO= DATAI( GS= DATAl(4):
Ptlimax degree” F = DATAl(5): S3= DATAl(6):
10270 LABEL3%(6)=“Ultimate friction angle DVW=DATA1(7): UO=DATAl(B) :
B= DATAI
Phiult degree” 15010 VO= HOx(3.14159*D0”2/4! 1
10280 LABEL3%(7)=“Initial young modulus 15020 GO= #O/V0
Ei psi” 15030 EB= GS/GO-1 !
10281 ’ 15040 UC= VO-DVW
102B2 ‘Second group of output variables 15050 GC= WO/VC
10283 ’
10290 LABEL4%=4 : DIM LABEL4%(LABEL4%): 1SO60 EC= GS/GC-l!
DATA4(NPTMAX,LABEL4%) 15070 HC= HO+(l!-DVW/V0/3!)
10300 LABEL4%(1)=“axial strain %” I 5080 FOR I= 1 TO NPT%-1
10310 LABEL4%(2)=“deviatoric stress psi” 15085 ’ axial strain in %
10320 LABEL4%(3)=“volumetric strain %” 15090 DATA4(I,l)=DATA2(1,1)+0.254/HC
10330 LABEL4%(4)=“void ratio” 15100 A= (VC-DATA2(1,3))/(HC-DATA2tI.l)
11000 GOTn 1300 + .00254 )
11500 ’ isios ’ deviatoric stress in psi
12000 2 !----~~i~~i~Ti~~-P~~~~---! 15110 DATA4(I,2)=DATA2(1,2)*F/(A/6.451.5)
12500 * ~_____________________---_! 15115 ’ volumetric strain in %
13000 ) 15120 DATA4(1,3)=DATA2(1,3)/VC*lOO!
13010 ’ Definition of all variables 15125 ’ void ratio
13020 ’ WO ., = weight of dry sample 15130 DATA4(1,4)=(1!+EO)x(VC-DATA2(1,3))
13021 ’ HO = initial average sample /vo-l!
height 15140 NEXT I
13022 ’ DO = initial average sample 15145 ’ maximum deviatori, c stress in psi
dimeter 15150 RMAX= O!
13023 ’ GS = soil specific gravity 15160 FOR I= 1 TO NPT%-1
13024 ’ F = load ring calibration 15170 RATIO= DATA4(1,2)/( DATA4(1,2)+2!
factor *S3)
13025 ’ VO = initial volume (cm3) 15180 IF ( RATIO >= RMAX
13026 ’ GO = initial dry unit weight THEN RMAX = RATIO
(g/cm3) 15190 NEXT I
13027 ’ EO = initial void ratio 15200 PHIMAX= ATN(RMAX/SQR(l-RMAX+RMAX))
13028 ’ VC = volume after istropic +iao!/3.14159
consolidation (cm3) 15205 ’ maximum axial strain
13029 ’ GC = dry unit weight after 15210 ElMAX= O!
isotropic consolidation 15220 IMAX- 1
(g/cm3) 15230 FOR I= 1 TO NPTX-1
13030 ’ EC = void ratio after isotro- 15240 IF ( DATA4(1,11 > ElMAX )
pic consolidation THEN ElMAX=DATA4(1,1)
13031 ’ HC = sample height after iso- 15250 IF (DATA4(1,1) = ElMAX)
tropic consolidation (cm) THEN IMAX=I
13032 ’ DVW = volume change during 15260 NEXT I
consolidation (cm3) 15265 ’ ultimate friction ang le
13033 ’ 53 = constant confining 15270 RATIO= DATA4(IMAX,2)/
pressure (psi ) (DATA4(IMAX,2)+2 ‘!SS3)
13034 ’ (JO = back pressure (psi) I 5280 PHIULT= ATN(RATIO/SG!R(l -RAT IO+
13035 ’ B = saturation coefficient RATIO))+laO!/3. 14159
13036 ’ A = corrected area (cm21 15285 ’ initial Young modulus
13037 ’ RMAX = maximum deviatoric stress 15290 S13= (DATA4(2,2)+DATA4(3,2))
(psi) /2!-DATA4(1,2)
13030 , PHIMAX = peak friction angle 15310 El=(DATA4(2,l)+DATA4(3,1))
(degree 1 /2!-DATA4tl.l)
13039 ’ ElMAX = maximum axial strain (%) 15320 IF El<>O! THEN EI=S13/El
13040 ’ PHILILT = ultimate friction angle ELSE EI=O.
(degree) 15330 ’ transfer output data in array
13041 ’ S‘13 = average of deviatoric DATA3 ( )
stress (psi) 15340 DATA3(l)=EO:DATA3(2)=GO:
13042 ’ El = average of axial strain DATA3(3)=EC:DATA3(4)=GC:
(%) DATA~(~)=PHIMAX:DATA~(~)=PHIULT:
13043 ’ Ei = irliti&l Young modulus DATA3(7)=EI
(psi) 15360 RETURN

13051 ’ NPT% = rlttmbrr of input data 20000 REM


points

260 MICROSOFTWARE FOR ENGINEERS, 1986, Vol. 2, No. 4.

You might also like