BASIC Soil Testing Program Overview
BASIC Soil Testing Program Overview
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.
02669463/86/020255 - 06 $2.00
8 COMPUTATIONAL. MECHANICSPUBLICATIONS 1986
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-
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.
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.
3c
I
axial strain 3:
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.
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.