MICROCOMPUTIR PROGRAMS fOR GRoUNDWAIIR BIUDIIB DAVID CLARKE 20 Musgrave Street, Crystal Brook, S.A. 5523 (Australia)
ELSEVIER
Amsterdam - Oxford - New York - Tokyo 1987
ELSEVIER SCIENCE PUBLISHERS B.V. Sara Burgerhartstraat 25 P.O. Box 211, 1000 AE Amsterdam, The Netherlands
Distributors for the United States and Canada: ELSEVIER SCIENCE PUBLISHING COMPANY INC. 52, Vanderbilt Avenue New York, N.Y. 10017, U.S.A.
ISBN 0-444-42793-7 (Vol. 30) ISBN 0-444-41669-2 (Series)
© Elsevier Science Publishers B.V., 1987 All rights reserved. No part of this publication may be reproduced, stored ina retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the publisher, Elsevier Science Publishers B.V./Science & Technology Division, P.O. Box 330,1000 AH Amsterdam, The Netherlands. Special regulations for readers in the USA - This publication has been registered with the Copyright Clearance Center Inc. (CCC), Salem, Massachusetts. I nformation can be obtained from the CCC about conditons under which photocopies of parts of this publication may be made in the USA. All other copyright questions, including photocopying outside of the USA, should be referred to the publisher. Printed in The Netherlands
Appreciation
I must t h a n k my f o r m e r b o s s , M i c h a e l Cobb, f o r t h e e n c o u r a g e m e n t t h a t he g i v e me i n d e v e l o p i n g t h e p r o g r a m s t h a t p r e c e d e d t h e s e . P e t e r Pavy drew t h e l i n e d r a w i n g s t h a t I found t o o d i f f i c u l t . H i s drawi n g s a r e t h e p r o f e s s i o n a l l o o k i n g o n e s . Thankyou P e t e r . Thanks a r e a l s o due t o my e m p l o y e r , The S o u t h A u s t r a l i a n D e p a r t m e n t of Mines and E n e r g y , f o r p u t t i n g m e i n a p o s i t i o n where t h e w r i t i n g o f t h e p r o g r a m , and t h e n t h e b o o k , became t h e o b v i o u s c o u r s e o f a c t i o n . I ' m g r a t e f u l t o Carl McElwee, M . Cobb, and Munir A . B u t t o f t h e K a n s a s (USA) G e o l o g i c a l S u r v e y f o r t h e F o r t r a n program on which i s b a s e d t h e s o l u t i o n o f t h e Leaky Well f u n c t i o n i n t h i s work. P a u l v a n der H e i j d e o f t h e I n t e r n a t i o n a l Groundwater M o d e l l i n g C e n t e r ( I n d i a n a , USA) o f f e r e d v e r y welcome e n c o u r a g e m e n t i n t h e e a r l i e r s t a g e s o f the writing. C o l l i n H a z e l o f t h e Q u e e n s l a n d ( A u s t . ) Water R e s o u r c e s Commission produced t h e d e s c r i p t i o n t h a t a l l o w e d t h e w r i t i n g of program f o r t h e M o d i f i e d S t e r n b e r g A n a l y s i s i n t h i s book. More t h a n a n y o t h e r , I t h a n k my w i f e , D e n e c e , a p a t i e n t and u n d e r s t a n d i n g c o m p u t e r widow, f o r h e r e n c o u r a g e m e n t and h e l p .
Disclaimer
While t h e p r o g r a m s i n t h i s book a r e g i v e n i n t h e b e l i e f t h a t t h e y w i l l g i v e c o r r e c t r e s u l t s i f ' t h e y a r e used a s i n s t r u c t e d , no r e s p o n s i b i l i t y i s assumed by t h e a u t h o r o r p u b l i s h e r f o r a n y e r r o r s , m i s t a k e s , or m i s r e p r e s e n t a t i o n s t h a t may o c c u r f r o m t h e u s e o f t h e s e p r o g r a m s , and no c o m p e n s a t i o n c a n be g i v e n f b r a n y damages o r losses w h a t e v e r t h e i r c a u s e . %
Index Addition of a constant to the elements of a vector; 6.11, 6.28 Alteration of step test data; 6.11, 6.27 Analytical models; 8.1 Angle hole, correction of readings; 6.11 ANMODL, listing; 8.7 ANMODL, method used; 8.5 ANMODL, units of time; 8.3 ANMODL, using; 8.2 ANMODL, variables; 8.6 ANMODL, verification; 8.2 ANMODL; 8.2 Anomalous readings, removal of; 6.13, 6.26 Anomalous readings, search for; 6.13, 6.25 Anomalous readings; 6.13 Approximation of reality; 1.2 Aquifer discharge test simulation (see also simulation); 4.1 Automatic renumbering of readings; 6.12 Automatic scaling of graphs; 9.1, 9.4 Average discharge rate, calculation of; 6.15, 6.29 Basic, computer language; 1.3 Basic, use of in modifying DTDHA data; 6.4 Bessel Function, requirement for double precision; 1.7 Bessel Function; 5.5 Bessel Functions, The; 1.4 BESSEL, description; 1.4 BESSEL, listing; 1.10 BESSEL, variables; 1.5 BESSEL, verification; 1.4 Boundary, aquifer; 2.5 Boundary, discharge; 10.1 Boundary, discharge; 2.5 Boundary, partial; 10.1 Boundary, recharge; 10.1 Boundary, recharge; 2.5 Boundary; 10.1 Built in data, DTDHA; 6.5 Built in data, 1NTERP1; 5.5, 5.12 Built in data, INTERP2; 5.7, 5.13 Calculation of drawdown when R=O; 8.4 CB2, listing; 3.11 CB2, variables; 3.8 CB2N, description; 3.5 CB2N, description; 3.8
Ix.1
CB2N, listing; 3.10 CB2N, variables; 3.7 CLEAR; 6.6 Colour for graph plotting; 9.5 COMPERF, description; 1.8 COMPERF, listing; 1.16 COMPERF, variables; 1.8 COMPERF, verification; 1.8 Complimentary Error Function; 1.8 Computers, use of; 1.1 CONFBOUN, description; 2.5 CONFBOUN, listing; 2.18 CONFBOUN, variables; 2.8 CONFBOUN, verification; 2.8 CONFDD, description; 2.1 CONFDD, listing; 2.13 CONFDD, variables; 2.2 CONFDD, verification; 2.2 CONFDDB, listing; 10.11 CONFDDB; 10.10 Confined aquifer with a boundary, drawdown in; 2.5 Confined aquifer, drawdown in; 2.1 CONFSTRP, description 2.11 CONFSTRP, listing; 2.23 CONFSTRP, variables; 2.12 CONFSTRP, verification; 2.12 Conversion for a different reference point; 6.11 Conversion of step test data, limitations of; 6.8 Conversion of step test data; 6.8, 6.33 Cooper-Jacob Approximation, limitation of; 3.1 CSTR1PB, listing; 10.11 CSTR1PB; 10.10 Cumulative flow meter readings; 6.4 Data from a flow rate recorder; 7.2 Data statements in DTPLOT; 9.6 Data statements, in STRNBRG; 7.2 Data, displaying, DTDHA; 6.8, 6.38 Data, entry of, DTDHA; 6.6, 6.36, 6.38 Data, printing, DTDHA; 6.8, 6.38 Delay of data display; 6.39 Deleting a number of readings; 6.12, 6.28 Deleting a reading; 6.12, 6.29 Delta s, calculation of; 6.16, 6.30
Ix.2
Index
Dependent variables, matrix of; 5.7 Dependent variables, vector of; 5.7 Dependent variables; 5.1 Derivative at a point; 3.2 Derivative, calculation of; 3.3 Derived Function; 3.2, 6.39 DIP switches on plotter; 9.2 Discharge rate in data; 7.1 Discharge rate of an image well; 10.2 Discharge rate, change in; 7.1 Discharge Test Data Handling and Analysis; 6.1 Disk data file, used in STRNBRG; 7.2 Disk file, loading; 6.6, 6.39 Disk space insufficient; 6.2 Double precision in Bessel Function; 1.7 Double precision in Leaky Well Function; 1.7 Double precision variables; 1.7 Double precision; 3.2 Drawdown curve, three part; 10.4 DTDHA, care in using; 6.2 DTDHA, description of; 6.24 DTDHA, functions of; 6.1 DTDHA, menus; 6.3 DTDHA, structure; 6.3 DTDHA, subroutines; 6.3 DTDHA, using; 6.5 DTDHA, variables in; 6.21 DTDHA, verification; 6.5 DTDHA, well equation; 4.27 DTDHA; 6.1 DTPLOT, capabilities; 9.1 DTPLOT, description; 9.3 DTPLOT, listing; 9.9 DTPLOT, subroutines; 9.6 DTPLOT, variables; 9.7 DTPLOT, verification; 9.2 DTPLOT; 9.1 DTPLOT; data statements; 9.6 Error Function; 1.8 Error, accumulating; 1.6 Error, Basic interpreter; 6.2 Error, operating system; 6.2 Error, round off; 1.1 Evaluation of the Well Equation by s/Q vs. Q; 6.17, 6.31 Evaluation of the Well Equation, Rorabaugh; 6.19, 6.32, 6.34
Evaluation of the Well Equation, Sternberg; 7.7 Evaluation of the Well Equation; 6.17, 6.31 Exponential series; 5.8 FACT, description; 1.7 FACT, listing; 1.15 FACT, variables; 1.8 FACT, verification; 1.7 Factorial Function; 1.7 File name, precaution; 6.6 Function of two variables, interpolation of; 5.2, 5.7, 5.12 Function, Bessel; 1.4 Function, Complimentary Error; 1.8, 1.16 Function, Error; 1.8 Function, Factorial; 1.7 Function, Gamma; 1.7 Function, Leaky Well; 1.6 Function, Well; 1.1 Gamma Function; 1.7 Gaussian Error Function, see Error Function Gaussian Error Function; 1.8 Graph types produced by DTPLOT; 9.1, 9.3, 9.4 Graphs, automatic scaling; 9.1, 9.4 Graphs, log-linear; 9.1 Graphs, log-log; 9.1 Graphs, names; 9.3, 9.5 Graphs, recovery; 9.1 Graphs, root t minus root t1 residual drawdown; 9.1 Graphs, root-time; 9.1 Graphs, t/t1 residual drawdown; 9.1 Gunter, Edmond; 3.1 Image well, calculation of distance to; 2.5 Image well, discharge rate of; 10.2 Image well; 10.1 Image well; 2.5 Image wells, calculation of drawdown due to; 2.5, 2.12 Independent variables, vector of; 5.7 Independent variables; 5.1 Inflection point in a set of data; 6.14, 6.26 Inflection point, search for; 6.14, 6.15, 6.26 Initial conditions; 7.1
Index Inserting a reading; 6.12, 6.29 INTERP1, description; 5.6 INTERP1, listing; 5.11 INTERP1, usage of variables; 5.7, 5.5 INTERP1, use of; 5.5 INTERP1, verification; 5.7 INTERP1; 5.5 INTERP2, description; 5.7 INTERP2, listing; 5.12 INTERP2, usage of variables; 5.9 INTERP2, verification; 5.9 INTERP2; 5.7 Interpolation, in g/w science; 5.1 Interpolation, Lagrangian; 5.1, 5.3 Interpolation, linear; 5.2 Keyboard entry of data, DTDHA; 6.6, 6.36 LAGRANGE 5.3 LAGRANGE, description; 5.3 LAGRANGE, listing; 5.10 LAGRANGE, variables; 5.5 LAGRANGE, verification; 5.4 Lagrange; 5.1 LEAKBOUN, description; 2.8 LEAKBOUN, listing; 2.20 LEAKBOUN, variables; 2.9 LEAKBOUN, verification; 2.9 LEAKDD, description; 2.3 LEAKDD, listing; 2.15 LEAKDD, variables; 2.4 LEAKDD, verification 2.4 LEAKFUNC, description; 1.6 LEAKFUNC, listing; 1.12 LEAKFUNC, variables; 1.7 LEAKFUNC, verification; 1.6 LEAKSTRP, listing; 2.26 LEAKSTRP, verification; 2.13 Leaky Artesian Well Function; (see Leaky Well Function) Leaky confined aquifer with a boundary, drawdown in; 2.8 Leaky confined aquifer, drawdown in; 2.3 Leaky confined strip aquifer, drawdown in; 2.13 Leaky Well Function, requirement for double precision; 1.7 Leaky Well Function; 1.6 Leaky Well Function; 5.7 Line feed character sent by DOS to a printer; 8.5
Ix.3
Linear regression; 6.13, 6.15, 6.18, 6.28, 6.36 Linear series; 5.2 Linearizing an exponential series; 5.8 Loading of a disk file, DTDHA; 6.6, 6.39 Log cycles, number plotted; 9.5 Log-linear graphs; 9.1 Log-log graphs; 9.1 Manual scaling of graphs; 9.4 Matrix model; 8.1 Matrix of groundwater heads; 8.1, 8.4 Menu, main menu of DTDHA; 6.6 Menu, menu 2 of DTDHA; 6.11 Merging data files; 6.12, 6.28 Models, limitations of; 1.2 Multiple discharge rates; 7.1 Multiple pump model; 4.2 Multiplication of the elements of a vector by a constant; 6.11, 6.28 Names for graphs; 9.3, 9.5 Napier, John; 3.1 Newton's Method; 3.1, 6.27, 6.39 NEWTON, description; 3.2 Newton, Isaac; 3.1 NEWTON, listing; 3.9 NEWTON, variables; 3.3 Newtons Method, speed of solution; 3.3 Noisy data; 6.14 Numerical models; 8.1 Partial boundary; 10.1 Piezometric surface; 8.2 Plotter commands; 9.8 Plotter, DIP SWitches; 9.2 Plotter, setting up; 9.2 Polynomial approximations of the Well Function; 1.1, 2.1, 3.5, 6.39 Printer control commands; 8.5 Printer, using, DTDHA; 6.8 Program structure; 1.2 Program, modular structure; 6.2 Programs, on disk; 1.4 Ratio between two transmissivities; 10.1 Reading number; 6.4 Reading; 7. 1 Record; 6.4 Record; 7.1 Recovery between steps; 6.8, 6.33 Recovery graphs; 9.1
Ix.4
Index
Recovery period; 7.1, 7.3 Recovery, calculation from residual drawdown; 6.20, 6.27 Renumbering of readings, automatic; 6.12 RESET; 6.2 Root t minus root t1 residual drawdown graphs; 9.1 Root-time graphs; 9.1 Saving data to a disk file, DTDHA; 6.6, 6.39 Semi-strip aquifer; 10.10 Series, exponential; 5.6 Series, linear; 5.2 Shell-Metzner sort; 6.12, 6.26 SIM1, description; 4.2 SIM1, listing; 4.31 S1M1, variables; 4.29 SIM1, verification; 4.4 SIM1; 4.12 SIM2, description; 4.6 SIM2, listing; 4.34 SIM2, variables; (also see SIM1 and LEAKDD) 4.31 SIM2, verification; 4.6 SIM2; 4.6 SIM3, description; 4.10 SIM3, listing; 4.36 SIM3, variables; 4.29 SIM3, verification; 4.10 SIM3; 4.10 SIM3B, listing; 10.12 S1M3B; 10.10 SIM4, description; 4.16 SIM4, listing; 4.40 SIM4, variables; (see also SIM3 and LEAKBOUN) 4.31 SIM4, verification; 4.16 SIM4; 4.16 SIM5, listing; 4.42 SIM5, variables; 4.29 SIM5, verification; 4.16 SIM5; 4.16 SIM5B, listing; 10.12 S1M5B; 10.10 S1M6, description; 4.22 SIM6, listing; 4.45 S1M6, variables; (see also SIM5 and LEAKSTRP) 4.31 S1M6, verification; 4.25 SIM6; 4.22 SIM7, description; 4.26 SIM7, listing; 4.47 SIM7, variables; 4.29 SIM7, verification; 4.26
S1M7; 4.26 Simulation; a bounded confined aquifer; 4.10 Simulation; a bounded leaky confined aquifer; 4.16 Simulation; a confined aquifer; 4.2 Simulation; a confined strip aquifer; 4.16 Simulation; a leaky confined aquifer; 4.6 Simulation; a leaky confined strip aquifer; 4.1 Simulation; a pumped well; 4.2, 4.26 Sorting data into order of time; 6.12, 6.26 Specific capacity; 6.4 Square root of time, graphing; 4.19 Steady state models; 6.1 Step test data, conversion of; 6.6, 6.33 Sternberg analysis graphs; 7.6, 7.6 Sternberg analysis with a period of recovery; 7.7 Sternberg analysis without a period of recovery; 7.7 Sternberg analysis, advantage of; 6.6 Sternberg analysis; 7.1, 7.2 Stirlings Approximation; 1.7 Storage coefficient, calculation of; 6.16, 6.32 Strip aquifer image wells; 2.9 Strip aquifer with partial boundaries; 10.3 Strip aquifer, drawdown in; 2.11 Strip aquifer; 2.9 STRIPCAL, verification; 2.10 STRIPCAL, description; 2.9 STRIPCAL, listing; 2.23 STRNBRG, data requirements; 7.1 STRNBRG, listing; 7.11 STRNBRG, well equation; 4.27 Subset of data for interpolation; 5.6 Successive bisection; 3.6 Summation of drawdowns; 6.2 SWAP; 6.12 Symbol for graph plotting; 9.5 t/t1 conversion; 6.11, 6.12, 6.27 t/t1 in DTPLOT; 9.6
Index t/t1 residual drawdown graphs; 9.1 Test description data, alteration ofj 6.8, 6.27 Theis Equation (also see Well Function); 3.4 Theis Equation; 10.8 Theis Function; (also see Well Function) 1.1, 2.1 Time of change in discharge rate; 7.1 Time, as date and time of day; 6.7, 6.37 Time, specification of; 6.1 Total absolute deviation; 6.15, 6.26 Transient state models; 8.2 Transmissivity, calculation of; 6.16, 6.30 Turbulent flowj 6.17 Two part aquifer, drawdown in; 10.10 Units for Delta Sj 6.1 Units 1.1, 4.2, 6.1, 9.6 Units of time in ANMODL; 8.3 Units of transmissivity; 6.1 Units, conversion of; 6.1 Units, conversion ofj 6.11 VALj 6.7 NEWTON, verification; 3.2 Well equation; 4.25 Well equation; 7.9 Well Function of Uj (see Well Function) Well Function, evaluation of; 1.1 Well Function; 1.1, 2.1 Well loss; 4.26, 6.17 Well, image; 10.1 WELLFUNC, description; 1.2 WELLFUNC, listing; 1.9 WELLFUNC, variables; 1.4 WELLFUNC, verification; 1.3 Width of a printed character; 8.5
Ix.5
Introduction
1.1
Introduction
The primary aims of' this book are to provide a selection of subroutines and programs with as wide and as basic as possible an application to groundwater science, and to explain their uperation. Readers familiar with microcomputer programming may apply the programs given here to their own work, perhaps incorporating them as subroutines into larger, more specialized programs; and those unfamiliar with programming can use the programs as they are listed. The programs in this book are in no way a substitute for knowledge and experience in groundwater science. The aim is more to make complex procedures readily available to the practising hydrogeologist. Several procedures that are described in this book are not confined to groundwater in their application, but have been found to have a number of uses in groundwater. This is a practical book, written to solve real-life problems, overheads have therefore been kept to a minimum. The derivation of equations and functions are not described here, equations are taken from other sources and For those readers Who want to check on derivations, references used here. are given. The first programs to be described are functions usable as subroutines in practical applications. These are then used to solve typical groundwater problems. More functions and procedures are introduced, and applied in generally more involved groundwater situations as the reader progresses into the book. A program to produce a disk file from discharge test data, and to analyse those data, is given later, as well as a program to graph the data. An analytical model of changes in the piezometric surface due to a number of discharging or recharging wells is included. Most of the programs can be used with any set of consistent units. Where units are specified, they are metric (normally metres and days are the primary units used, although in order to follow common practice, minutes are used in discharge test analysis). The programs are designed to be run with little prior instruction. Prompts given by the computer should give sufficient information about what is required for the user to get right through a particular program with no more than an occasional reference to the written instructions. 1. THE USE OF MICROCOMPUTERS IN GROUNDWATER SCIENCE. Any complicated mathematical task not only can, but should be done by a computer if one is available because of the fallibility of humans in solving arithmetic operations. As well as almost never making arithmetical errors, computers are much qUicker in any arithmetical operation. (Programmers do make errors, as many as anyone else, but once the errors in a program have been found and removed, they will not recur.) I believe that a complex mathematical operation should be done manually only so that the person using it can fully understand it. Thenceforth it should be computerised.
I.2
In~roduction
The computer is a tool which has recently become available for our use. It should be used in any situation where it offers the best available method of achieving the desired result.
2. APPLICATION OF NUMERICAL/ANALYTICAL METHODS TO GROUNDWATER PROBLEMS. Geology in general, and hydrogeology especially, often involves applying numerical values to naturally occurring systems. ego An age to a rock formation, a transmissivity to an aquifer. While in physics quantities may be known to high degrees of accuracy, hydrogeology uses approximations and generalizations. It is often not possible, or even desirable, to be totally accurate. ego The age of which part of the formation? - The transmissivity of which part of the aquifer, and in which direction? Answers will be required for these questions at times, but usually an approximate answer for the whole unit is all that is needed. The moment one applies a mathematical equation (ie. a model) to a groundwater problem, even if that equation is as simple a Darcy's law (Bouwer, 1978), some simplifying assumptions must be made. Some common assumptions are; 1/ The porous medium is homogeneous. 2/ The piezometers used to monitor the system give values that are representative of a significant cross-section of the system rather than of just one point. 3/ Vertical flow within the aquifer is negligible. 4/ The aquifer is fully confined. 5/ The aquifer is of infinite extent. In reality these assumptions are very often not justified. If unjllstified simplifying assumptions are applied to a complex real world situation in order to obtain information on that system, then it foll~s that the information so obtained will at best be approximate. Only in an ideal (and therefore nonexistent) groundwater system will our methods of mathematical analysis give completely accurate answers. Hydrogeology is not, cannot be, an exact science. The skill of the competent and experienced hydrogeologist rests largely in his/her ability to make meaningful generalizations and approximations, and in knowing how far these can be pushed before errors become so great as to invalidate any conclusions that he/she may make. These arguments must be borne in mind in using the programs in this book. There seems to be a tendency among some people to take any numbers There is a saying in produced by a computer to be absolutely correct. computer science; "rubbish in - rubbish out". You cannot expect the output of your computer to be better than it's input. In many cases errors in data will be magnified, and results will be less accurate than input. If all this sounds pessimistic and defeatist, then it is time for a note of optimism. Very often the bulk properties of an aquifer can be approximated by average figures in such a way as to produce a reasonable simulation of the behaviour of that aquifer under given conditions of
Introduction
1.3
recharge or discharge. I've seen discharge test results from many wells that indicated an aquifer that behaved very similarly to an ideal infinite, confined, homogeneous, isotropic aquifer, at least for the duration of the test. In summary, I would like to make two suggestions. 1/ Don't expect five figure accuracy when using these programs to evaluate some aquifer parameter, often one figure, or even order of magnitude values may be both useful and the best that can be expected. 2/ Perhaps mathematical rigour should take second place to seat of the pants empiricism at times?
3. THE BASIC COMPUTER LANGUAGE AS USED IN THIS BOOK. Basic is universally used as the first language of microcomputers. It's greatest advantages over other languages are it's capability to interact with the programmer, and it's ease of debugging. It's greatest disadvantage is it's lack of any enforced structure. Any structure in a Basic program is present due to a conscious effort from the programmer. There are a number of versions of Basic that have been implemented in modern microcomputers. In most cases they vary only in which key words are recognised. The form of Basic used here will suit most micros other than the cheap, games orientated machines. Most of these programs could be readily rewritten to run on a more limited Basic, but it was thought likely that readers interested in serious use of microcomputers would have access to machines with a good version of Basic. ~. GETTING STARTED. I will assume that you know how to setup your computer, this book is not the place for that sort of instruction. Nor is this the place for detailed instructions on the use of the Basic interpreter, you may find that you will have to refer to your Basic manual, especially if you decide to type the programs in from the listings in the book. 1/ Load your Basic interpreter. In most cases this will involve making sure that you have a disk with Basic on it in the computer, and then typing "Basic", or perhaps "Gwbasic", then pressing the enter key. 2/ If you have the programs on disk, put that disk in the computer and type 'Load"filename'" (the double quotes are required) where filename is the name as it appears in this book. Your computer may require either '/bas', or '.bas' to be appended to filename, inside the quotes. 3/ If you want to type in the program, do so now, following the directions in your Basic manual. Before switching off the computer, take care to save the program to disk; or at least save Whatever part of the program that you type in in one session. ~I Type the word "run", and press enter. Now the program will take control. 51 If you are using an IBM or compatible, you can at any time temporarily delay the program execution by holding down the 'Ctrl' key, and at the same time pressing 'Num Lock'. Other computers may have other methods
1.4
Introduction
of achieving the same result. Pressing any key will then resume execution of the program, and the display and printout should not be affected. 6/ Again, if you are using an IBM or compatible, if you want to stop the program and return to the Basic command level at any time, hold down 'Ctrl' and press 'Break'. This allows you to interact with the computer at any time in a program, perhaps to check the contents of variables. Typing 'cont' and pressing the Enter key will resume program execution, but in this case the display will be affected. 7/ All the programs in this book are designed to terminate at the end of their particular function, or when instructed to by the operator. At that time you will be returned to the Basic command level. 5. THE PROGRAMS ON DISK. To avoid the tedious job of typing the programs in from the listings, you may purchase them on a thirteen centimetre double sided floppy disk for (Australian) $100 from the author at Clarke Computer Services, 20 Musgrave St., Crystal Brook, S.A., Australia, 5523. The disk is in a format compatible with an IBM PC. The programs will run on many other computers, and it may be possible to have the disk put into a format compatible with your computer, especially if it is either a MS DOS machine, or a CP/M machine, however, this will incur an additional cost. The programs detailed in this book total some 10 000 lines of code or more. I have no doubt that, even after many, many, hours of testing and improving, there are still some bugs to be found, and many improvements that could be made. Therefore I intend to make the latest versions of the programs available on a second disk for a price around (Aust.) $25. (This being for those who have purchased the original. Others could, of course, have both for $125.) The prices are subject to change without notice, and do not include postage and packing. If any errors are found in any of the programs after the time that this book goes to print, those errors will be corrected in the programs on disk, and details given in a file named "READ.ME" on the disk. The programs on the distribution disk are in ASCII format for greater compatibility. This will cause them to be relatively slow to load. After loading each program into Basic from the distribution disk, save it to another disk in your own computers condensed form. (This is the default mode that your computer will use unless instructed otherwise.) Do not use the distribution disk for general work, after copying the programs from it onto another disk, put it away in a safe place. The programs will load from your copies more quickly than from the distribution disk; unless you make copies using a Dos command rather than with Basic.
6. REFERENCE Bouwer, H., (1978). pp.
Groundwater Hydrology.
McGraw-Hill Kogakusha, Ltd.
480
Functions
1.1
Chapter 1
Over the last sixty years several functions have been developed that have proved to have wide and fundamental importance in groundwater science. Functions like the Gausian Error Function have been found to have more limited use. Computer programs yielding solutions to some of these are described in this chapter. Although these programs do not solve any practical problems alone, later chapters will show that they can be put to use in a number of field applications. 1. THE WELL FUNCTION Theis (1935) adapted an equation from heat flow theory to describe the lowering of the piezometric surface on pumping from a well fully penetrating a confined aquifer. His equation (used in a form suitable for giving answers in field applications in the next chapter) includes an integral with the solution: u2
W(u) = -0.577216 -In u
+
u
u3 +--2 21 3 31
( 1.1)
The variables W(u) and u will be defined in chapter 2. is quite possible to evaluate this equation by programming i t directly into a microcomputer, but there are several disadvantages. The larger the value of u, the more terms must be included. With u greater than about 10 to 15, (quite common in real cases, as the distance from the discharging well to the point of observation becomes large) some of these terms are very large although the well function itself is very small. This is a classic case where round-off error due to addition or subtraction can arise, (see Appendix II). Also, when more than a few of the terms must be considered, the method becomes slow. There is a better method. Huntoon (1980) described the use of two polynomial approximations which gave values sufficiently close to be quite acceptable for most, if not all, field applications. It
for 0<=u<=1 W(u)
-In u
+
C
o
( 1.2)
and for 1<=u< infinity
W(u) u e
u
(1.3 )
1.2
Functions
where C =-0.57721566, 0.999991 9 3, 1 C =-0.24991055, 2 C = 0.05519968, 3 C =-0.00976004, 4 C = 0.00107857, 5 0.250621, C 6 C 2.334733, 7 C 1.681534, 8 C 3.330657, 9
co =
and the error in (1.2) is less than plus or minus 2x10 -5 u less than plus or minus 5x10 I(ue).
-7
,and in (1.3) is
1.1. Program WELLFUNC WELLFUNC uses these approximations to solve the Well Equation. Several techniques have been employed to improve speed in this program. While not strictly required here (execution passes through the body of the program once only) maximum speed will later be needed when this program is used as a subroutine of more involved procedures, and is called many times during program execution. Note in the program listing later in this chapter that numerical constants are not used within the equations, the exponentiation function has been avoided, and at the same time the number of multiplications have been kept to a minimum. (See Appendix B for an explanation). This is probably a good time to make a few comments on programming style (See also Appendix C). It is not enough that a program should do the job it is designed to do, it should also be as clear and as easily understandable as possible. It should be' clear, not only so that people new to it can understand it, but clarity makes it much easier for the author himself (or herself) to come back at some later date and modify it. A program is more easily understood if it is structured. This program has ten distinct parts. 11 The program name (in line 1). Followed by the date of the last modification. 21 An initialization section (lines 10 to 90), including a preliminary print statement. In this case it tells people what the program does, and gives them some indication that something is happening while the computer is loading the variables. (The faster computers will not show any significant delay.) 31 Program control (lines 200 to 280). This part could be thought of as being in overall command of the program, it controls the sequence of the major program operations by calling various subroutines with clearly defined functions. Program flow should be relatively easily understood by studying the control 'section. 41 The part of the program that actually does the work of coming up with the answer (lines 2500 to 2550). In this case there is only one part to it, in more complex programs this section will call other subroutines as well
Functions
1.3
as itself being larger. It is not at all uncommon for this, the heart of the program, to make up a small part of the total. The other parts of the program could perhaps be thought of as worker bees, and this the queen bee. The rest of the program exists to prepare the data and environment for the queen; it feeds the queen, and takes away the products of the queen. 5/ Input section (lines 7000 to 7020). Very simple in this case, and could have been included in program control, but in other cases well worth an extra subroutine. 6/ Video output section (lines 7250 to 7270). Again, very simple in this case. 7/ A section to load the values into the variables (lines 8600 to 8650) . 8/ An error message informing the user that he or she has made an invalid entry (lines 9000 to 9020). In a larger program, this could be called from a number of places. 9/ The end statement (line 9999). For the sake of consistency, and understandability, it is worth having a single end statement, and at the end of the main body of the program is the most logical location. It is probably also a good idea to have only one return statement from a subroutine. Generally both of these practices have been followed in this book. Note that by keeping line numbers below 10000, five figure line numbers are avoided, with consequently less typing in the debugging stage. The operation of this program, as far as the user is concerned, is very simple. When the program is run the uer will be asked to enter a value of u. (It is usual practice to represent the function input as u, and output as After typing the number and pressing the
key, (which is W(u)). alternately labelled ENTER, NEW LINE, or END LINE on various computers) the value of the function will be given. The user may then enter another value of u, or terminate the program. The program has been checked against published tables of values for the -15 well function for values of u raning from 10 up to nine. In all tests the values given by the program agreed exactly with the published figures, which were of three or four significant figures. 1.2. Some program.
Program verification values are given below so that users may check the operation of the
u
1E-15 1E-10 1E-4 1E-2 0.1 1 5 9
W(u) 33.96 <'2.45 8.633 4.038 1.823 0.2194 1.148E-3 1.245E-5
1.4
co
F
G1 U
U2
W
Functions
1.3. Usage of variables in the program WELLFUNC to C9 The use of the constants C to C has already been mentioned o 9 . in the remarks on the 'polynomial' approximat~ons to the well function. The use of the variables in the program is the same as their use in the equation. This flag, defined as an integer in line 20, serves to record the loading of the values of the constants into the program variables, andto ensure that time is not wasted in repeating the operation. Defined as a string, is used for formatting the numerical output. The program variable U holds the input to the function, u. and U3 respectively, hold the values of U squared, and U cubed. This permits the solution of the equations with the minimum number of multiplication operations, and consequently with maximum speed. holds the value of the well function, W(u).
2. THE MODIFIED BESSEL FUNCTIONS 2.1. Program BESSEL hese functions (McLachlan, 1956) have applications in dealing with leaky confined aquifers. The program presented here is a fairly highly modified translation of a pair of subroutines used in a Fortran program developed by Cobb et al. (1982). The details of the operation of the subroutines will not be considered here. This program has been tested on values of RB from 0.01 to 10 and gave results which agreed with tabled values printed by Tuma (1978) and Marino and Luthin (1982) to four figures with oneexception where there was a difference of one in the fourth figure. 2.2. Program verification Some trial values for users to check program operation are given below: RB 0.01 0.1 1
5
I(RB) 1.000 1.003 1.266 27.24
K(RB) 4.721 2.427 0.4210 0.003691
The letter I is normally used to represent the Bessel function of the first kind, and the letter K represents the second kind. A few notes about the program may be of use. The users view of progam operation is very similar to the previous program, with the main difference that here he has the choice of either the first or second kind of zero order Bessel function. Program structure also is very similar to WELLFUNC, although there are several differences in the problem solving section. The section consists of two parts this time, the second part is the whole of the solution to the
Functions
1.5
first kind of function. The first part solves the function when the input value (RB) is greater than two; but when RB is less than or equal to two, the second part of the solution section is used as a sUbroutine of the first. Another difference is that the equations used here are physically very long. Some computers are limited to about 128 characters in length of any one line, so the main equations have been broken up into three parts, with the variables B1, and B2 used to hold intermediate values. An alternative method of reducing line length would have been to define parts of the main equations as functions, and then combine several of these to give the final result. The exponentiation function has again been avoided, with A2 being defined as equal to TJ, TN, or TF squared, and A3 as the cube etc. A one key input control section (lines 9800 to 9840) has been added to this program. This is a remarkably useful little ubroutine. It waits until one of a list (in this case the list is "1Ff2Ss"; see line 7020) of keys has been pressed, then returns with a number corresponding to the position of that character in the list in the variable ZX. ego In this case, if upper case S was pressed, then variable ZX will have the value 5. Use of a subroutine serving this purpose can reduce considerably the number of keys the program user need press, and make a program more pleasurable to use. 2.3. Usage of variables in program BESSEL A2 As mentioned above, A2 is given the values of the squares of TJ, TN, or TF at different times. A3 has the values of either TN cubed or TF cubed. A4 has the values of the fourth power of either TJ, or TF. The purposes of the variables A2, A3, and A4 are to minimise the number of multiplication operations, and to avoid the use of the relatively slow exponentiation function. AI is given the value of the Bessel Function of the first kind. AK had the value of the Bessel Function of the second kind. B1 and B2 are both used to hold intermediate results and avoid the use of very long program lines. While this results in more operations than would otherwise be required, it does make the code more portable, and probably increases clarity. C(x) This sUbscripted variable is used for formatting numerical output. I An integer variable used as a counter in a loop. RB has the input to the functions. (Sometimes represented in textbooks as
rIB). TG, TJ,
and TN contain values produced by a simple arithmetic operation on RB. They serve basically the same purpose as A2, A3, and A4, ie. reducing the number of multiplication operations. Z$, ZX, and ZZ$ are used in single key program flow control (mainly handled by the subroutine starting at line 9800).
1.6
Functions
3. THE LEAKY ARTESIAN WELL FUNCTION 3.1: Program LEAKFUNC The function is traditionally symbolized as either W(u,r/L), or W(u,r/B). In this program, u and RB are used for input prompts, and as the respective variable names. The function is evaluated by a complicated set of set of subroutines originally developed as part of a Fortran program by Cobb, McElwee, and Butt, (1982). (An alternative method of evaluating the leaky artesian well function using Lagrangian interpolation is given in chapter 5). This program uses a large number of variables, and most of these have a constant value. To minimise conversions from decimal to binary, all but the simplest constants are loaded into three sets of vectors, C(x), C1(x), and C2(x) at the initialisation stage. The names of the intermediate variables introduced at this stage all begin with A, B, or H, so as to simplify the addition of further functions as required later. Examination of the code will show that it is similar to the last program but for some modifications to the initialization, input, and output sections, and the addition of several subroutines called by a modified control section. There are two parts to the control section, the first handles the general program organisation, while the second is involved only with the job of problem solving. The program has been tested against a wide range of values tabled by Bouwer (1978), and Marino and Luthin (1982) and has given answers identical to the three significant figure tables, with few exceptions of little significance. Some function inputs and outputs are given below for program testing. 3.2.
Program verification RB 0.001 0.002 0.002 0.002 0.01 0.01 0.01 0.1 0.1
u
0.8 2E-6 0.001 0.1 2E-6 0.001 0.2 0.0001 1
0.001
2E-6 0.001 0.8
4
1
1 4
W(u,R/B) 0.311 12.1 6.33 1.82 9.44 6.31 1.22 4.85 0.219 0.842 0.0223 0.311 0.0207
There is an interesting case of accumulating error in this program. It was found while testing the program that if single precision variables were used for all the calculations accuracy was unacceptable for certain function
Functions
1.1
inputs. If the value of RB was 0.001 and the value of u between about 0.1 and 0.8, then the output was accurate to only one or two significant figures; an unsatisfactory situation. It was only by converting the variables AI, AK, B1, and B2 to double precision that this problem was overcome. (Double precision gives about 16 significant figures, and is indicated in a program variable by sUffixing the variable name with 'H'. The variables are now named AID, AKH, B1H, and 82H.) 3.3. Usage of variables in program LEAKFUNC All the variables used in the programs WELLFUNC, and BESSEL are used for the same purposes in this program. In addition there are a number of variables used to hold intermediate values, most of these start with the letter H. Traditionally the leaky well function is represented as W(u,r/B) or W(u,r/L), in this program RB is used to hold the value of riB or rlL, and since the variables U and Ware used in the well function subroutine, W1 is used to contain the function value, and U1 to contain the first input value. I is the primary counter. J is the secondary counter. K is the tertiary counter. The three counters are all integer variables. 4. STIRLINGS APPROXIMATION OF THE FACTORIAL FUNCTION 4.1. Program FACT This program is a modification of a program written by A.R. Miller (1981) to solve the Gamma function. For any given positive argument x, Factorial(x) equals Gamma(x+1). Factorials have a number of applications in groundwater. They can be used for evaluation of the well function, for a solution to drawdown due to intermittent pumping, and as seen earlier in this chapter, can help solve the Leaky Artesian Well function. The Stirling approximation will be found to be much faster than a literal interpretation of the definition of a factorial with any large (say greater than 20) argument, it will not suffer from accumulated round-of error, and it has the ability to handle fractional arguments. There is a simple factorial function in the program BESSEL above. Since this seems to operate infrequently, and only on low arguments, it has been left in it's original form, which is probably just as effective in this case. 4.2. Program verification Some values for program testing are;
1.8
Functions x
o 1 2.5 3.9 4 9 11.1 25
A AA G1 PI X Y
xl
1 (defined, rather than calculated). 1 3.323 20.67 24 362 880 5.098E7 1.551E25
4.3. Usage of variables in program FACT holds a value temporarily in the solution of the factorial function. holds the calculated value of the factorial function. A string variable used for formatting of numerical output. contains the constant, Pi. is used to take the input and increment it by one before it's use in the function solution. is an intermediate variable used in the function.
5. THE GAUSSIAN ERROR FUNCTION AND IT'S COMPLIMENT 5.1. Program COMPERF This is also a modification of one of A.H. Millers (1981) programs, and has several applications in groundwater. Marino and Luthin (1982) use it to calculate the rate and total yield from storage in the main aquifer, and the rate and total volume of induced leakage in a leaky confined aquifer system. It is also commonly used to solve dispersion problems. It is not used in the remainder of this book. Just as variables with names beginning with H have been extensively used in BESSEL, so variable names beginning with E have been added in this subroutine. 5.2. Program verification Some values for testing this routine are; x erf(x) erfc(x) 0.015 0.01692 0.9831 0.2 0.2227 0.7773 0.8802 1.1 0.1198 3 1.0000 2.209E-5 5.3. Usage of variables in the program COMPERF to E5 hold intermediate values in the computation of both the Error function and the complimentary error function. EC contains the complimentary Error function value at the end of the calculations. EF is given the value of the Error function. ES accumulates an intermediate value used in calculating the Error function. El
Functions G1 I J PR TL
X X2
1.9
A string variable used for formatting of numerical output. An integer variable used as the primary counter. The secondary (integer) counter. contains the square root of Pi. is the tolerance used in the calculation of the Error function. If the most recently calculated term (held in E4) is greater than TL times the accumulated value in ES, then the another term is calculated. contains the input to the function. contains X squared.
6. REFERENCES Bouwer, H., 1978. Groundwater Hydrology. McGraw-Hill Kogakusha Ltd. 80pp. Cobb, P.M., McElwee, C.D., and Butt, M.A., 1982. An automated numerical evaluation of leaky aquifer pumping test data etc. Groundwater series 6, Kansas Geo. Surv. Huntoon, P.W., 1980. Computationally efficient polynomial approximations used to program the Theis equation. Groundwater, Vol. 18, No.2, March-April. Marino, M.A., and Luthin, J.N., 1982. Seepage and Groundwater. Developments in water Science. 489 pp. Elsevier. McLachlan, N.M., 1956. Bessel Function for Engineers. Oxford Univ. Press. London. 239 pp. Miller, A.R., 1981. Basic Programs for Scientists and Engineers. Sybex, Berkley, California. 318 pp. Theis, C.V., 1935. The relation between the lowering of the piezometric surface and the rate and duration of discharge of a well using grounwater storage. Trans. Am. Geophs. Un 16:PP519-524. Tuma, J.J., 1978. Engineering Mathematics Handbook, Second Edition. McGraw-Hill. 7. PROGRAM LISTINGS 7.1. The well function. program WELLFUNC REM ••••• WELLFUNC/BAS ••••• 2 REM • Last modified 13/7/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 3D CLS 40 REM -- Preliminary print statements -50 PRINT" Evaluation of the well function using polynomial" 60 PRINT"approximations." 70 PRINT" Valid for 0 < U < 80." 80 IF F=O THEN GOSUB 8600 :REM # Assign values to variables. 90 F=1:REM # Flag set when variables have been loaded. 200 REM === Program control --210 GOSUB 7000 :REM # Input section
1.10
Functions
220 IF U>80 THEN GOSUB 9000:GOTO 40:REM # Invalid input 230 IF U(=O THEN 9999 240 GOSUB 2500 :REM # Solve for W(u) 250 GOSUB 7250:REM # Video output section 280 GOTO 210 2500 REM == SUbroutine W(u) == 2510 U2=U.U:U3=U.U2:IF U(1 THEN 2540 2520 W=1/(U.EXP(U)).(C6+C7.U+U2)/(C8+C9.U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1.U+C2.U2+C3.U3+C4.U2.U2+C5.U2.U3 2550 RETURN 7000 REM === Input section === 7010 PRINT"Enter zero or a negative number to end." 7020 PRINT:INPUT"Enter the value of U"jU 7030 RETURN 7250 REM === Video output section === 7260 PRINT"W(";Uj") ="j:PRINT USING G1jW 7270 RETURN 8600 REM === Assign values to variables === 8610 CO=-.57721566#:C1=.99999193#:C2=-.24991055#:C3=5.519968E-02 8620 C4=-9.76004E-03:C5=1.07857E-03 8630 C6=.250621:C7=2.334733:C8=1.681534:C9=3.330657 8640 G1="##.###AA4A,, 8650 RETURN 9000 REM === Invalid input === 9010 PRINT"Invalid input, please check instructions and re-enter." 9020 RETURN 9999 END 7.2.
The Bessel function, program BESSEL
REM ••••• BESSEL/BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40) 40 CLS 50 PRINT" Evaluation of the modified Bessel functions of the first" 60 PRINT"and second kind, zero order." 70 PRINT" Loading variables, please wait." 80 PRINT 90 GOSUB 8800:REM # Load variables 200 REM === Program control === 210 GOSUB 7000:REM # Input section. 240 IF RB(=O THEN 9999:REM # End. 270 IF ZX<4 THEN GOSUB 5530 ELSE GOSUB 5400:REM First or second 280 GOSUB 7250:REM # Vidio output section.
Functions 290 PRINT 300 GOTO 200 5400 REM === Modified Bessel, Second kind, zero order --_ 5410 IF RB>2 THEN 5480 5420 TJ=RB/2:GOSUB 5530:REM Bessel, 1 5430 A2=TJ*TJ:A4=A2*A2 5440 B1=C(1)+C(2)*A2+C(3)*A4+C(4)*A2*A4+C(5)*A4*A4 5450 B2=C(6)*A4*A4*A2+C(7)*A4*A4*A4 5460 AK=-LOG(TJ)*AI+B1+B2 5470 GOTO 5520 5480 TN=2/RB:A2=TN*TN:A3=TN*A2 5490 B1=C(8)+C(9)*TN+C(lD)*A2+C(11)*A3 5500 B2=C(12)*A2*A2+C(13)*A2*A3+C(14)*A3*A3 5510 AK=1/SQR(RB)*EXP(-RB)*(B1+B2) 5520 RETURN 5530 REM === Modified Bessel, First kind, zero order === 5540 TF=RB/C(30):A2=TF*TF:IF RB<=C(30) THEN 5590 ELSE A3=A2*TF 5550 B1=C(15)+C(16)*(1/TF)+C(17)*(1/A2)+C(18)*(1/A3)+C(19)*(1/(A2*A2» 5560 B2=C(20)*(1/(A2*A3»+C(21)*(1/(A3*A3»+C(22)*(1/(A3*A2*A2» +C(23)*(1/(A3*A3*A2» 5570 AI=1/SQR(RB)*EXP(RB)*(B1+B2) 5580 GOTO 5630 5590 A4=A2*A2 5600 Bl=C(24)*A2+C(25)*A4+C(26)*A2*A4 5610 B2=C(27)*A4*A4+C(28)*A4*A4*A2+C(29)*A4*A4*A4 5620 AI=1+Bl+B2 5630 RETURN 7000 REM === Input section === 7010 PRINT"Bessel function of the first or second kind?" 7020 Z$="1Ff2Ss":GOSUB 9800 7030 IF ZX<4 THEN PRINT"First kind" ELSE PRINT"Second kind" 7040 PRINT"Enter a negative number to end." 7050 INPUT"RB =";RB 7060 RETURN 7250 REM === Video output section === 7260 IF ZX>3 THEN 7300 7270 PRINT"I(";RB;") ="i:PRINT USING Gl;Al 7280 GOTO 7310 7300 PRINT"K("iRBi") ="i:PRINT USING GliAK 7310 RETURN 8800 REM === Read constants === 8810 FOR 1=1 TO 30:READ C(I):NEXT I 8820 Gl="##.###AAAA" 8830 RETURN 8840 DATA -.57721566,.4227842,.23069756,.0348859,.00262698,1.075E-4, 7.4E-6,1.253314,-.07832358,.02i89568
1.11
1.12
Functions
8850 DATA -.01062446,5.87872E-3,-2.5154E-3,5.3208E-4,.39894228,.01328592, 2.25319E-3,-1.57565E-3,9.16281E-3,-.02057706 8860 DATA .02635537,-.01647633,3.92377E-3,3.5156229,3.0899424,1.2067492, .2659732,.0360768,4.5813E-3 8870 DATA 3.75 9800 REM -- Await valid key -9810 ZZ$=INKEY$ 9820 ZZ$=INKEY$:IF ZZ$="" THEN 9820 9830 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN 9840 NEXT ZX 9850 GOTO 9820 9999 END 7.3.
*....
The Leaky Well Function, Program LEAKFUNC
1 REM LEAKFUNC/BAS ••••• 2 REM • Last modified 2/9/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40),C1(15),C2(15) 40 CLS 50 PRINT"Evaluation of the the leaky confined aquifer function." 70 PRINT"Loading variables, please wait." 80 PRINT 90 GOSUB 8600:REM # WELLFUNC constants. 100 GOSUB 8800:REM # All other constants 200 REM === Program control === 210 GOSUB 7000:REM # Input section. 240 IF RB<=O THEN 9999:REM # End. 250 IF U1<=0 THEN GOSUB 9000:GOTO 210:REM Invalid input 280 GOSUB 5000:REM # Leaky confined function 290 GOSUB 7250:REM # Video output section. 300 PRINT 310 GOTO 200 2500 REM == Subroutine W(u) == 2510 U2=U*U:U3=U*U2:IF U<1 THEN 2540 2520 W=1/(U*EXP(U».(C6+C7.U+U2)/(C8+C9.U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1.U+C2*U2+C3.U3+C4.U2.U2+C5.U2.U3 2550 RETURN 5000 REM === Group of subroutines for function W(u,RB) _ 5010 REM -- Controlling subroutine 5020 IF U1>=1 THEN 5050 5030 IF RB.RB>U1 THEN 5070 5040 GOTO 5100 5050 GOSUB 5190:REM Leaky # 5060 w1=HJ:GOTO 5180
Functions 5070 5080 5090 5100 5110 5120 5130 5140 5150 5160 5170 5180 5190 5200 5210 5220 5230 5240 5250 5260 5270 5280 5290 5300 5310 5400 5410 5420 5430 5440 5450 5460 5470 5480 5490 5500 5510 5520 5530 5540 5550 5560
5570 5580 5590
GOSUB 5190:REM Leaky H 1 GOSUB 5400:REM Bessel, 2 W1=2*AKH-HJ:GOTO 5180 GOSUB 5400:REM Bessel, 2 GOSUB 5530:REM Bessel, 1 GOSUB 5640:REM Leaky H 2 H1=RB*RB*C(31)/U1 U=H1:GOSUB 2500:REM Subroutine W(u) HA=W U=U1:GOSUB 2500:HC=W:REM Subroutine W(u) W1=2*AKH-AIH*HA+EXP(-H1)*(C(32)+LOG(U1)+HC-U1+U1*(AI# - 1)1 (RB*RB*C(31»)-U1*U1*HK) RETURN REM -- Subroutine Leaky # 1 -B=RB*RB:HP=O:HJ=O 1=1 IF U1<1 THEN 5250 A=1/(U1+C1(I»:HO=A*EXP(-(U1+B*A*C(31)+C1(I») IF HO<=O THEN 5310 ELSE 5280 HN=C(31)*RB*RB*(1/U1):A=1/(HN+C1(I» HO=A*EXP(-(HN+B*A*C(31)+C1(I»):H2=HO IF H2<=0 THEN 5310 HP=HP+HO*C2(I) I=I+1:IF 1<16 THEN 5220 HJ=HP RETURN REM -- Modified Bessel, second kind, zero order -IF RB>2 THEN 5480 TJ=RB/2:GOSUB 5530:REM Bessel, A2=TJ*TJ:A4=A2*A2 B1#=C(1)+C(2)*A2+C(3)*A4+C(4)*A2*A4+C(5)*A4*A4 B2#=C(6)*A4*A4*A2+C(7)*A4*A4*A4 AK#=-LOG(TJ)*AI#+B1#+B2# GOTO 5520 TN=2/RB:A2=TN*TN:A3=TN*A2 B1#=C(8)+C(9)*TN+C(10)*A2+C(11)*A3 B2#=C(12)*A2*A2+C(13)*A2*A3+C(14)*A3*A3 AK#=1/SQR(RB)*EXP(-RB)*(B1#+B2#) RETURN REM -- Modified Bessel, first kind, zero order -TF=RB/C(30):A2=TF*TF:IF RB<=C(30) THEN 5590 ELSE A3=A2*TF B1#=C(15)+C(16)*(1/TF)+C(17)*(1/A2)+C(18)*(1/A3)+C(19)*(1/(A2*A2» B2#=C(20)*(1/(A2*A3»+C(21)*(1/(A3*A3»+C(22)*(1/(A3*A 2*A2» +C(23)*(1/(A3*A3*A2» AI#=1/SQR(RB)*EXP(RB)*(B1#+B2#) GOTO 5630 A4=A2*A2
1.13
1.14 5600 5610 5620 5630 5640 5650 5660 5670 5680 5690 5700 5710 5720 5730 5740 5750 5760 7000 7010 7020 7030 7040 7050 7060 7080 7250 7260 7310 8600 8610 8620 8630 8650 8800 8810 8840 8850 8860 8870 8880 8890 8900 8910 8920
Functions B1#=C(24)*A2+C(25)*A4+C(26)*A2*A4 B2#=C(27)*A4*A4+C(28)*A4*A4*A2+C(29)*A4*A4*A4 AI#:1+B1#+B2# RETURN REM -- Subroutine Leaky # 2 -HK=0:HI=RB*RB*C(31) FOR J=1 TO 5:FOR K=1 TO J H6=J-K+1:H9=J+2:GOSUB 5730:BF=H3 H9=Hb:GOSUB 5730:AF=H3 HG=-1'"(J+K)*AF/(BF*BF)*HIK*U1"(J-K) HK=HK+HG:IF HG<1E-08 THEN K=J:J=5:GOTO 5720 NEXT K:NEXT J RETURN REM -- Subroutine Leaky # 3 -H3=1:IF H9=1 THEN 5760 FOR 1=2 TO H9:H3=H3*I:NEXT I RETURN REM === Input section === PRINT"Leaky confined aquifer function." PRINT"Enter a negative value for RB to end." PRINT"u must be >0" INPUT"RB =";RB IF RB
Functions 8930 8940 8950 8960 8970 9000 9010 9020 9999
FOR 1=1 TO 15:READ C2(I):NEXT I DATA .23957817,.56010084,.88700826,1.2236644,1.5744487 DATA 1.9447519,2.341502,2.7740419,3.2556433,3.8063117 DATA 4.4584777,5.2700177,6.3595634,8.0317876,11.527772 RETURN REM === Invalid input === PRINT"Invalid input, please check instructions and re-enter." RETURN END 7.4.
The Factorial function, program FACT
REM ••••• FACT/BAS ••••• 2 REM • Last modified 1/8/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 CLS 40 REM -- Preliminary print statements -50 PRINT" Evaluation of factorials by Stirlings approximation." 80 GOSUB 8660:REM • Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM • Input section 220 IF X
1.15
1.16
Functions
7.5. The Gaussian Error Function. program COMPERF With the Complimentary Error Function. 1 REM ••••• COMPERF/BAS ••••• 2 REM • Last modified 18/7/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 CLS ~O REM -- Preliminary print statements -50 PRINT" Evaluation of Gausian error function and complimentary" 60 PRINT"error function." 80 GOSUB 8660 :REM # Assign values to variables. 200 REM === Program control --210 GOSUB 7000 :REM # Input section 220 IF X1.5 THEN 3220 3150 ES=X:E~=X:I=O 3160 I=I+1:E3=ES:E~=2.E~.X2/(1+2.I):ES=E4+E3 3170 IF E~>TL.ES THEN 3160 3180 EF=2.ES.EXP(-X2)/PR:EC=1-EF 3190 RETURN 3200 EF=0:EC=1 3210 RETURN 3220 REM -- Complimentary error function -3230 E5=12:E1=.5/X2:E2=1+E1.(E5+1) 32~0 FOR J=E5 TO 1 STEP -1 3250 ES=1+J.E1/E2:E2=ES 3260 NEXT J 3270 EC=EXP(-X2)/(X·ES.PR):EF=1-EC 3280 RETURN 7000 REM === Input section === 7010 PRINT"Enter a negative number to end." 7020 PRINT:INPUT"Enter X"jX 7030 RETURN 7250 REM === Video output section _ 7260 PRINT"X ="jXj", Erf ="j:PRINT USING G1jEFj:PRINT", Erfc ="j:PRINT USING G1 jEC 7270 RETURN 8660 REM === Load constants _ 8670 PR=SQR(3.1415927#):TL=.00001 8680 G1="##.###AftAft,, 8690 RETURN 9999 END
Drawdown 2.1 Chapter 2
In this chapter we will use some of the programs described in the first chapter as SUbroutines in solutions of a few practical groundwater problems. We will start with a simple case and work toward some that are a little more complex. 1. DRAWDOWN IN A CONFINED AQUIFER 1.1. A simple confined aquifer, program CONFDD This program applies WELLFUNC, developed last chapter, in a solution of the Theis equation. In operation it is very similar to it's predecessor. The well function remains as by far the most complex of the equations solved, but a preliminary equation is used to evaluate Uj u
=--4Tt
(2.1)
where r is the distance from the diSCharging well to the piezometer (ie. the point for Which the drawdown is required). S is storage coefficient. T is transmissivity. and t is time. Any consistent set of units may be used, I suggest metres and days, r will then be in metres, T in cubic metres per day per metre, and t in days. Q below will be in cubic metres per day, and s is in metres. After solving for W(u), the well function of u, using the polynomial approximation described in chapter one, a third equation produces a value for aquifer drawdown at the piezometer. s =
Q W(u)
(2.2)
4 Pi T
where s is the drawdown. The use of these equations is more fully described in most general groundwater texts, and by Bouwer (1987) on page 73. Figure 2.1 shows a schematic representation of the groundwater system that this solution is applicable to. The wells are assumed to have negligible diameter, and therefore negligible storage. The discharge rate is constant for the Whole of the time since pumping began. The aquifer is both homogeneous and isotropic. The calculated drawdown is that in the piezometer, not that in the pumping well. (Drawdown in the pumping well will be dealt with later in this chapter.) A special feature of the program is the handling of excessively high values of u. If u i8 much greater than 80 when the subroutine W(u) is called, then an error will occur due to the number generated by the natural exponent function in line 2520 being too large for storage in a single
2.2
Drawdown figure
21
discharging well piezometer t-------~--~~~~~~~~~~_j
_ori~no!"yie~m~rlc~urface_
t~
_
_---=,..r-----
?
o ra'N~---------------»>: aquiclude
aquder
------- r
-----------+j
precision variable. Line 240 avoids this problem by setting the drawdown equal to zero, and causing execution to jump straight to the video output subroutine call. The value of u can easily exceed 80, especially with large values of R. For example, if R=1000m, CS=0.001, T=20 metres squared per day, and TI=0.1 days, then u=125. Note from the equation on line 2520 (equation 1.3 in chapter 1) that W(u) approaches zero very closely as u increases beyond about 10. Equation 2.2 shows that drawdown is proportional to W(u) and consequently very small W(u) results in very small drawdown. 1.2. Program verification To check that there are no typographical errors in the program once you have it in your computer, try entering the values of R=20m, CS=O.001, T=100 metres squared per day, TI=1 day, and Q=100 cubic metres per day. These inputs should give a resultant value of DD=O.504m. (The meanings of these variable names are shown below). 1.3. Usage of variables in program CONFDD All the variables used in program WELLFUNC are used in this program for the same purpose. There are six new variables in this program, most of which hold data entered by the user. CS is the storage coefficient. DD is given the output, the calculated drawdown. holds the constant, Pi. PI
Drawdown Q
R T TI
2.3
contains the discharge rate. Note that Q can have a negative value if there is recharge rather than discharge. This will result in a negative drawdown being calculated. has the distance between the discharge well and the observation point. is the aquifer transmissivity. is the time since commencement of discharge/recharge.
2. DRAWDOWN IN A LEAKY CONFINED AQUIFER 2.1. A leaky confined aquifer. program LEAKDD This program assumes that the aquifer is overlain by an aquitard with no storage, and this is itself overlain by an unconfined aquifer with infinite storage. In all other respects, the above comments concerning CONFDD also apply to this program. Just as program CONFDD was a development of WELLFUNC, so this is a development of LEAKFUNC, with some of the features of CONFDD. Figure 2.2 is a schematic diagram of the situation covered by this program.
figure
I piezometric su rlace
-
-
-
-
-
22
-
-
-
-
unconfined aquifer leakage aquitard ---~---------jl
,l.
,l.
'"
,l.
aquifer
Impermeable
It is assumed that the water table in the unconfined aquifer coincides with the piezometric surface before discharge commences. The Leaky Well Function requires that the water table remains at the same level during the whole of the period over which discharge takes place, ie. the specific yield of the unconfined aquifer is taken as infinite. This latter condition is plainly never fulfilled, but in practice will often be found to give satisfactory results. Typically the storage coefficie~t of a confined aquifer
2.4
Drawdown
will be about three or even more orders of magnitude smaller than the specific yield of an unconfined aquifer, so drawdown in the unconfined aquifer is very often negligible, except for a discharge continuing o~er a very long time. Here is another place for the application of seat of the pants emp~r~c~sm. Equations 2.1 and 2.2 are used to calculate the values of u and s as in the program CONFDD, described above, with the exception that the Leaky Artesian Well Function, W(u,RB), replaces the Well Function, W(u). The keyboard input section is almost identical to it's counterpart in CONFDD, with the addition of two statements which collect data on the aquitard. Line 3010 in program CONFDD calculated only u, in this program it also calculates RB. (There are two uses to which the variable u, as used in the text books, has been put, W(u), and W(u,RB). In these programs, u as in W{u) is represented by the variable U, and u as in W(u,RB) is represented by the variable U1.) The calculation of the drawdown on line 3040 is different only in that the value of the Leaky Artesian Well Function, variable W1, is used rather than the value of the Well Function, W. 2.2. Program verification Trial values of; Distance of the observation point from the discharging well, R=20m. Coefficient of storage, CS=0.001. Transmissivity, T=100 metres squared per day. Time, TI=1 day. Discharge rate, Q=100 cubic meters per day. Hydraulic conductivity of the aquitard in the vertical direction, VK=0.00001 metres per day. Thickness of aquitard, TB=10m; should give a resultant value of drawdown (DD) equal to 0.504m as in the example given above for the confined aquifer, because leakage is negligible. Changing VK to 0.005 should give a drawdown of DD=0.469m. 2.3. Usage of variables in program LEAKDD All the variables used in LEAKFUNC are used for the same purpose in this program. There are some additional variables, most of which hold data entered by the user. CS is coefficient of storage. DD is given the output value, the calculated drawdown. holds the constant Pi. PI Q has the discharge/recharge rate. R has the distance between the discharging well and the observation point. T is the aquifer transmissivity. TB is the thickness of the aquitard. TI is the elapsed time from commencement of discharge. VK is the vertical hydraulic conductivity of the aquitard.
Drawdown
2.5
3. DRAWDOI-]lJ IN AN AQUIFER BOUNDED ON ONE SIDE 3.1. A confined aqui fer, program CONFBOUN This program is similar to the next one to be described, LEAKBOUN. Program LEAKBOUN could be used for a non leaky confined aquifer by keeping the transmissivity of the aquitard to a negligible level, but the program is much larger and slower than it needs to be for handling the relatively simple confined aquifer case. The reader will find a number of cases in this book where a larger, more complex program, can do not only the job it was designed to do, but also the job of some simpler program given previously. The more simple and limited progr'ams are given in the belief that it is best to use the simplest method available to solve a problem, when there is no functional advantage in using a more complex method. 3.2. Treatment of boundaries For the sake of modelling a groundwater system, an aquifer boundary is usually represented as a straight line across which there is no flow. (See Freeze & Cherry, 1979, or Ferris et al., 1962.) An example of such a discharge boundary is a straight line contact with a water tight geological formation. A recharge boundary may be a fully penetrating stream. These concepts are covered in most general groundwater texts. Freeze and Cherry (1979) describe them on page 330 and 331. The effect of an aquifer boundary on the piezometric surface of the aquifer can be represented by an image well at twice the distance from the discharging well. A recharge boundary is represented by a recharging image well, and a discharge boundary by a discharging image well. The drawdown calculated for the (real) discharging well is summed with that of the image well. Figure 2.3 (page 2.6) illustrates this technique. Figure 2.3A shows a discharging well close to an impermeable boundary. Figure 2.3B shows a discharging well close to a fully penetrating stream. Figures 2.3C and 2.3D show how the situations in 2.3A and 2.3B can be modelled using image wells; the same piezometric surface can be produced by a quite different cause. In figure 2.3C the drawdowns from both real and image well are summed at each point, while in figure 2.3D the drawdown due to the real well is summed with the negative drawdown (drawup?) of the image well. Figures 2.3E and 2.3F show the situation in plan with a piezometer. In these figures, r is the distance used to calculate the drawdown due to the real well, while r is i used to calculate the drawdown due to the image well. 3.3. Calculation of the distance of the image well (from the observation well.) Known are: 1/ The distance between discharging and observation well; in the programs this is held in the variable R. 2/ The distance from the discharge well to the boundary; R1. 3/ The distance from the observation well to the boundary; R2. See figur(' 2.4.
2.6
Drawdown
Figure 2.3
A
B
r. Q -
-
~Q .!Q
-
5
tream
-
aquiclude
tl
aquifer
x
impermeable I---X
0
C rQ
rQ -
-- --
,0
Q
r:
to-
.!9 tl
tl
x
X
X
X
F
E p
p r.
.s: ~
/~w
B
r:
~
I
/~w
wLx
I
8
Drawdown
2.7
Figure 2.4 +t\- - - - - _~------R1- - - ----~~----- - - - b - - - - - - , , - - -R1 - ----------4 R2'----->4+-- R1- R2----..,;>i i~-~~ CT
o
~
well
dischorge
C
well
::J
0.
o...,
-.
--<
R4
R3
R
piezometer
Distance R3 can be calculated by; R3 =
~2
_ (R1 _ R2)2
(Pythagoras)
which is on line 3310 of the program, and the required distance, R4, can be calculated by; (Pythagoras)
(2.4)
on line 3320. Use of flags The program uses several flags to keep track of progress through various stages of the ca.l cul at Lons . Flag F1 has a value of zero while the drawdown due to the discharging well is being considered, a value of one for the image well, and two for the summed drawdown of both wells. This has allowed the same subroutine to be called for all video output. Flag F2 equals zero if the boundary is a discharge boundary, otherwise it is set to one. The decision to add or subtract the image well drawdown component from the discharge well component is taken according to the setting of this flag.
2.8
Drawdown
General The subroutine that calculates the value of u (which is in turn used to calculate the well function) requires a value in the variable R. Since R is used to record the distance between the two real wells, (the piezometer and the discharging well) it's value is saved in R5 so that R can be used to pass the distance between the observation well and the image well to the subroutine. After the subroutine call, the original value is restored to R. 3.4. Usage of variables in program CONFBOUN is used to hold the drawdown due to the discharge well while the drawdown due to the image well is calculated. F1 is an integer flag set to zero for calculation of the drawdown due to the disoharge well, and to one for the image well. F2 is set to zero for a discharge boundary, and to one for a recharge boundary. Z$, ZX, and ZZ$ are used for the single key program flow control. Other variables are as used in the program CONFDD.
DE
3.5. Program verification Enter trial inputs below during a run of the program. Distance of observation point from discharging well, R=100m. Coefficient of storage, CS=O.0004. Transmissivity, T=75 metres squared per day. Time since commencement of discharge, TI=O.5 days. Discharge rate, Q=200 cubic metres per day. Distance from the discharging well to the boundary, R1=50m. Distance from observation well to the boundary, R2=105m. If a discharge boundary is specified, the following output should be produced. Drawdown due to discharging well, O.652m. Drawdown due to image well, O.424m. This gives a combined drawdown of 1.08m. The distance from the observation well to the image well should be calculated as 176m. 4. DRAWDOWN IN A LEAKY CONFINED, BOUNDED, AQUIFER 4.1. A leaky confined, bounded. aqUifer; program LEAKBOUN Similar assumptions apply here as in LEAKDD, ie. the overlying aquitard has no storage, and the unconfined aquifer has infinite storage. The difference in this program is that the aquifer is bounded on one side with either a discharge (impermeable) or recharge (constant head) boundary. This program requires all the input of program LEAKDD, and also the distances of both discharge well and observation well from the boundary.
Drawdown
2.9
4.2. Program verification Run the program. and enter the following data. Distance of observation poi.nt from discharging well. R=50m. Coefficient of storage. CS=0.001. Transmissivity. T=75 metres squared per day. Time since commencement of discharge. TI=1 day. Discharge rate. Q=200 cubic metres per day. Vertical hydraulic conductivity of aquitard. VK=0.03 metres per day. Thickness of aquitard. TB=10m. Distance from the discharging well to the boundary, R1=15m. Distance from observation well to the boundary, R2=45m. If a discharge boundary is specified, the output bellow should result. Drawdown due to discharging well, 0.559m. Drawdown due to image well, 0.422mj giving a combined drawdown of 0.982m. The distance from the observation well to the image well should be calculated as 72.1m. 4.3. Usage of variables in program LEAKBOUN All variables used in LEAKDD are used for the same purpose in this program, with the addition of variables DE, F1, F2. Z$, ZX, and ZZ$, which have the same purpose in this program as in program CONFBOUN above. 5. A STRIP AQUIFER. 5.1. The distances to the image wells, program STRIPCAL This was developed to serve as a subroutine in the next major program, LEAKSTRP. It calculates the distance from an observation well to image wells out to a specified distance on each side of a strip aquifer. The entered maximum distance is speeified by the user, but because of the nature of the algorithm, image wells some limited distance beyond the specified maximum might be calculated. The treatment of a strip aquifer is similar to the treatment of an aquifer with a single boundary except that not only are there image wells on both sides, as may be intuitively expected, but additional image wells go on to infinity. See figure 2.5. The infinite succession of image wells is due to mUltiple reflections from the two parallel aquifer boundaries. Of course eaeh image is further away than the one before, and so will have less effect on the observation well. The concept can be likened to the forever repeating, forever diminishing. reflections of oneself in a hall of mirrors. In figure 2.5 reflections of boundaries and reflections of the discharging well in these boundary images are shown. Thus the boundary labelled 'iab' is the image of boundary b reflected in the plane of boundary a, 'iaba' is the image of boundary a reflected in the planes of both a and b, etc. The distances of the image wells from the piezometer. as calculated by the program, are shown in the figure. The image well at 85 metres from the piezometer is the discharging well reflected in both boundaries a and b.
2.10
Drawdown
Figure 2.5 30m ------+
101m
85m
-9----
51m
21m
63m
<,
<, CT
<,
0
<,
c
\ ~ ~
::1
a. 0.,
--< 0
ibab
ibo
iab
iabo
oquuer
5.2. Program verification The program may be checked by simulating the situation of figure 2.5. Enter data as below. Distance between observation and discharge well, 45m. Distance from discharge well to boundary, 9m. Distance from observation well to same boundary, 23m. Width of strip aquifer, 30m. Width of area of interest, 150m. Image wells will be calculated at the distances shown. Some further comments on the operation of this program are given in the notes on program CONFSTRP, below.
AA D1
D2
DR
5.3. Usage of variables in program STRIPCAL holds the width of the area of interest. is the third term in the function giving the component in the direction across the strip aquifer, of the distance from the observation point to the current image well. Flag FT is toggled at every calculation so that D1 equals R1 and minus R1 alternately. The first term in the above equation. Flag F3 is used to set D2 to equal R2 for calculation of the distances of image wells on the first side of the aquifer, and equal to minus R2 for the second side. contains the number of strip widths required in the equation to calculate the distance to the next image well.
Drawdown F3 FT
R R1 R2 R3
R4 R6
2.11
is a flag which has the value zero when the first side of the aquifer is being considered, and the value one for the second side. is a flag which is toggled to the values one and zero (on and off) for alternate calculations. Decisions on incrementing DR and the sign of D2 are based on this flag. is the distance between the observation point and the discharging well. is the distance from the discharging well to a boundary. is the distance from the observation well (or point) to the same boundary. is the component in the direction along the strip, of the distance between the observation point and the discharging well, and hence also between the observation point and all the image wells. See figure 2.5. is the calculated distance to the current image well. is the width of the strip aquifer.
5.4. The algorithm Using the variables listed above, the distances of the image wells on the first side of the aquifer are calculat~d by ~he series; the square root of [(R2+0*R6+R1) + R3 ], 2 2 " " " " [(R2+2*R6-R1) + R3 ] 2 2 ' " " " " [(R2+2*R6+R1)2 + R3 2], " " "[(R2+4*R6-R1) + R3 ], The second side uses the series; 2 2 the square root of [ (-R2+2*R6-R1) + R3 ], 2 " " " [(-R2+2*R6+R1)2 + R32 ], " " " " [(-R2+4*R6-R1)2 + R3 ],
6. DRAWDOWN IN A STRIP AQUIFER 6.1. A confined strip aquifer, program CONFSTRP This applies the algorithm for calculating the distances of image wells used in the program STRIPCAL, with the calculation of drawdown in a bounded confined aquifer of CONFDD. The first parts of the program are very similar to the previous programs, the standards for layout adopted at the beginning are followed, as they are also, as far as possible, in the whole of the program. The program control section starts similarly to CONFBOUN and LEAKBOUN, but a loop has been added into the part that handles the image well. The distance to the first image well is calculated by the subroutine call from line 360, then program execution moves down through other operations to line 490 where it is directed back to line 360 for the next image well. While the image wells in a strip aquifer go on for ever, it is impossible to calculate the drawdown due to an infinite number of wells. So one must somehow decide when sufficient have been considered for acceptable accuracy. There are image wells on both sides of the aquifer, so there are
2.12
Drawdown
two relevant program lines. The first of these to come into action is 450, because flag F3 starts at the default value of zero, and therefore the conditional statement of line 440 must fail. In line 450 the drawdown calculated for the current image well, DD, is compared to the accumulated drawdown from all previous wells, DE. It is supposed that sufficient observation wells have been considered when the newly calculated drawdown is less than one ten thousandth of the accumulated drawdown. (This is controlled by the value of variable TL, which is defined in line 8640). Line 450 then sets flag F3 to indicate that the second side of the aquifer is now to be considered. Counter DR is reset to zero because the image well adjacent to the aquifer is to be considered first, and flag FT is set to one so that counter DR will be given the correct value of two in line 3340, ready for calculating the drawdown on line 3380. With a fast computer (clock speed greater than about 2M Hz), the printout of the drawdown due to each image well will be so fast as to be difficult to read. There are at least two cures for this problem. A delaying loop could be placed in a new line, number 425; it might read as follows. "425 FOR 1=1 TO 4000:NEXT I". Alternatively, some of the printout could be suppressed. This could most simply be done by inserting the key word REM at the beginning of both lines 7280 and 7290. 6.2. Program verification The following data may be entered on the program prompts to check that the program is operating correctly. Enter; Distance of observation point from discharging well, R=40m. Coefficient of storage, CS=0.0003. Transmissivity, T=150 metres squared per day. Time since commencement of discharge, TI=O.2 days. Discharge rate, Q=300 cubic metres per day. Distance from the discharging well to the boundary, R1=50m. Distance from observation well to the same boundary, R2=70m. Width of aquifer, 150m; should give an output of O.788m drawdown due to discharging well, and with the combined effects of all the image wells, the total drawdown is 2.21m. 6.3. Usage of variables in program CONFSTRP As the job done by this program is a combination of the functions of CONFBOUN and STRIPCAL, so the program variables are the same as used in those programs. The variable AA of STRIPCAL is not used here beoause it is the amount of calculated drawdown that is used to end the image wells, rather than the fixed distance in metres. The flag F2 of program CONFBOUN is not required because an aquifer bounded by two parallel recharge boundaries is not likely to occur in nature. (It can be simulated rather easily, but care does need to be taken in considering with each new image well whether a positive or negative discharge is required. In fact, the sign of the discharge alternates with each new iteration.) The variables Z$, ZI, and ZZ$
Drawdown
2.13
of CONFBOUN are not needed because there is no place for single key input. 7. DRAWDOWN IN A LEAKY CONFINED STRIP AQUIFER 7.1. Program LEAKSTRI~ It should not be necessary to describe this program in any detail, because it is no more than CONFSTRP with LEAKBOUN taking the part previously played by CONFBOUN. In addition to the data entries required in CONFSTRP, the vertical leakage coefficient, and the thickness of the aquitard are input. Where the well function is solved in CONFSTRP, the leaky artesian well function is solved in LEAKSTRP. 7.2. Program verification The following data may be used to confirm correct program operation. Distance of obser-vat.Lon point from discharging well, R=25m. Coefficient of storage, CS=0.0006. Transmissivity, T=130 metres squared per day. Time since commencement of discharge, TI=2.5 days. Discharge rate, Q=1000 cubic metres per day. Vertical hydraulic conductivity of aquitard, 0.02 metres per day. Thickness of aquitard, 10m. Distance from the diseharging well to the boundary, Rl=60m. Distance from observation well to the same boundary, R2=84m. Width of aquifer, '120m; should give an output of 3.00m drawdown due to discharging well, and with the combined effects of all the image wells, the total drawdown is 7.92m. 8. REFERENCES Groundwater Hydrology, 480 pp. McGraw-Hill Kogakusha, Bouwer, H., (1978). Ltd. Cobb, P.M., McElwee, C.D., and Butt, M.A., 1982. An Automated Numerical Evaluation of Leaky Aquifer Pumping Test Data etc. Groundwater series 6, Kansas Geo. Surv. Ferris, J.G., Knowles, !LB., Browne, R.H., & Stallman, R.W., 1962. Theory of aquifer tests. U.S. Geol. Surv. Water-Supply Paper 1536-E. Freeze, R.A., and Cherry, J.A., 1979. Groundwater. Prentice-Hall Inc., New Jersey, USA. pp604. 9. 9.1.
PROGRAM LISTINGS. Drawdown in a simple confined aquifer. program CONFDD
REM ••••• CONFDD/BAS ••••• 2 REM • Last modified 25 Feb, 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S
2. 14 Drawdown 30 CLS 40 REM -- Preliminary print statements -50 PRINT" Calculation of drawdown in a piezometer at a given" 60 PRINT"distance from a discharging well in a confined aquifer." 80 GOSUB 8600 :REM # Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM # Input section 220 IF R<=O THEN 9999 230 GOSUB 3000:REM # Calculate u 240 IF u>80 THEN GOSUB 903q:DD=0:GOTO 270:REM # Excessive u 250 GOSUB 2500:REM H Solve for W(u) 260 GOSUB 3030:REM # Calculate drawdown 270 GOSUB 7250:REM # Video output section 280 GOTO 200 2500 REM == Subroutine W(u) == 2510 U2=U.U:U3=U*U2:IF U<1 THEN 2540 2520 W=1/(U.EXP(U».(C6+C7.U+U2)/(C8+C9.U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1.U+C2.U2+C3.U3+C4.U2.U2+C5.U2.U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U=R.R.CS/(4*T.TI) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q.W/(4.PI.T) 3050 RETURN 7000 REM === Input section --7010 PRINT 7020 PRINT"Please enter all figures in consistant units." 7030 PRINT"Enter a negative distance to end." 7040 PRINT 7050 PRINT"Distance of observation point from discharging" 7060 INPUT" well"jR 7070 IF R<=O THEN 7120 7080 INPUT"Storage coefficient"jCS 7090 INPUT" TransmissivitY"jT 7100 INPUT" Time" jTI Discharge rate"jQ 7110 INPUT" 7120 RETURN 7250 REM === Video output section --7260 PRINT 7270 PRINT" The drawdown at the given distance, time, and discharge rate" 7280 PRINT"is "jDO 7290 RETURN 8600 REM === Assign values to variables === 8610 CO=-.57721566#:C1=.99999193#:C2=-.24991055#:C3=5.519968E-02 8620 C4=-9.76004E-03:C5=1.07857E-03 8630 C6=.2
Drawdown 8680 G1="##.###AAAA":PI=3.1415927# 8690 RETURN 9999 END 9.2.
A leaky confined aquifer, program LEAKDD
1 REM ••••• LEAKDD.BAS ••••• 2 REM • Last modified 30/8/85 10 REM === Initialization :== 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40) ,C1(15) ,C2(15) 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a leaky confined aquifer." 70 PRINT"Storage in the aquitard is neglected." 80 PRINT" Loading variables, please wait." 90 GOSUB 8600:REM # Assign values to variables. 100 GOSUB 8800:REM # All other constants 200 REM === Program control === 210 GOSUB 7000:REM # Input section 220 IF R<=O THEN 9999 230 GOSUB 3000:REM # Calculate u, RB 240 IF U1>80 THEN GOSUB 9030:DD=0:GOTO 270:REM # Excessive u 250 GOSUB 5000:REM # Solve for W(u,rb) 260 GOSUB 3030:REM # Calculate drawdown 210 GOSUB 7250:REM # Video output section 280 GOTO 200 2500 REM == Subroutine W(u) == 2510 2520 2530 These lines are identical to those in CONFDD. 2540 2550 3000 REM === Calculation of u given R, S, T, & TI --3010 U1=R'R'CS/(4'T'TI):RB=R/SQR(T/(VK/TB») 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q'W1/(4'PI'T) 3050 RETURN 5000 REM === Group of subroutines for function W(u,RB) --5010 REM -- Controlling subroutine 5020 IF U1>=1 THEN 5050 5030 IF RB'RB>U1 THEN 5010 5040 GOTO 5100 5050 GOSUB 5190:REM Leaky # 5060 Wl=HJ:GOTO 5180 5010 GOSUB 5190:REM Leaky #
2.15
2.16 5080 5090 5100 5110 5120 5130 5140 5150 5160 5170 5180 5190 5200 5210 5220 5230 5240 5250 5260 5270 5280 5290 5300 5400 5410 5420 5430 5440 5450 5460 5470 5480 5490 5500 5510 5520 5530 5540 5550 5560 5570 5580 5590 5600 5610
Drawdown GOSUB 5400:REM Bessel, 2 Wl=2'AK#-HJ:GOTO 5180 GOSUB 5400:REM Bessel, 2 GOSUB 5530:REM Bessel, 1 GOSUB 5640:REM Leaky # 2 Hl=RB'RB'C(31)/Ul U=Hl:GOSUB 2500:REM Subroutine W(u) HA=W U=Ul:GOSUB 2500:HC=W:REM Subroutine W(u) Wl=2'AK#-AIO'HA+EXP(-H1)'(C(32)+LOG(U1)+HC-Ul+ Ul'«AI#-1)/(RB'RB'C(31»)-Ul'Ul'HK) RETURN REM -- Subroutine Leaky # 1 -B=RB'RB:HP=C:HJ=O 1=1 IF Ul2 THEN 5480 TJ=RB/2:GOSUB 5530:REM Bessel, A2=TJ'TJ:A4=A2'A2 Bl0=C(1)+C(2)'A2+C(3)'A4+C(4)'A2'A4+C(5)'A4'A4 B2#=C(6)'A4'A4'A2+C(7)'A4'A4'A4 AK#=-LOG(TJ)'AI#+Bl#+B2# GOTO 5520 TN=2/RB:A2=TN'TN:A3=TN'A2 Bl#=C(8)+C(9)'TN+C(10)'A2+C(11)'A3 B2#=C(12)'A2'A2+C(13)'A2'A3+C(14)'A3'A3 AK#=1/SQR(RB)'EXP(-RB)'(B10+B2#) RETURN REM -- Modified Bessel, first kind, zero order -TF=RB/C(30):A2=TF'TF:IF RB<=C(30) THEN 5590 ELSE A3=A2'TF Bl#=C(15)+C(16)'(1/TF)+C(17)'(1/A2)+C(18)'(1/A3)+C(19) ' ( 1/ (A2' A2» B2#=C(20)'(1/(A2'A3»+C(21)'(1/(A3'A3»+C(22)'(1/(A3'A2'A2» +C(23)'(1/(A3'A3'A2» AI#=1/SQR(RB)'EXP(RB)'(Bl0+B2#) GOTO 5630 A4=A2'A2 Bl#=C(24)'A2+C(25)'A4+C(26)'A2'A4 B2#=C(27)'A4'A4+C(28)'A4'A4'A2+C(29)'A4'A4'A4
Drawdown 5620 5630 5640 5650 5660 5670 5680 5690 5700 5720
2.17
AI#=1+B1#+B2# RETURN REM -- Subroutine Leaky , 2 -HK=0:HI=RB*RB*C(31) FOR J=1 TO 5:FOR K=1 TO J H6=J-K+1:H9=J+2:GOSUB 5730:BF=H3 H9=H6:GOSUB 5730:AF=H3 HG=-1~(J+K)*AF/(BF*BF)*HrK*Ul~(J-K)
HK=HK+HG:IF HG<1E-08 THEN K=J:J=5:GOTO 5720 5710 NEXT K:NEXT J RETURN REM -- Subroutine Leaky # 3 -H3=1:IF H9=1 THEN 5760 FOR 1=2 TO H9:H3=H3*I:NEXT I RETURN REM === Input section === PRINT PRINT"Please enter all figures in consistant units." PRINT"Enter a negative distance to end." PRINT PRINT"Distance of observation point from discharging" INPUT" well"jR IF R<=O THEN 7160 INPUT" Storage coefficient"jCS INPUT" TransmissivitY";T INPUT" Time" jTI INPUT" Discharge rate"jQ PRINT"Vertical hydraulic conductivity of" INPUT" aqua tard" jVK INPUT"Thickness of aquitard"jTB RETURN REM === Video output section _ PRINT PRINT" The drawdown at the given distance, time, and discharge rate" PRINT"is" j: PRINT USING Gl JDD RETURN REM === Assign values to variables ---
5730 5740 5750 5760 7000 7010 7020 7030 7040 7050 7060 7070 7080 7090 7100 7110 7130 7140 7150 7160 7250 7260 7270 7280 7290 8600 8610 8620 These lines are identical to those in CONFDD. 8630 8650 RETURN 8800 REM === Read constants === 8810 FOR 1=1 TO 32:READ C(I):NEXT I 8820 PI=3.1415927':Gl=""."-----" 8840 DATA -.57721566,.4227842,.23069756,.0348859,.00262698,1.075E-4, 7.4E-6,1.253314,-.07832358,.02189568 8850 DATA -.01062446,5.87872E-3,-2.5154E-3,5.3208E-4,.39894228, .01328592,2.25319E-3,-1.57565E-3,9.16281E-3,-.02057706
2.18
Drawdown
8860 DATA .02635537,-.01647633,3.92377E-3,3.5156229,3.0899424, 1.2067492,.2659732,.0360768,4.5813E-3 8870 DATA 3.75,.25,.5772 8880 REM -- Load C1(x) and C2(x) constants -8890 FOR 1=1 TO 15:READ C1(I):NEXT 8900 DATA .093307812,.49269174,1.2155954,2.2699495,3.6676227 8910 DATA 5.4253366,7.5659162,10.120228,13.130282,16.654407 8920 DATA 20.776478,25.623894,31.407519,38.530683,48.026085 8930 FOR 1=1 TO 15:READ C2(I):NEXT I 8940 DATA .23957817,.56010084,.88700826,1.2236644,1.5744487 8950 DATA 1.9447519,2.341502,2.7740419,3.2556433,3.8063117 8960 DATA 4.4584777,5.2700177,6.3595634,8.0317876,11.527772 8970 RETURN 9000 REM === Invalid input === 9010 PRINT"Inval1d input, please check instructions and re-enter." 9020 RETURN 9030 REM === Excessive u === 9040 PRINT"The value of u is >80, drawdown can be taken as zero." 9050 RETURN 9999 END 9.3. A bounded confined aquifer, program CONFBOUN The boundary may be either discharge or recharge. REM ••••• CONFBOUN/BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a confined aquifer." 80 PRINT"One discharge/recharge boundary is present." 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM # Assign values to variables. 200 REM === Program control === 210 F1=0:REM # Set flag for discharge well 220 GOSUB 7000:REM # Input section 230 IF R(=O THEN 9999 240 IF ABS(Rl-R2»R THEN GOSUB 9060:GOTO 200:REM # Distances wrong 250 REM -- Discharge well section -260 GOSUB 3000:REM # Calculate u 270 IF U>80 THEN GOSUB 9030:DD=0:GOTO 300:REM # Excessive u 280 GOSUB 2500:REM # Solve for W(u) 290 GOSUB 3030:REM # Calculate drawdown 300 GOSUB 7250:REM # Video output section 310 DE=DD 320 REM -- Image well section --
Drawdown 330 F1=1:REM # Set flag for image well 340 GOSUB 3300:REM # Calculate distance of image well 350 R5=R:R=R4:REM # Save R. send R4 to subroutine 360 GOSUB 3000:REM # Calculate u 370 IF U>80 THEN GOSUB 9030:DD=0:GOTO 390 380 GOSUB 2500:GOSUB 3030:REM # Calculate drawdown 390 GOSUB 7250:REM # Printout 400 R=R5:REM # Restore R 410 IF F2=0 THEN DD=DD+DE ELSE DD=DE-DD 420 F1=2:GOSUB 7250:REM # Final video output 430 GOTO 200 2500 REM == Subroutine W(u) == 2510 2520 2530 These lines are identical to those in CONFDD. 2540 2550 3000 REM === Calculation of u given R, S, T, & TI --3010 U=R*R*CS/(4*T*TI) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q*W/(4*PI*T) 3050 RETURN 3300 REM === Calculate distance to image well --3310 R3=SQR(R*R-(Rl-R2)*(R1-R2)) 3320 R4=SQR«R1+R2)*(Rl+R2)+R3*R3) 3330 RETURN 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consist ant units." 7020 PRINT"Enter a negative distance to end.":PRINT 7030 PRINT"Distance of observation point from discharging" 7040 INPUT" well"iR 7050 IF R<=O THEN 7240 7060 INPUT" Storage coefficient"iCS 7070 INPUT" Transmissivity" rr 7080 INPUT" Time"jTI 7090 INPUT" Discharge rate"jQ 7130 PRINT"Distance from discharge well to" 7140 INPUT" boundary" jR1 7150 PRINT"Distance from observation well to" 7160 INPUT" boundary" jR2 7170 PRINT"ischarge or echarge boundary'?" 7180 Z$="DdRr":GOSUB g800:REM # Single key input 7190 IF ZX<3 THEN F2=0 ELSE F2=1 7200 PRINT:PRINT"Working . • • • " 7240 RETURN 7250 REM === Video output section ---
2.19
2.20
Drawdown
7260 PRINT 7270 IF F1=0 THEN PRINT"Drawdown due to discharge well is "j:PRINT USING G1jDD 7280 IF F1=1 THEN PRINT"Distance of obs. well from image well is "jR4 7290 IF F1=1 THEN PRINT"Drawdown due to image well is "j:PRINT USING G1jDD 7300 IF F1 =2 THEN PRINT"Combined drawdown is "i: PRINT USING G1 JDD 7490 RETURN 8600 REM === Assign values to variables === 8610 8620 These lines are identical to those in CONFDD. 8630 8640 PI=3.1415927#:G1="##.#,····" 8650 RETURN 9030 REM -- Excessive u -9040 PRINT"The value of u is >80, drawdown can be taken as zero." 9050 RETURN 9060 REM -- Impossible combination of distances -9010 PRINT"There is an error in the entered distancesl" 9080 RETURN 9800 REM -- Await valid key -9810 ZZ$=INKEY$ 9820 ZZ$=INKEY$:IF ZZ$="" THEN 9820 9830 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN 9840 NEXT ZX 9850 GOTO 9820 9999 END 9.4.
A bounded leaky confined aquifer. program LEAKBOUN
REM ••••• LEAKBOUN/BAS ••••• 2 REM • Last modified 5th. Apr. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40),C1(15),C2(15) 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a leaky confined aquifer." 10 PRINT"Storage in the aquitard is neglected." 80 PRINT"One discharge/recharge boundary is present." 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM # Assign values to variables. 110 GOSUB 8800:REM , All other oonstants 200 REM === Program control === 210 F1=0:REM # Set flag for discharge well 220 GOSUB 1000:REM , Input seotion 2JO IF R<=O THEN 9999 240 IF ABS(R1-R2»R THEN GOSUB 9060:GOTO 200:REM U Distances wrong
Drawdown 250 REM -- Discharge well section -260 GOSUB 3000:REM n Calculate u, RB 270 IF U1>80 THEN GOSUB 9030:DD=0:GOTO 300:REM # Excessive u 280 GOSUB 5000:REM # Solve for W(u,rb) 290 GOSUB 3030:REM # Calculate drawdown 300 GOSUB 7250:REM n Video output section 310 DE=DD 320 REM -- Image well section -330 F1=1:REM n Set flag for image well 340 GOSUB 3300:REM # Calculate distance of image well 350 R5~R:R=R4:REM n Save R, send R4 to subroutine 360 GOSUB 3000:REM n Calculate u, RB 370 IF U1>80 THEN GOSUB 9030:DD=0:GOTO 390 380 GOSUB 500o:GOSUB 3030:REM n Calculate drawdown 390 GOSUB 7250:REM n Printout 400 R=R5:REM n Restore R 410 IF F2=0 THEN DD=DD+DE ELSE DD=DE-DD 420 F1=2:GOSUB 7250:REM n Final video output 430 GOTO 200 2500 REM == Subroutine W(u) == 2510 2520 2530 These lines are identical to those in CONFDD. 2540 2550 3000 REM === Calculation of u given R, S, T, & TI - __ 3010 U1=R*R*CS/(4*T*TI):RB=R/SQR(T/(VK/TB» 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q*Wl/(4*PI*T) 3050 RETURN 3300 REM === Calculate distance to image well === 3310 R3=SQR(R*R-(R1-R2)*(R1-R2» 3320 R4=SQR«R1+R2)*(R1+R2)+R3*R3) 3330 RETURN 5000 REM === Group of subroutines for function W(u,RB) === 5010 5020 These lines are identical to those of LEAKDD. 5750 5760 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistant units." 7020 PRINT"Enter a negative distance to end.":PRINT 7030 PRINT"Distance of observation point from discharging" 7040 INPUT" well"; R 7050 IF R(=O THEN 7240 7060 INPUT" Storage coefficient"jCS
2.21
2.22 Drawdown 7070 7080 7090 7100 7110 7120 7130 7140 7150 7160 7170 7180 7190 7200 7240 7250 7260 7270 7280 7290 7300 7490 8600 8610 8620 8630 8650 8800 8810 8820 8970 9000 9010 9020 9030 9040 9050 9060 9070 9080 9800 9810 9820 9850 9999
INPUT" TransmissivitY"iT INPUT" Time"iTI INPUT" Discharge rate"iQ PRINT"Vertical hydraulic conductivity of" INPUT" aquitard" i VK INPUT"Thickness of aquitard"iTB PRINT"Distance from discharge well to" INPUT" boundary" i R1 PRINT"Distance from observation well to" INPUT" boundarY"iR2 PRINT"ischarge or <~>echarge boundary?" Z$="DdRr":GOSUB 9800:REM I Single key input IF ZX<3 THEN F2=0 ELSE F2=1 PRINT:PRINT"Working • • • . " RETURN REM === Video output section --PRINT IF F1=0 THEN PRINT"Drawdown due to discharge well is "i:PRINT USING G1 iDD IF F1=1 THEN PRINT"Distance of obs. well from image well is niR4 IF F1=1 THEN PRINT"Drawdown due to image well is "i: PRINT USING G1 iDD IF F1=2 THEN PRINTnCombined drawdown is "i: PRINT USING G1 iDD RETURN REM === Assign values to variables === These lines are identical to those of CONFDD. RETURN REM --- Read constants === These lines are identical to those of LEAKDD. REM -- Invalid input PRINT"Invalid input, please check instructions and re-enter." RETURN REM -- Excessive u -PRINTnThe value of u is >80, drawdown can be taken as zero." RETURN REM -- Impossible combination of distances -PRINT"There is an error in the entered distancesl" RETURN REM -- Await valid key -These lines are identical to those of CONFBOUN. END
Drawdown 9.5.
The image wells in a strip aquifer, program STRIPCAL
REM ••••• STRIPCAL/BAS ••••• 2 REM • Last modified 1/8/85 10 CLS 20 PRINT"Calculation of distance to image wells for strip aquifer." 200 REM === Control section === 210 GOSUB 7000:REM # Input section 220 GOSUB 3300:REM # Distance component along aquifer. 230 GOSUB 3340:REM # Distance component accross aquifer. 240 GOSUB 7250:REM # Video output. 250 IF DR.R6>=AA/2 AND F3=1 THEN 9999 260 IF DR.R6>=AA/2 THEN FT=1:DR=0:F3=1 300 GOTO 230 3300 REM === Calculate distance to image well === 3310 R3=SQRCR·R-CR1-R2).CR1-R2» 3320 RETURN 3330 REM -- Second part --. 3340 IF FT=1 THEN DR=DR+2 3350 IF FT=1 THEN D1=-R1 ELSE D1=R1 3360 IF F3=O THEN D2=R2 ELSE D2=-R2 3370 IF FT=1 THEN FT=O ELSE FT=1 3380 R4=SQR(CD2+DR·R6+D1).CD2+DR.R6+D1)+R3.R3) 3390 RETURN 7000 REM === Input section === 7010 PRINT 7020 PRINT"Distance of observation point from discharging" 7030 INPUT" well"jR 7040 INPUT"Distance from discharge well to a boundary"jR1 7050 PRINT"Distance from observation well to the" 7060 INPUT" same boundary"jR2 7070 INPUT" Wid th of aquifer" jR6 7080 INPUT" Width of area of interest"jAA 7090 PRINT 7240 RETURN 7250 REM === Video output section === 7260 PRINT" Image well at R =" jR4j: IF F3=0 THEN PRINT TAB(34) j "First side" ELSE PRINT TAB(34)j"Second side" 7490 RETURN 9999 END 9.6.
A confined strip aquifer, program CONFSTRP
REM ••••• CONFSTRP/BAS ••••• 2 REM • Last modified 29/9/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40)
2.23
2.24 Drawdown 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a confined strip aquifer." 80 PRINT 90 PRINT" Loading variables, please wait." 100 GOSUB 8600 :REM , Assign values to variables. 200 REM === Program control === 210 F1=0:REM b Set flag for discharge well 220 GOSUB 7000:REM b Input section 230 IF R<=O THEN 9999 240 IF ABS(R1-R2»R THEN GOSUB 9060:GOTO 200:REM b Distances wrong 250 REM -- Discharge well section -260 GOSUB 3000:REM b Calculate u 270 IF u>80 THEN GOSUB 9030:DD=0:GOTO 300:REM H Excessive u 280 GOSUB 2500:REM b Solve for W(u) 290 GOSUB 3030:REM # Calculate drawdown 300 GOSUB 7250:REM # Video output section 310 DE=DD:REM # Save drawdown 320 REM -- Image well section -330 F1=1:REM # Set flag for image well 340 GOSUB 3300:REM # Distance component along aquifer 350 R5=R:REM # Save R 360 GOSUB 3340:REM # Distance of image well 370 R=R4:REM H Prepare to send R4 to subroutine 380 GOSUB 3000:REM # Calculate u 390 IF U>80 THEN GOSUB 9030:DD=0:GOTO 420:REM # Excessive u 400 GOSUB 2500:REM # Solve for W(u) 410 GOSUB 3030:REM # Calculate drawdown 420 DE=DD+DE:REM # Accumulate drawdown 430 GOSUB 7250:REM # Video output 440 IF ABS(DD)
Drawdown
2.25
3050 RETURN 3300 REM === Calculate distance to image well --3310 R3=SQR(R·R-(R1-R2).(R1-R2» 3320 RETURN 3330 REM -- Second part -3340 IF FT=1 THEN DR=DR+2 3350 IF FT=1 THEN D1=-R1 ELSE D1=R1 3360 IF F3=0 THEN D2=R2 El.SE D2=-R2 3370 IF FT=1 THEN FT=O ELSE FT=1 3380 R4=SQR«D2+DR·R6+D1).(D2+DR·R6+D1)+R3·R3) 3390 RETURN 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistant units." 7020 PRINT"Enter a negative distance to end.":PRINT 7030 PRINT"Distance of observation point from discharging" 7040 INPUT" well"jR 7050 IF R(=O THEN 7240 7060 INPUT" Storage coefficient"jCS 7070 INPUT" Transmissivity" jT Time" j TI 7080 INPUT" Discharge rate"jQ 7090 INPUT" 7130 PRINT"Distance from discharge well to" 7140 INPUT" boundary" jR1 7150 PRINT"Distance from observation well to" 7160 INPUT" the same boundarY"jR2 Width of aquifer"jR6 7170 INPUT" 7210 PRINT: PRINT"Working . . . ." 7240 RETURN 7250 REM === Video output section --7270 IF F1=0 THEN PRINT"DrawdoWll due to discharge well is "j : PRINT USING G1 JDD 7280 IF F1 =1 THEN PRINT"Distance of obs , well from image well is ": R4 7290 IF F1=1 THEN PRINT"Dl'awdown due to image well is "j:PRINT USING G1jDD ·7300 IF F1 =2 OR F1 =1 THEN PRINT"Combined drawdown is "j: PRINT USING G1 JDE 7310 PRINT 7490 RETURN 8600 REM --- Assign values to variables === 8610 8620 These lines are identical to those of CONFDD. 8630 8640 PI=3.1415927':G1="".',····":TL=10000 8650 RETURN 9030 REM -- Excessive u -9040 PRINT"The value of u is >80, drawdown can be taken as zero." 9050 RETURN 9060 REM -- Impossible combination of distances -9070 PRINT"There is an error in the entered distancesl"
2.26
Drawdown
9080 RETURN 9999 END 9.7.
A leaky strip aquifer, program LEAKSTRP
1 REM ••••• LEAKS1RP/BAS ••• ,. 2 REM • Last modified 29/9/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40),C1(15),C2(15) 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a leaky confined strip aquifer." 70 PRINT"Storage in the aquitard is neglected." 80 PRINT 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM # Assign values to variables. 110 GOSUB 8800:REM # All other constants 200 REM === Program control === 210 F1=0:REM # Set flag for discharge well 220 GOSUB 7000:REM # Input section 230 IF R<=O THEN 9999 240 IF ABS(R1-R2»R THEN GOSUB 9060:GOTO 200:REM # Distances wrong 250 REM -- Discharge well section -260 GOSUB 3000:REM # Calculate u, RB 270 IF U1>80 THEN GOSUB 9030:DD=0:GOTO 300:REM # Excessive u 280 GOSUB 5000:REM # Solve for W(u,rb) 290 GOSUB 3030:REM # Calculate drawdown 300 GOSUB 7250:REM # Video output section 310 DE=DD:REM # Save drawdown 320 REM -- Image well section -330 F1=1:REM # Set flag for image well 340 GOSUB 3300:REM # Distance component along aquifer 350 R5=R:REM # Save R 360 GOSUB 3340:REM # Distance of image well 370 R=R4:REM # Prepare to send R4 to subroutine 380 GOSUB 3000:REM # Calculate u 390 IF U1>80 THEN GOSUB 9030:DD=0:GOTO 420:REM # Excessive u 400 GOSUB 5000:REM # Solve for W(u,RB) 410 GOSUB 3030:REM # Calculate drawdown 420 DE=DD+DE:REM # Accumulate drawdown 430 GOSUB 7250:REM # Video output 440 IF ABS(DD)
Drawdown 2500 REM == Subroutine W(u) == 2510 U2=U*U:U3=U*U2:IF U<1 THEN 2540 2520 W=1/(U*EXP(U))*(C6+C7*U+U2)/(C8+cg*U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1*U+C2*U2+C3*U3+C4*U2*U2+C5*U2*U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U1=R*R*CS/(4*T*TI):RB=RISQR(T/(VK/TB)) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q*W1/(4*PI*T) 3050 RETURN 3300 REM === Calculate distance to image well --3310 R3=SQR(R*R-(R1-R2)*(R1-R2)) 3320 RETURN 3330 REM -- Second part -3340 IF FT=1 THEN DR=DR+2 3350 IF FT=1 THEN D1=-R1 ELSE D1=R1 3360 IF F3=0 THEN D2=R2 ELSE D2=-R2 3370 IF FT=1 THEN FT=O ELSE FT=1 3380 R4=SQR«D2+DR*R6+D1)*(D2+DR*R6+D1)+R3*R3) 3390 RETURN 5000 REM === Group of subroutines for function W(u,RB) === 5010 5020 These lines are identical to those of LEAKDD. 5760 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistant units." 7020 PRINT"Enter a negative distance to end.":PRINT 7030 PRINT"Distance of observation point from discharging" 7040 INPUT" well";R 7050 IF R<=O THEN 7240 7060 INPUT" Storage coefficient";CS 7070 INPUT" Transmissivity"; T Time";TI 7080 INPUT" Discharge rate";Q 7090 INPUT" 7100 PRINT"Vertical hydraulic conductivity of" 7110 INPUT" aquitard"; VK 7120 INPUT"Thickness of aquitard";TB 7130 PRINT"Distance from discharge well to" 7140 INPUT" boundary";R1 7150 PRINT"Distance from observation well to" 7160 INPUT" the same boundarY"jR2 Width of aquifer";R6 7170 INPUT" 7210 PRINT:PRINT"Working • • . • " 7240 RETURN 7250 REM === Video output section ---
2.27
2.28 Drawdown 7270 IF F1=0 THEN PRINT"Drawdown due to discharge well is "j:PRINT USING G1 iDD 7280 IF F1=1 THEN PRINT"Distance of obs. well from image well is "iR4 7290 IF F1=1 THEN PRINT"Drawdown due to image well is "i: PRINT USING G1 iDD 7300 IF F1=2 OR F1=1 THEN PRINT"Combined drawdown is ": : PRINT USING G1 iDE 7310 PRINT 7490 RETURN 8600 REM Assign values to variables === 8610 8620 These lines are identical to those of CONFDD. 8630 8650 RETURN 8800 REM --- Read constants === 8810 8820 These lines are identical to those of LEAKDD. 8970 9030 REM -- Excessive u 9040 PRINT"The value of u is >80, drawdown can be taken as zero." 9050 RETURN 9060 REM -- Impossible combination of distances -9070 PRINT"There is an error in the entered distancesl" 9080 RETURN 9999 END
Evaluation of S
3.1
Chapter 3
The speed of computers makes possible the use of methods that would be quite impractical if attempted by pencil and pocket calculator. Indeed, it makes very practicable, the use of qUite workable methods that have been long known, but not frequently used because they are so time consuming in association with traditional techniques. 1. NEWTONS METHOD Isaac Newton developed a method for solving difficult equations to which the digital computer can be readily applied. Newton himself must have used the method manually, or with the help of a slide rule at most, his method will come into it's own in this age of computers. (Isaac Newton lived from 1642 to 1121. John Napier invented logarithms in 1614, and Edmund Gunter plotted logs on a two foot straight line in 1620. From such a straight line it was possible to multiply and divide by adding and subtracting distances using a pair of dividers. So Newton would have had access to some minimal computational aids.) When aquifer parameters are being evaluated from information obtained in the field, it is sometimes desirable to make a direct evaluation of storage coefficient, rather than use a graphical method (or perhaps there may be insufficient data for graphical methods). While the Cooper-Jacob approximation (1946) can be used when the value of u is less than 0.01, if the investigator has only small, late, responses from some of his more distant observation wells, u is likely to be much greater than this. In chapter 1 the polynomial equations described by Huntoon (1980) were used to solve the well equation. That is, given the value u, we calculated the value of W(u). Using Newtons method we can efficiently calculate u from W(u), and so solve the Theis equation for storage coefficient. Before going further with the well equation, it is worth looking at Newtons method itself as it will be found to have many other applications in groundwater science. Newtons method of solution relies on the fact that the derivative of an equation at a point is the slope of the graph of that equation at that point. In Newtons method, an initial guess of the solution is made, then the derivative of the equation is calculated at that point and can be used to make an improved estimate of the solution. This process is then repeated until the change between the current estimate and the previous one is judged to be so small as to indicate an acceptably close approach to the solution. (The notes below on Newtons method applied to the solution of the well function include an illustrated example which will make this relationship plainer.) It is not the purpose of this book to give a detailed description of the workings of Newtons method, I suggest that the reader refer to one of the
3.2
Evaluation of S
many books on the oaloulus or applied oaloulus if he desires more information. A good book on the sUbjeot is 'Caloulus' by Grossman (1984). Miller (1981) also gives a fuller explanation of the use of Newtons method. There are two basic approaohes to solution of equations by Newtons method; they vary in the way that the derivative is oaloulated. 1/ For every funotion f(x) there is a 'derived funotion' g(x) suoh that for any given value of x, g(x) is the derivative of the funotion f(x) at x. This is the method used" by the program CB2N to solve the Theis equation for storage ooeffioient later in this ohapter. 2/ An alternative that may be of wider applioation is to oaloulate the derivative of the given funotion f(x) at a point, as required, by testing the way in whioh the value of the funotion ohanges with small ohanges in the value of x around that point. This second method has the advantage of not requiring that the derived equation be known. It is the second method that is employed in the program NEWTON. 1.1. An applioation of Newtons method, program NEWTON. As an example of the use of the program, the fourth order polynomial;
4 2 AX +BX +CX=D, where A=0.02, B=-6, C=25, and D=-100 will be used. This must first be put into the form f(x)=O by adding 100 to both sides. Funotion A is now defined in line 210 as below;
(Note that the Basic exponentiation funotion "A" has been avoided, for the sake of accuraoy and speed.) The program may now be run. The user will be asked to enter an initial guess, and given the option of suffixing that guess with a 'd' if he requires that the oalculations be done in double precision. (There will be little, if anything, to be gained by using double precision if built in functions such as SIN, EXP, and LOG are inoluded in the defined funotion, as these are normally oalculated by the Basio interpreter to only single preoision accuraoy.) This partioular equation has four solutions as shown in figure 3.1, and which of these solutions is discovered by NEWTON will depend upon the initial guess. The solutions are -18.77229444, -2.514514318, 7,93101872, and 13.35579069.
Evaluation of S
3.3
Figure 3.1 f(xl
500
A
B
a
c
o x
-500 A sketch B, C, and D.
graph
of the example function, showing the four solutions, A,
Some features of the program. No attempt is made to produce the most accurate possible derivative. On trial it was found that measuring the slope of a small, but not necessarily vanishingly small, part of the graph of the function allowed a faster solution to be achieved. Although the approximation to the derivative produced by this method is less accurate than may be obtained, it can be produced in a much shorter time than that required to produce the best approximation to the derivative. (It is probably worth pointing out that the accuracy of the derivative has no bearing on the accuracy of the final solution.) Some equations don't have a solution at all. If not made to stop, the program would go on forever searching for a non-existent solution to such an equation. Line 360 terminates the program if no solution has been found after 100 iterations. (Failure to find a solution is not proof of the lack of a solution. It may mean that the initial guess needs to be changed. Try graphing the functjon.) The program is designed for speed. To this end, most numerical constants are loaded into variables at the beginning, and in the iterative part of the program it is these variables that are referred to rather than the numeric constants. (This avoids the time consuming process of conversion from a decimal representation to single or double precision having to be done more than once.) Finally an indication of the accuracy of the found solution is given. Useage of variables in program Newton. Is the 'small number' which is added to X so that the approximate derivative may be calculated from the slope of the line joining f(X) and f(X+H) . 1.2.
H
3.4
Evaluation of S
Ie
Iteration count. The fourth power of two. Used to increase H if that variable is found to be too small to allow the calculation of a derivative. The twentieth power of two. The value of H is made equal to X/P2. The approximation of the derivative. The allowable tolerance in the change in the approximate solution calculated in successive iterations. If the proportional change is less than T, then the solution is accepted. The current guess at the solution. The last guess at the solution. The error in the value of the equation if the last value of X is taken as the solution. is used to input the initial guess. A string is used so that a suffix may be added if so desired. This method results in minimal key punching by the operator at run time.
Pl
P2 S T
X Xl
Y Z$
2. SOLUTION OF THE THEIS EQUATION FOR STORAGE. The reader will probably recall that the Theis equation (Theis, 1935) is generally used to calculate the drawdown at a given distance from a discharging well in a confined aquifer, at some time after the commencement of pumping, but before the system has reached steady state. In solving the equation in the 'normal' direction the storage coefficient is required as input, and the output is the drawdown. A similar method to those given here could be used to solve the equation for transmissivity if storage coefficient was known, but there can be more than one valid solution for a given set of data, and in any case, transmissivity is easier to quantify from field data than is storage coefficient.
Figure 3.2 1200
T
Transmissivity plotted against storage coefficient
Evaluation of S
3.5
Figure 3.2 shows transmissivity plotted against storage coefficient for a drawdown of 0.2m, a distance of 1400m, a pumping rate of 2000 cubic metres per day, and a time of one day. Notice that if storage coefficient is 4.00E-4 then transmissivity could be evaluated at approximately either 240 or 959 cubic metres per day per metre. Two programs are given for the 'reverse' solution of the Theis equation. The first is called CB2N/BAS and employs Newtons method, the second is CB2/BAS and uses the less sophisticated, slower, but easier, and less fallible method of successive bisection. 2.1. Program CB2N/BAS. This adaptation uses the derived equations of the so called polynomial approximations of the well equations. As drawdown, transmissivity, and discharge rate are known, the value of the well function of u may be calculated, although u itself is not known. In this program the polynomial approximations to the well equation are the defined functions N1 and N2, the former being used when u is less than one, and the latter in all other cases. Note from fig. 3.3 that if the initial guess for u is much too large Newtons method will yield a negative value for u. Negative u values cannot be handled by the polynomial approximations, so they are converted to new, smaller, guesses. in line 3490. Line 3500 similarly adjusts excessive values of u. Figure 3.3 shows graphically how an example solution is obtained. The program inputs are; drawdown = 1m, distance from the pumped well to the observation well = 100m, transmissivity = 100m squared per day, pumping rate = 500 cubic metres per day, and the duration of pumping is 1 day. A value of 2.51327 is calculated for the well function in line 3410, and a first guess of 0.01 is made for the value of u. Line 3430 uses defined function N1 to calculate the value of the well function at u=O.Ol. Line 3470 uses defined function D4 (Functions D3 and D4 are the derived functions of the two polynomial approximations to the well equation) to calculate the slope of the well function at u, -99.005, and produces an improved guess at u, 0.0254. This procedure is repeated with successive estimates of u being 0.041234, 0.0471988, and the final value of 0.0476711, which is found to produce an acceptable value for the well function in the test in line 3460. Now it is a simple matter to calculate the storage coefficient, which is done in line 3520. The value given by your computer should be close to 0.001907.
3.6
Evaluation of S
Figure
3·3
a6
N
Solution of W(u) for u, using Newtons Method; see text.
Evaluation of S
3.7
2.2. Usage of variables in program CB2N. CO to C9 are constants used in the calculation of the well function from the estimated values of u. CS is the coefficient of storage. DD is the measured drawdown. F An integer variable used as a flag. As mentioned previously, negative u values can be obtained in the process of refining the estimate of u. A negative u cannot be used because of the nature of the so called polynomial approximations to the well equation, so they are converted to very low values under the control of flag F in line 3490. It was found that convergence upward from very low estimates of u was slow; the flag permits a stepwise reduction of u as required. F actually records the number of times that u has been changed from a negative value to a small positive value, and it permits the use of a smaller value each step. In practice u values less than 1E-4 will be infrequent, and less than 1E-10 very rare. PI is the constant, Pi. Q is the discharge rate. is the distance from the discharging well to the piezometer or R observation well where the drawdown is measured. is the transmissivity. T is the time since commencement of discharge. TI is the tolerance allowed in the proportionate difference between TL the value of the well function calculated from the measured drawdown, and that calculated from the estimated value of u. is used to hold the value of u. U and U3 hold the second and third powers, respectively, of u. U2 has the value of the well function as calculated from the measured W drawdown. contains the absolute (unsigned) difference between the two values of WO the well function. It is used to test for sufficient accuracy. WM is the value of the known well function subtracted from the well function produced from the estimated u. WM is used to calculate the refined estimate for u. wu has the well function value calculated from the estimated u. Z$, ZX, and ZZ$ are all used for the one key program flow subroutine. 2.3. Defined functions in program CB2N. Functions N1 and N2 are the two polynomial approximations to the well equation. Function D3 is the derivative of function N2. Note that functions D1 and D2 are used in the definition of D3 in order to keep it a reasonable length. Function D4 is the derivative of N1. functions have been checked against approximate (The derivative derivatives calculated from tabulated values of the well function. They give
3.8
Evaluation of S
as good an agreement as can be expected considering the approximate nature of the test over the full range of the available tables, ie. u=1E-15 to u=9.5). 2.4. Program CB2/BAS This solves the same problem as CB2N, but goes about the solution in entirely a different way. The principal used by this method depends on the fact that while we cannot simply solve the well equation for storage, we can, for any given estimate, decide whether we are too high or too low. We therefore start with two values, the high one (1 is used in the program) we know to be too high, and the low one (1E-38 is the programs lower limit) which must be too low. Now take the half way point between the two. (The arithmetic mean is about 0.5, but for our purposes the geometric mean, about 1E-19 is much better). Right, we'll guess that the storage coefficient is 1E-19 and then test whether that is too high or too low. Almost certainly it will be found to be too low, so we make 1E-19 our new lower limit, take the new half way point as a next guess, test it, adjust one or other end points, and repeat the process until we are satisfied that our approximation is good enough. This method is called Successive bisection. To explain the operation of the program we can probably start With line 2705 where variables D1 and D2 are set as the upper and lower limits respectively. Line 2710 makes a first guess at the storage coefficient (CS) by making it the geometric mean of D1 and D2. Given this assumed value of CS, the next few lines calculate u, call the Well Function subroutine to get a value for W(u), and then calculate an experimental value for drawdown, D3. D3 is then tested against the measured drawdown, DD in line 2760. If the discrepancy is found to be less than the allowable tolerance (TL), or if it is found that our upper and lower limits have become equal to one another, then we accept the value of CS as good enough. If the match is not acceptable then line 2770 resets the upper limit if the experimental drawdown is too small, or resets the lower limit if it is too large. In other words, if our guess at storage leads to too small a drawdown, our guess is too big, otherwise it's too small. 2.5. Usage of variables in program CB2 CO to C9 are constants used for the solution of the well equation. CS, D1, D2, D3, and DD have been explained above. G1 is used for formatting the numerical output. PI The constant, Pi. Q has the value of the discharge rate. R is the distance from the discharge well to the piezometer. T is the transmissivity. TI is the elapsed time since the commencement of discharge. TL The tolerance, TL, was explained above. U is the value u, the argument of the well function. U~, and U3 are u squared, and u cubed respectively.
Evaluation of S 3.9 W
is the value calculated for the well function, from the latest estimate of CS. Z$, ZX, and ZZ$, are used in program flow control.
3. REFERENCES Cooper and Jacob, 1946. A generalised graphical method for evaluating formation constants and summarizing well field history. Trans. Am. Geoph. Union 27: pp. 526-534. Grossman, S.I., 1984. Calculus. Third edition. Academic Press Inc., Orlando, Florida 32887, USA. 1300pp. Huntoon, P.W., 1980. Computationally efficient polynomial approximations used to program the Theis equation. Groundwater, Vol. 18, No.2, March-April. Miller, A.R., 1981. Basic Programs for Scientists and Engineers. Sybex, Berkley, California. 318 pp. Theis, C.V., 1935. The relation between the lowering of the piezometric surface and the rate and duration of discharge of a well using grounwater storage. Trans. Am. Geophs. Un 16:PP519-524. 4. 4.1.
PROGRAM LISTINGS An application of Newtons Method. program NEWTON.
1 REM ••••• NEWTON.BAS ••••• 2 REM • Last modified 4/9/85 3 REM • By D.K. Clarke, Crystal Brook, S. Australia. 10 CLS 20 PRINT" Solution of equations by Newtons Method." 30 PRINT 40 PRINT" Suffix initial guess with d for double precision." 50 PRINT:INPUT"Initial guess"jZ$ 60 IF RIGHT$(Z$,1)="d" OR RIGHT$(Z$,1)="D" THEN 70 ELSE 90 70 DEFDBL A-Y 80 T=.0000000000001#:GOTO 100 90 T=.000001 100 X=VAL(Z$):X1=1:P2=10485761:P1=16 200 REM === Solution section === 210 DEF FN A(X)=.6.ABS(X-10)+7·LOG(X)+X[-.3 220 REM -- Calculate the derivative at X -230 H=X/P2 240 S=(FN A(X+H)-FN A(X))/H 250 IF S=O THEN H=H.P1:IF ABS(H)
3.10
Evaluation of S
340 PRINT TAB(40)i"New X is "iX 350 IF ABS«X-X1)/X)100 THEN PRINT"Falure to converge to solution.":GOTO 9999 370 X1=X:GOTO 230 500 REM === Equation has been solved === 510 PRINT"Solution is approximately "iX 520 Y=FN A(X) 530 IF Y=O THEN PRINT"Zero error.":GOTO 9999 540 PRINT"If "jXi" is taken as the solution," 550 PRINT"then the value of the function is "iY 560 PRINT"rather than zero as i t should be." 9999 END 4.2.
Newton solves the Theis equation for storage, program CB2N.
REM ••••• CB2N/BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 CLS 40 REM -- Preliminary print statements -50 PRINT" Evaluation of storage coefficient using Newtons Method." 80 GOSUB 8600:REM # Assign values to variables. 90 GOSUB 8500:REM # Define functions 200 REM === Control section === 210 GOSUB 7000:REM # Keyboard input 220 GOSUB 3400:REM # Newtons method 250 GOSUB 7250:REM # Video output 260 PRINT"Another solution?":Z$="YyNn":GOSUB 9800 270 IF ZX<3 THEN 200 ELSE 9999 3400 REM === Newtons method === 3410 W=DD.4.PI.T/Q:U=.01:PRINT:REM PRINT"W ="jW 3420 U2=U·U:U3=U.U2 3430 IF U<1 THEN WU=FN N1 ELSE WU=FN N2 3440 WM=WU-W 3450 REM PRINT"WU=" jWU, "U=" jU,"WM=" iWM 3460 WO=ABS(W-WU):IF WO<W.TL THEN 3520 3470 IF U<1 THEN U=U-WM/FN D4 ELSE U=U-WM/FN D3 3490 IF U<=O AND F=O THEN U=.0001:F=1 ELSE IF U<=O AND F=1 THEN U=1E-10:F=2 ELSE IF U<=O AND F=2 THEN U=9.999999E-21 3500 IF U>80 THEN U=80 3510 GOTO 3420 3520 CS=U·4·T·TI/(R·R) 3540 RETURN 7000 REM === Interactive input _ 7030 PRINT:F=O
Evaluation of S 3.11 7040 7050 7060 7070 7080 7090 7250 7260 7270 7490 8500 8510 8520 8530 8540 8550 8560 8570 8600 8610 8620 8630 8640 8650 9800 9810 9820 9830 9840 9850 9999
INPUT"Drawdown in obs. well (m) ";DD INPUT"Distance from pumped well to obs. well (m) ";R "jT INPUT"Transmissivity (m - m I day) INPUT"Pumping rate (m - m - m I day) "j Q INPUT"Duration of pumping (days) "jT! RETURN REM === Video output === PRINT"u is";:PRINT USING Gl;Uj:PRINT" and W(u) is";:PRINT USING GljW PRINT"Storage coefficient is ";:PRINT USING Gl;CS RETURN REM === Define functions === DEF FN Nl=-LOG(U)+CO+Cl-U+C2-U2+C3-U3+C4-U2-U2+C5-U2-U3 DEF FN N2=1/(U-EXP(U»)-(C6+C7-U+U2)/(C8+C9-U+U2) DEF FN Dl=(U--EXP(-U)-EXP(-U»/U2 DEF FN D2=«C8+C9-U+U2)-(C7+2-U)-(C6+C7-U+U2)-(C9+2-U) 1«C8+C9-U+U2)-(C8+C9-U+U2») DEF FN D3=1/(U-EXP(U))-FN D2+(C6+C7-U+U2)/(C8+C9-U+U2)-FN Dl DEF FN D4=-1/U+Cl+2-C2-U+3-C3-U2+4-C4-U3+5-C5-U2-U2 RETURN REM === Assign values to variables === CO=-.57721566#:Cl=.99999193#:C2=-.24991055#:C3=5.519968E-02 C4=-9.76004E-03:C5=1.07857E-03 C6=.250621:C7=2.334733:C8=1.681534:C9=3.330657 TL=.0001:PI=3.1415927#:Gl="##.###····" RETURN REM -- Await valid key -ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$="" THEN 9820 FOR ZX=l TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END 4.3.
Successive bisection, program CB2.
REM ----- CB2/BAS ----2 REM - Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 CLS 40 REM -- Preliminary print statements -50 PRINT" Evaluation of storage coefficient using Succesive Bisection." 80 GOSUB 8600:REM # Assign values to variables. 200 REM === Control section === 210 GOSUB 7000:REM # Keyboard input 220 GOSUB 2700:REM # Succesive bisection 250 GOSUB 7250:REM # Video output
3.12 Evaluation of S 260 PRINT"Another solution?":Z$="YyNn":GOSUB 9800 270 IF ZX<3 THEN 200 ELSE 9999 2500 REM == Subroutine W(u) == 2510 U2=U'U:U3=U'U2:IF U<1 THEN 2540 2520 W=1/(U'EXP(U»'(C6+C7'U+U2)/(C8+C9'U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1'U+C2'U2+C3'U3+C4'U2'U2+C5'U2'U3 2550 RETURN 2700 REM === Succesive bisection --2705 D1=1E-38:D2=1 2710 CS=EXP«LOG(D1)+LOG(D2»/2) 2720 U=R'R'CS/(4'T'TI) 2730 IF U>80 THEN PRINT"The value of u is too greatj u ="jU:GOTO 9999 2740 GOSUB 2500:REM U Calculate W(u) 2750 D3=Q'W/(4'PI'T) 2760 IF ABS(DD-D3)
Simulations
4.1
Chapter 4
In this chapter the methods developed in chapter 2 will be used to simulate the drawdown in a piezometer at a given distance from a discharging well. Multiple discharge rates are catered for. The aquifer types covered are; 1/ Confined; 2/ Leaky confined; 3/ Confined, with one discharge or recharge boundary; 4/ Leaky confined, with one boundary; 5/ Confined strip aquifer; 6/ Leaky confined strip aquifer. 7/ Finally a program simulating drawdown in a pumped well in a simple confined aquifer will be described. The programs have been named SIM1 to SIM7 respectively. The programs are designed to produce the patterns of drawdown that are to be expected from groundwater theory during a typical stepped rate discharge test under the following conditions. 1/ In all programs except SIM7 measurements of the piezometric head are made in an observation well (piezometer) at a given distance from a discharging well. In SIM7 the simulated measurements are of the drawdown in the discharging well. 2/ The discharge rate is held constant in each of a number of time steps. 3/ At the beginning of each step, the discharge rate is changed, with no period of recovery between steps. (The programs are quite capable of simulation of periods of recovery too, if these are specified by using a discharge rate of zero.) 4/ The usual assumptions about the wells fUlly penetrating the aqUifer, having infinitesimal diameter and no storage, the aquifers being homogeneous and isotropic, etc. are made. The programs that deal with leaky aqUifers in this chapter, as for those in chapter 2, assume no storage in the aquitard, and infinite storage in the overlying unconfined aqUifer. These programs add a further two levels of complexity to those of chapter 2. To simulate a discharge test we must use some sort of simple algorithm to calculate the times for the drawdown 'readings'. In real tests the readings follow a system of (roughly) exponentially increasing time steps, usually starting with readings at one minute intervals, changing to two minute intervals at about ten minutes total elapsed time, then five minutes, ten minutes, etc. This scheme could be followed here, but it is simpler and just as satisfactory to calculate the next time by adding an exponentially increasing time to the time of the previous reading. This is complicated by the need to revert to frequent readings at the beginning of each step, and the need to have a reading right at the end of each step. At any time after the beginning of the second discharge step we must
4.2
Simulations
take into account not only the drawdown due to the current pumping rate and duration, but also that due to the previous step or steps. The easiest way to solve this problem is to use the concept of additional pumps. It may be supposed that one pump started at the beginning of the test, and at the beginning of the second step, another pump with a discharge rate equal to the rate of the second step minus the rate of the first step, started. At each subsequent step, another pump starts, with a rate equal to that of the present step minus the rate of the previous step. (Note that it is quite possible to have negative pumping rates for one or more of these 'pumps'.) The total drawdown at any point in the aquifer (not in the pumped well) may then be calculated as the sum of the drawdown due to each 'pump' (always providing, of course, that the drawdown is not so great that the aquifer changes from confined to unconfined). This situation does not hold for a simulation in the pumped well itself where there is a component of the equation used to calculate drawdown at any given time (the Well Equation) that is proportional to some power of the discharge rate. For the discharge well it is necessary to calculate the time related component of drawdown for each 'pump' separately, but to calculate the exponential component based on the total discharge rate. The units used in these programs are metres and days. ie. Drawdowns are given in metres, times in days, and discharge rates are in cubic metres per day. However, as it is normal to record elapsed times in minutes in a discharge test, the times that are recorded in the disk file by these programs are in minutes. If required, times could go onto the disk file in days simply by changing "T(I)*1440" in line 8290 to "T(l)". Times printed on paper, or displayed on the screen, will be in days. 1. A MULTI-STAGE DISCHARGE TEST IN A CONFINED AQUIFER 1.1. Program 3IM1 The greatest part of this program is almost identical to CONFDD, described in chapter 2. The differences are the points covered above, and the option of saving the data produced on a disk file. (This section of the program may be incompatible with some implementations of Basic, if so it can be either modified or deleted). By putting the data on a disk file we can access it at some later time, or use a program such as DTPLOT to produce a graph similar to those illustrated in this chapter. Outline of the program. Values for aquifer parameters and details on the structure of the test are obtained from the user. Drawdown is calculated for one minutes pumping, and then at exponentially increasing time steps until the beginning of the second pumping phase, when the time step is reset to one minute. Drawdown is calculated and displayed on the video screen in this way until the end of the last step, as given by the user. Then the option is given for storing the data on a disk file. One or several files can be made, using the same or different file names. The file will be placed on the default disk drive.
Simulations
4.3
1.2. Operation of the program Only the parts of this program not previously explained in the notes on CONFDD will be covered here. As in most of the programs in this book, the first program lines take care of the simpler initialization tasks, print a short explanitory note, and call a subroutine to load variables having fixed values. Line 210 calls the subroutine that enters data via the keyboard. In line 230, integer counter II is set to one. This will count the time-drawdown datum pairs as they are calculated. In the same line TP, the primary time increment is set to 1 minute (1/1440 days). The secondary time increment, TS, and the total accumulated time, TM, are also set to one minute. It is this use of the minute as a fraction of a day that causes the requirement that the unit of time for data entry be the day. If users wish to use some other combination of time units, then this may be changed. The last operation in line 230 is setting the number of pumps, KS, to one. A loop in lines 240 to 290 calculates a discharge rate, Q, at the current time as stored in TM, for the 'pump' number JJ. (The rate for each of the imaginary pumps has been calculated and entered into the subscripted array P(x) in the keyboard input section.) For the first few passes through the loop, there is only one pump, but when the time of the beginning of the second step has been reached, KS is incremented, and a second pump enters the model. Line 250 sets Q equal to the discharge rate of the current pump, and then sets TI equal to the elapsed time from the beginning of the operation of this pump. Line 260 calls the subroutine at line 500 which organizes the solution for drawdown due to the current pump at the time TI. The operation of this section of the program is very similar to programs already explained. Line 280 causes the total drawdown due to all pumps to be accumulated in variable DF. Having left the loop at line 290, the calculations relevant to time TM are completed. Line 300 stores the value of the current time, with its associated drawdown and discharge rate, in the subscripted variables T(x), D(x), and Q(x), for later use. Variable DF is then zeroed in preparation for another pass through the loop. Lines 310 to 330 call the screen display subroutine, the paper printout subroutine if flag FP has been set in the keyboard input section, and increments the counter II in preparation for the calculation of the next timedrawdown datum pair, respectively. The statements described in the next four paragraphs detect the ends of completed stages, and control the beginnings of the new discharge test stages, and also detect the end of the whole test. These program lines will not be acted upon in the same order as they appear in the program because of their conditional nature; they will be ex~lained in the most likely order of operation.
4.4
Simulations
Line 360 increases the size of the secondary time increment by multiplying it by RT, which has the value of the square root of two. (There is no reason that root two must be used here, a number closer to one could be substituted if more output data sets were required, or a larger number for more widely spaced times.) The second statement increases the total elapsed time, TM. If TM has been increased to some value greater than the time of the end of the current step, line 370 resets it back to the end of the step. This ensures a reading at the end of each step. After the reading at the end of the current step has been calculated, control will come back to line 350 which then increases TM by one minute (by adding TP), resets the secondary time increment to be equal to the primary time increment (TS=TP), and increments the number of pumps (KS=KS+1). Control is then passed back to line 240 for calculation of the first reading of the new step. The last of this group of lines to be acted upon is the first in order of numbering, line 340. It detects the last time [TI(NS), the time at the end of the last step], and leaves the time-drawdown calculation loop by passing control to line 390. Variable ND is given the number of data sets in line 390. Lines 400 to 440 give the user the option of producing one or more disk files of the simulation, and then ending the program by the jump to line 9999. The other segments of this program which have not previous been used are those associated with the data file. Lines 8250 to 8310 do the job of storing the data on a sequential access disk file. (This is a little more simple to use than a random access file, although the latter has the advantage of greater flexibility.) Line 9600 to 9710 input and check the validity of the users chosen file name. Only a valid file name will be accepted, and the subroutine will give the reason for rejecting any name. The last part of this subroutine adds ".WTD" to the end of the name to identify the file as well test data. Note that while a period'.' is required to separate the name extension from the name proper in most computers, others require a slash 'I' instead. The MS DOS and CPIM operating systems require the period. 1.3. Program verification As a test that the program is working correctly, the user may enter trial values of; Distance from discharging well to observation well, 20; Storage coefficient, 0.0004; Transmissivity, 200; Two 'discharge' phases, Discharge rate for the first step, 300; Finishing time of first step, 0.208 days (approx. 5 hrs.); Discharge rate for the second (last) step, 0; Finishing time of the second step 6.9 days:
Simulations
4.5
(where all times are measured from the start of the first step.) This should produce the output shown in table 4.1. A graphic representation of the output using a linear drawdown scale, and a logarithmic time scale is given in figure 4.1. Table 4.1 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2080 0.2087 0.2097 0.2111 0.2130 0.2158 0.2197 0.2253 0.2331 0.2443 0.2600 0.2822 0.3136 0.3581 0.4209 0.5098 0.6355 0.8133 1.0647 1.4203 1.9231 2.6342 3.6399 5.0621 6.9000
DrawdowfJ 0.112 0.199 0.265 0.321 0.372 0.419 0.465 0.509 0.552 0.595 0.638 0.680 0.722 0.760 0.649 0.563 0.498 0.443 0.393 0.348 0.305 0.265 0.227 0.192 0.159 0.130 0.104 0.081 0.063 0.047 0.035 0.026 0.019 0.014 0.010 0.007 0.005 0.004
Pumps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
All the graphs of drawdown against time given in this chapter assume that the basic units used within the SIM set of programs were metres and days, although as stated above, the minute is used in the disk file. The minute is also the time unit of the graphs. The recovery phase of most of the graphs is plotted as tlt1, or sometimes as root t minus root tl, in either case the unit will be shown on the x scale of the graph. (t is the time from the beginning of discharge, t1 is the time from the ending of discharge. )
4.6
Simulations
...
)(
)(
~
8
)I
;
k ;
Ix )(
)(
Iv
I'll
6
.
Ix
I
.....
" ".-
.... ~
~
"O;f
. . . . . c.o. ". . en.
...
N
('I)
"O;f
l.n
CX)
Crawdown I Rea Idue1 d.
....... .... N
Simulations Table 4.2 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
Time (days)
0.0007
0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0208 0.0215 0.0225 0.0239 0.0258 0.0286 0.0325 0.0381 0.0417 0.0424 0.0434 0.0448 0.0467 0.0495 0.0534 0.0590 0.0625 0.0632 0.0642 0.0656 0.0675 0.0703 0.0742 0.0798 0.0876 0.0988 0.1145 0.1367 0.1681 0.2126 0.2754 0.3643 0.4900 0.6678 0.9192
1.0000 1.0007
1.0017 1.0031
1.0050 1.0078 1.0117 1.0173 1.0251
1.0363 1.0520 1.0742 1.1056 1.1501
1.2129 1.3018
Drawdown 0.149 0.265 0.353 0.428 0.495 0.559 0.620 0.649 0.803 0.926 1.023 1. 111 1.195 1.278 1.364 1.408 1.565 1.692 1. 794 1.888 1.981 2.077 2.178 2.231 2.389 2.518 2.624 2.723 2.822 2.927 3.040 3.163 3.299 3.447 3.608 3.780 3.963 4.155 4.354 4.558 4.767 4.979 5.034 4.439 3.976 3.625 3·327 3.058 2.806
2.567 2.336 2.111 1.893 1.681 1.475 1.278 1.090 0.915
Pumps 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5
5
Discharge 1.000E+02 1.000E+02 1.000E+02 1.000E+02 1 .000E+02 1.000E+02 1.000E+02 1.000E+02 2.000E+02 2.000E+02 2.000E+02 2.000E+02 2.000E+02 2.000E+02 2.000E+02 2.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 4.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
4.7
4.8
Simulations Table 4.2 continued No. 59 60 61 62 63 64 65 66 61
Time (days) 1.4215 1.6053 1.8561 2.2123 2.1151 3.4262 4.4319 5.8541 6.9000
Drawdown 0.735 0.608 0.481 0.314 0.285 0.214 0.158 0.116 0.091
Pumps 5 5 5 5 5 5 5 5 5
Discharge O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
Perhaps a more realistic simulation is that used to produce the data of table 4.2 and the graph of figure 4.2. Here the entries were; R = 20; CS = 0.0001; T 50; Q(1) 100, TI( 1) = 0.0208 days (30 min.); Q(2) = 200, TI(2) = 0.0411 days (1 hr.); 300, TI(3) = 0.0625 days (1.5 hrs.); Q(3) Q(4) = 400, TI(4) = 1 day; 0, TI(5) = 6.9 days. Q(5) The use of variables not explained above or in previous chapters will be described at the end of this chapter. 2. A DISCHARGE TEST IN A LEAKY CONFINED AQUIFER 2.1. Program SIM2 This is very similar to SIM1, with the main difference that it is the Leaky Well Function that is solved rather than the Well Function. The time reqUired to run SIM2 is significantly greater than for SIM1, because of the much greater complexity of the Leaky Well Function. 2.2. Program verification Trial data of; Distance from discharging well to observation well, 20; Storage coefficient, 0.0004; Transmissivity, 200; Vertical hydraulic conductiVity of aquitard, 0.01; Thickness of aquitard, 2; Discharge rate for the first step, 300; Finishing time of first step, 0.208 days (5 hrs.); Discharge rate for the second (last) step, 0; Finishing time of the second step 6.9 days: should give the same output as that shown in table 4.3, and When plotted should look like the graph of figure 4.3.
c.
e,
C
Q.
::0 CD Cll
::7
"S.s:
~ x
6
5.5
5
4.5
4
3.5
3
2.5
2
1.5
1
.5
0
1
Figure 4.2 Ie
SIM1 t5rc. WTO
10 Tille, or tlt1
)( SIM1t5dd. WTO
100
1000
1E+04
~
\0
....
o ::s {/l
.....
ll> cT
l!!I-'
C/.l
4.10
Simulations Table 4.3
No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2080 0.2087 0.2097 0.2111 0.2130 0.2158 0.2197 0.2253 0.2331 0.2443 0.2600 0.2822 0.3136 0.3581 0.4209 0.5098 0.6355 0.8133 1.0647 1.4203 1.9231 2.6342 3.6399 5.0621 6.9000
Drawdown 0.111 0.197 0.261 0.314 0.361 0.404 0.442 0.476 0.506 0.530 0.550 0.564 0.572 0.577 0.466 0.380 0.316 0.263 0.216 0.174 0.136 0.102 0.072 0.048 0.029 0.015 0.007 0.002 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Pumps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
3. A DISCHARGE TEST IN A CONFINED, BOUNDED, AQUIFER 3.1. Program SIM3 This is a simulation of a discharge test in a confined aquifer with one straight line boundary, which may be either disch~rge or recharge. It uses the first part of the control section of 3IM1 with the addition of one line; line 220 in this program checks that the entered distances are not wrong to the point of making the geometry of the discharge well, piezometer, and boundary, insoluble (similarly to line 240 in CONFBOUN). 3.2. Program verifioation Please enter data as given below. Distanoe from discharging well to observation well, 20. Storage coeffioient, 0.0004.
Q.
C
Q.
.-
ca
CD
:::0
~
8:
8-
~
c
.
.s
.55
.5
.45
.4
.35
.3
.25
.2
. 15
.1
•05
0
1
Figure 4.3
~
•
)(
be
10
)(
•
~
• SIM2rec.IfTD
Time, or t/t1
•
x SIM2dd.IfTD
)(
•
,
'. IX
rx
100
•
)(
T
1000
I
-=-
tll
;;
o
1-"
~
ll>
I-'
~
Ul
1-'-
4.12
Simulations Transmissivity, 200. Discharge rate for the first step, 300. Finishing time of first step, 0.208 days (5 hrs.). Discharge rate for the second (last) step, O. Finishing time of the second step (finishing time of the test), 6.9
days. Distance from the discharge well to the boundary, 150. Distance from the piezometer to the boundary, 155. Specify a discharge boundary. The result should be similar to that shown in table 4.4, and when plotted should give a graph like figure 4.4. Table 4.4 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2080 0.2087 0.2097 0.2111 0.2130 0.2158 0.2197 0.2253 0.2331 0.2443 0.2600 0.2822 0.3136 0.3581 0.4209 0.5098 0.6355 0.8133 1.0647 1. 4203 1.9231 2.6342 3.6399 5.0621 6.9000
Drawdown 0.112 0.199 0.265 0.321 0.372 0.420 0.467 0.516 0.569 0.626 0.689 0.756 0.826 0.895 0.784 0.698 0.634 0.580 0.532 0.487 0.445 0.404 0.361 0.317 0.273 0.229 0.188 0.151 0.118 0.091 0.068 0.051 0.037 0.027 0.019 0.014 0.010 0.007
Pumps 1 1 1 1 1 1 1
1 1 1 1 1 1 1 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
..a.
c..
!!.
c.. c
(,0
CD
::;c
i:J
~
c
1.2
1.1
1
.9
.8
.7
.6
.5
.4
.3
.2
•1
0
Figure 4.4
• SIM3drc.WTD
10 Time, or t/t1
)( SIM3ddd. "TO
100
1000
UJ
1-"
~
t'
::l
1-"
o'"'"
.III'"...
n
4.14
Simulations
Table 4.5, and figure 4.5 give the output of the program for the inputs listed above, except that the boundary is treated as a recharge boundary. The reader will probably remember that the difference between the way that the two boundaries are handled is in the sign of the discharge rate of the image well. In the case of a discharge boundary (Water tight, or zero flow boundary) the image well has a discharge rate equal to that of the real well, and in the case of a recharge boundary (constant head boundary) the image well is thought of as recharging the aquifer at the same rate as the real well discharges. The graph of the discharge boundary case shows a downward curve, while that for the recharge boundary shows an similar degree of curvature, but in the opposite direction. Table 4.5 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2080 0.2087 0.2097 0.2111 0.2130 0.2158 0.2197 0.2253 0.2331 0.2443 0.2600 0.2822 0.3136 0.3581 0.4209 0.5098 0.6355 0.8133 1.0647 1.4203 1.9231 2.6342 3.6399 5.0621 6.9000
Drawdown 0.112 0.199 0.265 0·321 0·372 0.419 0.463 0.502 0.536 0.564 0.586 0.604 0.617 0.626 0.514 0.427 0.361 0.306 0.255 0.208 0.165 0.126 0.093 0.066 0.046 0.030 0.019 0.012 0.007 0.004 0.002 0.001 0.001 0.000 0.000 0.000 0.000 0.000
Pumps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.00.0E+02 3.000E+02 3.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
Simul a tions
4 . 15
, I
I
x ~
•
8
)C
~
x
)C
~
If
·
..... en
..
•
x
•
•
x
v
)(
.....
>-
•
en )(
-
-
...,LO· LL
o
t--
....
N
LO
CD
Drawdown, Residual d.
en
......
N
.
...
4.16
Simulations
4. A DISCHARGE TEST IN A BOUNDED, LEAKY CONFINED AQUIFER 4.1. Program SIM4 This program applies the leaky well function to the single bounded aquifer of the previous program. The method used is very similar to the previous programs. In this case we have the leaky well function of programs LEAKFUNC, LEAKDD, and SIM2, with the iterative handling of the drawdown calculations of SIMl to SIM3, and the boundary of SIM3. It is worth noting the similarity between the results of this simulation, and the last. In practice it would be impossible to decide which conceptual model you were dealing with from this discharge test alone. Table 4.6 Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 11 0.0742 12 0.1056 13 0.1501 14 0.2080 15 0.2087 16 0.2097 17 0.2111 18 0.2130 19 0.2158 20 0.2197 21 0.2253 22 0.2331 23 0.2443 24 0.2600 25 0.2822 26 0.3136 27 0.3581 28 0.4209 29 0.5098 30 0.6355 31 0.8133 32 1.0647 33 1.4203 34 1.9231 35 2.6342 36 3.6399 37 5.0621 38 6.9000
No. 1 2 3 4 5 6 7 8 9 10
Drawdown 0.111 0.197 0.261 0.314 0.361 0.404 0.444 0.482 0.518 0.551 0.579 0.602 0.616 0.624 0.513 0.427 0.363 0.310 0.263 0.221 0.181 0.144 0.108 0.076 0.048 0.026 0.012 0.004 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Pumps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2 2
Discharge 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
Simulations
4.17
-
x
I 8
k
)l
. Pc
. ~.
)
-.
-e~n
~
i4
x
.
'v I"
{;
i
x
~.
=8
..
-
~, en
x
o
-
. -. . N. ~. .
~
LO
D~awdown,
(\')
.
.."
Residual d.
.
LO
.
to
.
4.18
Simulations
4.2. Program verification To test that the program is operating correctly, enter the trial data shown below. Distance from discharging well to observation well, 20. Storage coefficient, 0.0004. Transmissivity, 200. Vertical hydraulic conductivity of aquitard, 0.01. Thickness of aquitard, 2. Discharge rate for the first step, 300. Finishing time of first step, 0.208 days (5 hrs.). Discharge rate for the second (last) step, O. Finishing time of the second step 6.9 days. Distance from the discharge well to the boundary, 150. Distance from the piezometer to the boundary, 155. With a discharge boundary specified, this should give the same output as that shown in table 4.6, and when plotted should produce a graph similar to figure 4.6. 5. A DISCHARGE TEST IN A CONFINED STRIP AQUIFER 5.1. Program SIM5 As in programs CONFSTRP and LEAKSTRP, the only boundaries used are discharge. This program will be found to be much slower than SIM3, especially as the total elapsed time of discharge increases. This is due to the radius of influence of the discharging well increasing, and the effect of more and more image wells having to be considered. 5.2. Program verification To check correct operation of the program, run it, and enter the following values. Distance from discharging well to observation well, 20. Storage coefficient, 0.0004. Transmissivity, 200. Number of discharge steps, 2. Discharge rate for the first step, 300. Finishing time of first step, 0.208 days (5 hrs.). Discharge rate for the second (last) step, O. Finishing time of the second step 6.9 days. Distance from the discharge well to the boundary, 150; (note that it does not matter which boundary is used, so long as the same one is used also for the next measurement). Distance from the piezometer to the same boundary, 155. Width of the aquifer, 280. These entries should give the same output as that shown in table 4.7, and when plotted against the logarith of time should result in a graph like figure 4.7a.
Simulations
4.19
Figure 4.7b is a plot of the calculated drawdowns against the square root of time, notice that after a time of about 36 minutes the drawdown plots fall in a straight line, and that the latter part of the recovery phase (toward the left) also falls on a straight line. It seems that if the drawdowns of a constant rate discharge test in a non leaky, confined, strip aquifer are plotted against the square root of time, the result will always be a straight line. It is for this reason that program DTPLOT includes the drawdown against root time option. Similarly, root t over root t1 residual drawdown also yields a straight line. The earlier parts of both lines are curved because of the small value of u at those times. I regret that I am unable to give a reference on this point.
No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Table 4.7 Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2080 0.2087 0.2097 0.2111 0.2130 0.2158 0.2197 0.2253 0.2331 0.2443 0.2600 0.2822 0.3136 0.3581 0.4209 0.5098 0.6355 0.8133 1.0647 1.4203 1.9231 2.6342 3.6399 5.0621 6.9000
Drawdown 0.112 0.199 0.265 0.321 0.372 0.422 0.474 0.532 0.601 0.681 0.775 0.888 1.021 1.167 1.057 0.973 0.910 0.858 0.813 0.773 0.733 0.692 0.648 0.602 0.552 0.502 0.451 0.400. 0.352 0.306 0.265 0.227 0.194 0.165 0.140 0.118 0.100 0.085
Pumps 1
1 1 1 1 1 1 1 1 1
1 1
1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
Q.
.
e,
C
Q.
CI CI
:::u
.§
A. 0
lilt
~
b
1.2
1.1
1
.9
.8
.7
.6
.5
.4
.3
.2
.1
0
-
1
L
l....-
I....-
l...-
L.....
L..-
L-
-
-
-
..-
L..-A A
~
It.
l-
-
Figure4.7a
T
I
I I
I
K
S
X
A
X
A
I
i m5rec. WTO
10
I I I
A
Tille, or tlt1
I
...
)( s i m5dd. WTO
)(
I
X
I
I
X
100
I I I I I
X
A
X
I
X
I
I
I
I
1000
110
.:=
to
g
~ .... III
I-'-
en
o
IV
..,
a..
IlII
c:
a..
c.o
CI
:::c
.
i:::J
~
IlII
c
1.2
1.1
1
•9
.8
.7
.6
.5
.4
.3
•2
.1
0
o
~
Figure 4.7b
•
4
pc
)(
•
..
)(
.
)(
-
36
• 5
64
)(
i m5rec. WTO
100
)(
Time, or (root t minus root t1)A2
1&
k
xsim5dd.WTO
144
...
. •
)(
196
• r-
256
-• )(
324
400
I\)
-'=
::s (jl
o
II>
.......
[
en
4.22
Simulations
6. A DISCHARGE TEST IN A LEAKY CONFINED STRIP AQUIFER 6.1. Program SIM6 This program is similar to SIM5, except that it is the Leaky Well Function that is solved here. As the radius of influence becomes larger with increasing time from the commencement of discharge, so the number of image wells that must be considered becomes larger. This means that for each total drawdown calculation in the latter part of the simulation, the greater the number of calls that will be required to evaluate the Leaky Well Function, and the greater the time taken. Hence this program will be found to be slow toward the later times; go away and make yourself a cup of coffee while it's running, you'll probably have time. Table 4.8 No. Time (days) 1 0.0001 2 0.0011 0.0031 3 4 0.0050 0.0018 5 6 0.0111 0.0113 1 8 0.0251 0.0363 9 10 0.0520 11 0.0142 12 0.1056 0.1501 13 14 0.2080 15 0.2081 16 0.2091 0.2111 11 18 0.2130 19 0.2158 20 0.2191 21 0.2253 22 0.2331 23 0.2443 24 0.2600 25 0.2822 26 0.3136 21 0.3581 28 0.4209 29 0.5098 30 0.6355 31 0.8133 1.0641 32 1.4203 33 34 1.9231 2.6342 35 36 3.6399 5.0621 31 38 6.9000
Drawdown 0.111 0.191 0.261 0.314 0.362 0.406 0.449 0.495 0.541 0.581 0.631 0.668 0.695 0.111 0.600 0.515 0.451 0.398 0·351 0.301 0.264 0.220 0.115 0.130 0.088 0.053 0.021 0.011 0.003 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Pumps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Discharge 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3·000E+02 3.000E+02 3.000E+02 3·000E+02 3·000E+02 3.000E+02 3·000E+02 O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO O.OOOE+OO
Simulations
4.23
8.,.. I-- ~-
I
X
•
tI
I
X
f-- l -I--
I J
I
.,..
)
+
1
.
I
_.
t-
-4
I
...j
~
•
Pc
I I
,~
,.. ~. X
.
1.1..
i
I 1--
•
( I)
tJ)
r- r-
Pc
..
-~
Iv
o
.
..-
1 N
LO
Drawdown, Residual d.
en
i.,.. . .,...
.,.. .,..
N
.1
J
' ,
1.2
o
I
!-
,----r--
1.1
4
-l
-, -
-"
36
64
.1
-,.~..
100
.1
1
~
~
144
.1
..
j
196
256
.1
324
400
.1==--J
j..,
r----
__
_...
_
-
-
_+--,_ __ -i-------, . ,, _ - r - - -, - - _~
x
.
_~
___ _ _
..J
. 1_ J _
...l...J,.
r---t-=
.
x
J
.1 " j. .1 l ".1 • -t. .1
Tille, or (root t minus root t1) "2
16
.1.1
.
==={= +-----,--
. ----,
.l
.1 J
~
-'
r---. . r--- --, ,
'
' I .1 '--..:.L ' .1
'
J '.1
' t
1
.8
·a.
..
~
.1
.1
.SIM6rec.1fTD
'~
'• '
-I
,
x 5I W6dd•lITO
.9
.7
.6
.5
.4
.3
e-..
II
:0
;::,
e-• •
c ~
L
.2 L11----'
.1
o
Fig. 4.Bb
to
::s
.... o ~
III
~
en ....
a
I\)
..,. ..,.
Simulations
4.25
6.2. Program verification Trial data of; Distance from discharging well to observation well, 20; Storage coefficient, 0.0004; Transmissivity, 200; Vertical hydraulic conductivity of aquitard, 0.01; Thickness of aquitard, 2; Discharge rate for the first step, 300; Finishing time of first step, 0.208 days (5 hrs.); Discharge rate for the second (last) step, 0; Finishing time of the second step (finishing time of the test), 6.9 daysj Distance from the discharge well to the boundary, 150; Distance from the piezometer to the same boundary, 155; Width of the aquifer, 280j should give the same output as that shown in table 4.8, and when plotted should look like the graph of figure 4.8a. Figure 4.8b is a plot of drawdown against square root of time. 7. DRAWDOWN IN A PUMPED WELL IN A CONFINED AQUIFER. As explained in the opening remarks of this chapter, this program differs from the other SIM programs. Neither the Well Function, nor the Leaky Well Function are used. The simpler Well Equation is used instead. The Well Equation can be used to calculate approximate drawdown at any given time, and for any given discharge rate, in a fUlly penetrating discharging well in an infinite, homogeneous, confined aquifer. It may also be usefUlly applied in many cases that do not fully fit these restrictions (which is handy, as no real well/aquifer combination does fit them) so long as it is not pushed too far. ie. The greater the extrapolation from the data used to produce the Well Equation, the greater will be the errors. The use of the Well Equation implies that the simplifying assumption that drawdown is proportional to the logarithm of time has been made. This assumption is valid only for small values of u. This assumption is unlikely to cause significant errors because u is proportional to the square of either the distance of the piezometer from the discharging well in the case of drawdown in a piezometer, or the effective radius of the discharging well in the case of a pumped well. The value of u will be small even at early times. The Well Equation, as stated in earlier chapters, has the form; s
= AQ
+ BQ LOG(t) + CQ power n,
where s is the drawdown (in metres), Q is the discharge rate (in cubic metres per day), t is time (in minutes), and A, B, C, and n are constants, with the assumption commonly being made that n is equal to 2. The constants in the Well Equation are usually
4.26
Simulations
evaluated empirically by methods such as those used in chapters six and seven. The third term is referred to as the well loss term, and is usually considered to be associated with that part of the drawdown that is due to turbulent flow that may occur in the well, the surrounding developed zone, and perhaps the parts of an aquifer closest to the well. In a fractured rock aquifer in particular, turbulent flow could occur at a fair distance from the well. Using this equation, it is possible (in theory) to directly calculate the drawdown in the discharging well at any time after starting a pump which discharges at a constant rate. 1.1. Program SlM1 The greater part of SIM1 is identical to SIM1. The differences are mainly in the keyboard input section, where the constants of the Well Equation are entered rather than aquifer constants, and in the control section. Also, this program does not require the subroutine for solution of the Well Function, as the calculations are simple they are done in the control section itself, a subroutine for calculations was not felt to be justified. In applying it to a mUlti-rate discharge situation, two features of the Well Equation had to be given special consideration. The second term gives the drawdown component due to time elapsed since the beginning of pumping. It was decided to use the multiple pump model explained above to calculate the drawdown due to each pumping stage, with each component being summed to produce the total drawdown due to time of pumping. These calculations are done in lines 250 to 280. As the third term is proportional to a power of the total discharge rate it had to be calculated on that total, rather than as a sum of parts. The calculation of the third term is done in line 300. The first term could be calculated as a sum, or based on the total discharge rate. It was simplest to use the total. The calculation is done in line 290. 1.2. Program verification On running the program, enter values of;
A = 0.01, B = 0.015, C = 0.0001, and n = 2 as the constants of the Well Equation. For the discharging stages enter; stage 1, Q 100, t = 0.05, stage 2, Q 200, t = 0.1, stage 3, Q = 300, t 0.15, and stage 4, Q 400, t = 1 • (ie. Discharge starts at t = 0, and changes from 100 cubic metres per day to 200 cubic metres per day at 0.05 days, from 200 to 300 at 0.1 days, etc.)
Simulations
4.27
Table 4.9 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Time (days) Drawdown Pumps Discharge 0.0007 2.000 1 1.000E+02 0.0017 2.574 1 1.000E+02 0.0031 2.967 1 1.000E+02 0.0050 3.290 1 1.000E+02 0.0078 3.576 1 1.000E+02 0.0117 3.842 1 1.000E+02 0.0173 4.094 1 1.000E+02 0.0251 4.338 1 1.000E+02 0.0363 4.577 1 1.000E+02 0.0500 4.786 1 1. 000E+02 0.0507 8.795 2 2.000E+02 0.0517 9.382 2 2.000E+02 0.0531 9.792 2 2.000E+02 0.0550 10.138 2 2.000E+02 0.0578 10.457 2 2.000E+02 0.0617 10.765 2 2.000E+02 0.0613 11.014 2 2.000E+02 0.0751 11.390 2 2.000E+02 0.0863 11.718 2 2.000E+02 0.1000 12.024 2 2.000E+02 0.1007 18.037 3 3.000E+02 22 0.1017 18.630 3 3.000E+02 0.1031 19.049 3 3.000E+02 23 24 0.1050 19.408 3 3.000E+02 0.1078 19.743 3 3.000E+02 25 0.1117 20.015 3 3.000E+02 26 0.1173 20.415 3 3.000E+02 27 0.1251 20.713 3 3.000E+02 28 0.1363 21.157 3 3.000E+02 29 0.1500 21.525 3 3.000E+02 30 0.1507 29.542 4 4.000E+02 31 0.1517 30.139 4 4.000E+02 32 0.1531 30.564 4 4.000E+02 33 0.1550 30.931 4 4.000E+02 34 0.1578 31.218 4 4.000E+02 35 0.1617 31.626 4 4.000E+02 36 0.1673 31.988 4 4.000E+02 37 0.1751 32.376 4 4.000E+02 38 0.1863 32.800 4 4.000E+02 39 0.2020 33.267 4 4.000E+02 40 41 0.2242 33.784 4 4.000E+02 42 0.2556 34.355 4 4.000E+02 0.3001 34.979 4 4.000E+02 43 44 0.3629 35.655 4 4.000E+02 0.4518 36.378 4 4.000E+02 45 46 0.5775 37.141 4 4.000E+02 0.7553 37.938 4 4.000E+02 47 1.0000 38.742 4 4.000E+02 48 Program output should be close to that of table 4.9, shown graphically in figure 4.9. (As a matter of interest, if this data is then analysed using pr-ogr-am STRNBRG, t.r.e conat.ant s of the Well Equat.Lon wi Jl be r-ecover-ee with hi e,b accur-acy , but if the data is converted to simulate full recovery between stages using option 8, menu 1 of program DTDHA, then analysed using either option 5b or 6 of IDemu 3 of that program, approximate values will be obtained
4.28 Simulations
)(
CJ CJ CJ
X It )( )(
X
)(
..
)( )(
.- r
>1,1 CJ CJ
v )(
)(
)(
)(
~
C)
u,
o
CJ
o
N
o
(Y)
o
'q"
Drawdown, Residual d.
CJ
ltl
CJ tD
Simulations
4.29
for the constants. The loss of accuracy is due to the imperfect nature of the method used for conversion. (It is very likely that the loss of accuracy will be insignificant in comparison to errors in measurement, and due to the imperfect fit between model and real world.) I suspect that the accuracy of conversion would be increased by using lengthening stages rather than constant length stages. Unfortunately, in the case of a real world aquifer, this might introduce errors due to the inexact fit between model and aquifer. 8. USAGE OF VARIABLES IN THE SIM PROGRAMS 8.1. Variables in programs SIM1. 3. 5. and 7 Name Fu!lcti~o~n _ A A general purpose variable to hold values temporarily. A1 As above. AA The value of the first term of the Well Equation. BB The value of the second term of the Well Equation. CO - C9 Constants used in the solution of the Well Function. CC The value of the third term of the Well Equation. CS Coefficient of storage. D(x) This vector holds all drawdown values so that they can be saved to disk at the end of calculations if so desired. ego DD(10) is the tenth calculated drawdown. D1, D2 Used in the calculation of the distance of the next observation well. See the notes on STRIPCAL for more details. DD Holds the calculated drawdown for the current pump, time, and image well. DE This variable holds the sum of drawdowns calculated for the current pump and time, for all image wells. DF Accumulates the total drawdown for all pumps, and image wells at the current ti~e. Holds the number of strip widths to be considered in the DR calculation of the distance from the observation point to the current image well. This variable is used to flag the side of the strip aquifer F3 presently under consideration. It is set to zero for the first side, and to one for the second side. FP Flag for print-out. This flag is set if the user has expressed a wish for a print-out of results. This flag is toggled back and forth from zero to one with the FT calculation of each image well. It's value at a given time depends upon which boundary, left or right, was responsible for the most recent reflection. G1 A string variable holding a format for the printing or displaying of a numeric value. The primary (integer) counter. I
4.30
SimUlations
The primary 'second level' counter. This is used so that the primary or secondary counters may be used in subroutines without altering this value. The secondary 'second level' counter. JJ This integer counter holds the number of pumps currently being KS considered. The value of the exponent in the Well Equation. N Holds the total number of datum sets. ND The file name. NM$ Holds the number of pumping steps. NS P(x) The discharge rate of pump number x. Has the constant Pi. PI Q Holds the discharge rate of the current pump. Q(x) This vector holds the discharge rate at time T(x). The discharge rate at pumping step number x. Q1(x) from the observation well (piezometer) to the The distance R discharging well. In the first place this is used to hold the distance between the real wells, but it is also used to pass the distance to the subroutine that calculates the value of u. The distance from the discharging well to a boundary. Which R1 boundary is used is of no concern, except that it must be the same one as is used in R2 below. The distance from the observation well to the same boundary as in R2 R1 above. R3 The distance component along the length of the strip, between the discharging well and the observation well. R4 The total distance between the current image well and the discharging well. R5 This variable is used to retain the original value of R while that variable is used in the calculation of the current value of u. R6 The Width of the strip aquifer. RT Root two. This value is used to increment the time for the next drawdown calculation. It has no special significance, and could be reduced if more drawdown plots are required, or increased if fewer drawdown plots will suffice. SO A string variable holding the heading for the printed output. SY Holds the string used for yes/no response handling. T Transmissivity. T(x) The time relating to time/drawdown/discharge-rate set number x. TI The time of the current drawdown calculation. TI(x) The finishing time of step number x. ie. the number of time units after commencement of discharge. TL The tolerance. Set equal to 10 000 in these programs, but may be altered as required. The current series of image wells will be terminated when the calculated dra\mown due to the current image well, multiplied by TL, is less than the accumulated drawdown due to the discharge well and all image wells thus far considered. (It is the II
Simulations
TM TP
TS
U
U2, W
Z$,
4.31
absolute value of the drawdown that is considered.) The current time. ie. the total accumulated time from the commencement of the first pump. The primary time increment, and the time of the first drawdown calculation. In these programs TP is set to 1/1440 time units (or one minute, on the assumption that times will be entered in days). This may be changed as required. The secondary time increment. This is the time that is added to the time of the previous drawdown calculation, to calculate the current time. It is incremented at each drawdown calculation. is given the value of the u of the Theis equation. U2 The values of u squared and u cubed respectively. The value calculated for the Well Function. ZX, ZZ$, are used in the handling of single key responses.
8.2. Varijl.]lles-l.!!-.-2.!'.Qgrams SIM2, 4. and 6 The variables described above are used for the same purposes, but in addition, all the variables needed for the solution of the Leaky Artesian Well Function are used. The use of these is explained in the notes on program LEAKFUNC. In the notes above, and in general throughout this book, the word 'current' is used to indicate 'that which is at present being considered'. ego The 'current image well' means the image well who's effect is being calculated at the time. Also, the 'pump' as used above is the imaginary pump used to simulate an increase or decrease in discharge rate, as explained earlier in this chapter. 9. 9.1.
PROGRAM LISTINGS A discharge test in a confined aquifer. program SIM1
REM ••••• SIM1.BAS ••••• 2 REM • Last modified 18/10/85 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM T(200),D(200),Q(200) 40 CLS 50 REM -- Preliminary print statements -60 PRINT" Simulation of mUlti-stage discharge test in a confined" 70 PRINT"aquifer." 80 GOSUB 8600:REM # Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM # Input section 220 IF FP=1 THEN LPRINT TAB(7);SO:REM # Printer heading 230II=1:TP=1/1440:TS=TP:TM=TP:KS=1 240 FOR JJ=1 TO KS
4.32 Simulations 250 Q=P(JJ):TI=TM-TI(JJ-1) 260 GOSUB 500:REM # Solve for current 'pump'. 280 DF=DF+DD 290 NEXT JJ 300 T(II)=TM:D(II)=DF:Q(II)=Q1(KS):DF=0 310 GOSUB 7250:REM # Video output 320 IF FP=1 THEN GOSUB 7500:REM # Printer output 330 II=II+1 340 IF TM=TI(NS) THEN 390:REM # Finished calculations 350 IF TM=TI(KS) THEN TM=TI(KS)+TP:TS=TP:KS=KS+1:GOTO 240:REM # Next step 360 TS=TS·RT:TM=TM+TS:REM # Next reading 370 IF TM>TI(KS) THEN TM=TI(KS):REM # Get last reading for step 380 GOTO 240 390 ND=II-1 400 PRINT"Do you want the data saved in a disc file?" 410 Z$=SY:GOSUB 9800lIF ZX>2 THEN 9999 420 GOSUB 8250:REM # Save to disc 430 PRINT"Another save?":Z$=SY:GOSUB 9800 440 IF ZX<3 THEN 420 ELSE 9999 _ 500 REM === Second part of control section 520 GOSUB 3000:REM # Calculate u 530 IF U>80 THEN DD=O:GOTO 570:REM # Excessive u 540 GOSUB 2500:REM # Solve for W(u) 550 GOSUB 3030:REM # Calculate drawdown 570 RETURN 2500 REM == Subroutine W(u) == 2510 U2=U.U:U3=U.U2:IF U<1 THEN 2540 2520 W=1/(U.EXP(U)).(C6+C7·U+U2)/(C8+C9·U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1.U+C2.U2+C3·U3+C4·U2.U2+C5.U2·U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U=R·R·CS/(4·T·TI) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q·W/(4·PI.T) 3050 RETURN 7000 REM === Input section === 7010 PRINT 7020 PRINT"Please enter all figures in consistent units." 7030 PRINT"Maximum of ten pumping steps." 7040 PRINT 7050 PRINT"Distance of observation point from disoharging" 7060 INPUT" well"jR 7070 INPUT"Storage coefficient"iCS 7080 INPUT" Transmissivity"jT 7090 INPUT"Number of pumping steps"iNS
Simulations 7100 1110 1120 1130 1140 7150 7160 1170 7180 1240 7250 1260
FOR 1=1 TO NS PRINT:PRINT"Step No.";I INPUT"Discharge rate";Q1(I) IF 1=1 THEN P(1)=Ql(1) ELSE P(I)=Ql(I)-Ql(I-l) INPUT"Finishing time (days)"jTI(I) NEXT I PRINT"Do you want a paper copy of the data?" Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=l ELSE FP=O PRINT: PRINT"Working '. . ." RETURN REM === Video output section _ PRINT"No.";II ;TAB( 8); "Time" jT(II) ;TAB(21)j "Drawdown" ;D(II) jTAB(50);"Pumps";KS 1490 RETURN 7500 REM === Printer output === 7510 LPRINT TAB(1)jUSING G1;II;T(II);D(II)jKS;Q(II) 1520 IF INT(II/58)<>II/58 THEN 1740 1530 FOR 1=1 TO 7:LPRINT:NEXT I 7540 LPRINT TAB(1);SH 7140 RETURN 8250 REM === Store data on disc _ 8260 GOSUB 9600 8210 OPEN"O" ,#1 ,NM$ 8280 PRINT#1,3,2,R,ND 8290 FOR 1=1 TO ND:PRINT#1,T(I)*1440,D(I),Q(I):NEXT I 8300 CLOSE 8310 RETURN 8600 REM === Assign values to variables === 8610 CO=-.51721566#:C1=.99999193#:C2=-.24991055#:C3=5.519968E-02 8620 C4=-9.16004E-03:C5=1.01851E-03 8630 C6=.250621:C1=2.334133:C8=1.681534:C9=3.330651 8640 PI=3.1415921#:RT=1.4142136#:SY="YyNn" Time (days) Drawdown Pumps Discharge" 8650 SH="No. 8655 Gl="### ####.#### ###.### ### ##.### •••• " 8660 RETURN 9600 REM === File name === 9610 PRINT"What file name (without the extension)?" 9620 PRINT"NOTE : The name is a max. of 8 characters, must consist of only" 9630 INPUT"letters and numerals, and must start with a letter"jNM$ 9640 IF LEN(NM$»8 THEN PRINT:PRINT"Too 10ng":PRINT:GOTO 9610 9650 A=ASC(LEFT$(NM$,l»:IF A<65 OR A>122 OR (A>90 AND A<91) THEN PRINT:PRINT"First character unacceptable":PRINT:GOTO 9610 9660 IF LEN(NM$)=l THEN 9110 9670 FOR A1=2 TO LEN(NM$) 9680 A=ASC(MID$(NM$,Al,l» 9690 IF A<48 OR A>122 OR (A>51 AND A<65) OR (A>90 AND A<91) THEN PRINT:PRINT"No.";A1;" character unacceptable.":PRINT:GOTO 9610
4.33
4.34 9700 9710 9800 9810 9820 9830 9840 9850 9999
Simulations NEXT A1 NM$=NM$+".WTD":RETURN REM -- Await valid key ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$="" THEN 9820 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END 9.2.
A discharge test in a leaky confined aquifer, SIM2
1 REM ••••• SIM2.BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM T(200),D(200),Q(200),G(40),C1(15),C2(15) 40 CLS 50 PRINT" Simulation of a multi-stage discharge test in a leaky" 60 PRINT"confined aquifer." 70 PRINT" Storage in the aquitard is neglected." 80 PRINT:PRINT" Loading constants; please wait." 90 GOSUB 8600:REM # Assign values to variables. 100 GOSUB 8800:REM # All other constants 200 REM === Program control === 210 220 These lines are identical to those in SIM1. 230 500 REM === Program control === 530 GOSUB 3000:REM # Calculate u, RB 540 IF U1>80 THEN DD=O:GOTO 570:REM # Excessive u 550 GOSun 5000:REM # Solve for W(u,rb) 560 GOSUB 3030:REM # Calculate drawdown 580 RETURN 2500 REM == Subroutine W(u) == 2510 U2=U'U:U3=U~U2:IF U<1 THEN 2540 2520 W=1/(U*EXP(U))'(C6+C7'U+U2)/(C8+C9'U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1'U+C2'U2+C3'U3+C4*U2'U2+C5*U2'U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U1=R'R'CS/(4'T*TI):RB=R/SOR(T/(VK/TB)) 3020 RETURN 3030 REM === Calculation of dd given W, 0, & T 3040 DD=Q*W1/(4*PI*T) 3050 RETURN 5000 REM === Group of subroutines for function W(u,RB) _
Simulations 5010 5020 5030 5040 5050 5060 5070 5080 5090 5100 5110 5120 5130 5140 5150 5160 5170 5180 5190 5200 5210 5220 5230 5240 5250 5260 5270 5280 5290 5300 5400 5410 5420 5430 5440 5450 5460 5470 5480 5490 5500 5510 5520 5530 5540 5550
REM -- Controlling subroutine IF U1>=1 THEN 5050 IF RB*RB>U1 THEN 5070 GOTO 5100 GOSUB 5190:REM Leaky H W1=HJ:GOTO 5180 GOSUB 5190:REM Leaky H 1 GOSUB 5400:REM Bessel, 2 W1=2*AKH-HJ:GOTO 5180 GOSUB 5400:REM Bessel, 2 GOSUB 5530:REM Bessel, 1 GOSUB 5640:REM Leaky H 2 H1=RB*RB*C(31)/U1 U=H1:GOSUB 2500:REM Subroutine W(u) HA=W U=U1:GOSUB 2500:HC=W:REM Subroutine W(u) W1=2*AKH-AIH*HA+EXP(-H1)*(C(32)+LOG(U1)+HC-U1+ U1*«AIH-1)/(RB*RB*C(31»)-U1*U1*HK) RETURN REM -- Subroutine Leaky H 1 -B=RB*RB:HP=O:HJ=O 1=1 IF U1<1 THEN 5250 A=1/(U1+C1(I»:HO=A*EXP(-(U1+B*A*C(31)+C1(I») IF HO<=O THEN 5310 ELSE 5280 HN=C(31)*RB*RB*(1/U1):A=1/(HN+C1(I» HO=A*EXP(-(HN+B*A*C(31)+C1(I»):H2=HO IF H2<=O THEN 5310 HP=HP+HO*C2(I) I=I+1:IF 1<16 THEN 5220 HJ=HP 5310 RETURN REM -- Modified Bessel, second kind, zero order -IF RB>2 THEN 5480 TJ=RB/2:GOSUB 5530:REM Bessel, 1 A2=TJ*TJ:A4=A2*A2 B1H=C(1)+C(2)*A2+C(3)*A4+C(4)*A2*A4+C(5)*A4*A4 B2#=C(6)*A4*A4*A2+C(7)*A4*A4*A4 AK#=-LOG(TJ)*AI#+B1#+B2# GOTO 5520 TN=2/RB:A2=TN*TN:A3=TN*A2 B1#=C(8)+C(9)*TN+C(10)*A2+C(11)fiA3 B2#=C(12)*A2*A2+C(13)*A2*A3+ C(14)*A3*A3 AK#=1/SQR(RB)*EXP(-RB)*(B1#+B2#) RETURN REM -- Modified Bessel, first kind, zero order -TF=RB/C(3G):A2=TF*TF:IF RB<=C(30) THEN 5590 ELSE A3=A2*TF B1#=C(15)+C(16)*(1/TF)+C(17)*(1/A2)+C(18)*(1/A3)+C(19) *( 1/ (A2*A2»
4.35
4.36
Simulations
5560 B2#=C(20)*(1/(A2*A3»+C(21)*(1/(A3*A3»+C(22)*(1/(A3*A2*A2» +C(23)*(1/(A3*A3*A2» 5570 AI#=1/SQR(RB)*EXP(RB)*(B1#+B2#) 5580 GOTO 5630 5590 A4=A2*A2 5600 B1#=C(24)*A2+C(25)*A4+C(26)*A2*A4 5610 B2#=C(27)*A4*A4+C(28)*A4*A4*A2+C(29)*A4*A4*A4 5620 AI#=1+B1#+B2# 5630 RETURN 5640 REM -- Subroutine Leaky # 2 -5650 HK=0:HI=RB*RB*C(31) 5660 FOR J=1 TO 5:FOR K=1 TO J 5670 H6=J-K+1:H9=J+2:GOSUB 5730:BF=H3 5680 H9=H6:GOSUB 5730:AF=H3 5690 HG=-1"(J+K)*AF/(BF*BF)*HI 5700 HK=HK+HG:IF HG<1E-08 THEN K=J:J=5:GOTO 572 5710 NEXT K:NEXT J 5720 RETURN 5730 REM -- Subroutine Leaky # 3 -5740 H3=1:IF H9=1 THEN 5760 5750 FOR 1=2 TO H9:H3=H3*I:NEXT I 5760 RETURN 7000 REM === Input section === 7010 PRINT 7020 PRINT"Please enter all figures in consistent units." 7030 PRINT"Maximum of ten pumping steps." 7040 PRINT 7050 PRINT"Distance of observation point" 7060 INPUT"from discharging well"jR 7070 INPUT" Storage coefficient"jCS 7080 INPUT" Transmissivity"jT 7090 PRINT"Vertical hydraulic conductivity" 7100 INPUT" of aquitard" jVK 7110 INPUT"Thickness of aquitard"jTB 7120 INPUT"Number of pumping steps"jNS 7130 FOR 1=1 TO NS 7140 PRINT:PRINT"Step No."jI 7150 INPUT"Discharge rate"jQ1(I) 7160 IF 1=1 THEN P(1)=Q1(1) ELSE P(I)=Q1(I)-Q1(I-1) 7170 INPUT"Finishing time (days)";TI(I) 7180 NEXT I 7190 PRINT"Do you want a paper copy of the data?" 7200 Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=1 ELSE FP=O 7210 PRINT:PRINT"Working . . . " 7240 RETURN 7250 REM === Video output section AK*U1 A ( J - K )
Simulations 7260 PRINT"No." i II iTAB(8) i "Time" .r (II) iTAB( 27) i "Drawd own " iD(II) iTAB( 50) i "Pumps"iKS 7490 RETURN 7500 REM === Printer output _ 7510 LPRINT TAB(7)iUSING G1iIIiT(II)iD(II)iKSiQ(II) 7520 IF INT(11/58)<>11/58 THEN 7740 7530 FOR 1=1 TO 7:LPR1NT:NEXT I 7540 LPR1NT TAB(7)iSH 7740 RETURN 8250 REM === Store data on disc _ 8260 GOSUB 9600 82700PEN"0",I1,NM$ 8280 PR1NTU1,3,2,R,ND 8290 FOR 1=1 TO ND:PR1NTI1,T(1).1440,D(1),Q(1):NEXT I 8300 CLOSE 8310 RETURN 8600 REM === Assign values to variables === 8610 8620 These lines are identical to those in 81M1. 8630 8640 P1=3.1415927il:RT=1.41421361:SY="YyNn" 8650 SH="No. Time (days) Drawdown Pumps Discharge"
8655 G1="IUU 8660 8800 8810 8840
IUUI.IIIU
UUU.HUI
UUI
IU.III····"
RETURN REM === Read constants _ FOR 1=1 TO 32:READ C(1):NEXT I DATA -.57721566,.4227842,.23069756,.0348859,.00262698,1.075E-4, 7.4E-6,1.253314,-.07832358,.02189568 8850 DATA -.01062446,5.87872E-3,-2.5154E-3,5.3208E-4,.39894228, .01328592,2.25319E-3,-1.57565E-3,9.16281E-3,-.02057706 8860 DATA .02635537,-.01647633,3.92377E-3,3.5156229,3.0899424, 1.2067492,.2659732,.0360768,4.5813E-3 8870 DATA 3.75,:25,.5772 8880 REM -- Load C1(x) and C2(x) constants -8890 FOR 1=1 TO 15:READ C1(1):NEXT 8900 DATA .093307812,.49269174,1.2155954,2.2699495,3.6676227 8910 DATA 5.4253366,7.5659162,10.120228,13.130282,16.654407 8920 DATA 20.776478,25.623894,31.407519,38.530683,48.026085 8930 FOR 1=1 TO 15:READ C2(1):NEXT 8940 DATA .23957817,.56010084,.88700826,1.2236644,1.5744487 8950 DATA 1.9447519,2.341502,2.7740419,3.2556433,3.8063117 8960 DATA 4.4584777,5.2700177,6.3595634,8.0317876,11.527772 8970 RETURN 9600 REM === File name === 9610 9620 These lines are identical to those in S1M1. 9850 9999 END
4.37
4.38
Simulations 9.3.
A discharge test in a bounded confined aquifer, SIM3
REM ••••• SIM3.BAS ••••• 2 REM. Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM T(200),D(200),Q(200) 40 CLS 50 PRINT" Simulation of a multi-stage discharge test in a confined" 80 PRINT"aquifer. One discharge/recharge boundary is present." 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM n Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM n Input section 220 IF ABS(R1-R2»R THEN GOSUB 9060:GOTO 200:REM n Distances wrong 230 IF FP=1 THEN LPRINT TAB(7)jSH:REM # Printer heading 240 II=1:TP=1/1440:TS=TP:TM=TP:KS=1 250 FOR JJ=1 TO KS 260 Q=P(JJ):TI=TM-TI(JJ-1) 270 GOSUB 500:REM # Solve for current 'pump'. 290 DF=DF+DD 300 NEXT JJ 310 T(II)=TM:D(II)=DF:Q(II)=Q1(KS):DF=0 320 GOSUB 7250:REM # Video output 330 IF FP=1 THEN GOSUB 7500:REM # Printer output 340 II=II+1 350 IF TM=TI(NS) THEN 400:REM # Finished calculations 360 IF TM=TI(KS) THEN TM=TI(KS)+TP:TS=TP:KS=KS+1:GOTO 250:REM n Next step 370 TS=TS·RT:TM=TM+TS:REM # Next reading 380 IF TM>TI(KS) THEN TM=TI(KS):REM # Get last reading for step 390 GOTO 250 400 ND=II-1 410 PRINT"Do you want the data saved in a disc file?" 420 Z$=SY:GOSUB 9800:IF ZX>2 THEN 9999 430 GOSUB 8250:REM # Save to disc 440 PRINT"Another save?":Z$=SY:GOSUB 9800 450 IF ZX<3 THEN 430 ELSE 9999 500 REM === Second part of control section _ 510 REM -- Discharge well section -520 GOSUB 3000:REM # Calculate u 530 IF U>80 THEN DD=O:GOTO 560:REM # Excessive u 540 GOSUB 2500:REM # Solve for W(u) 550 GOSUB 3030:REM # Calculate drawdown 560 DE=DD 570 REM -- Image well section -580 GOSUB 3300:REM # Calculate distance of image well 590 R5=R:R=R4:REM # Save R, send R4 to subroutine
Simulations 600 GOSUB 3000:REM # Calculate u 610 IF U>80 THEN DD=O:GOTO 630:REM # Excessive u 620 GOSUB 2500:GOSUB 3030:REM # Solve for W(u), calc. dd 630 R=R5:REM # Restore R 640 IF F2=0 THEN DD=DD+DE ELSE DD=DE-DD 650 RETURN 2500 REM == Subroutine W(u) == 2510 2520 These lines are identical to those in SIM1. 2550 3000 REM === Calculation of u given R, S, T, & TI === 3010 U=R*R*CS/(4*T*TI) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T _ 3040 DD=Q*W/(4*PI*T) 3050 RETURN 3300 REM === Calculate distance to image well _ 3310 R3=SQR(R*R-(R1-R2)*(R1-R2» 3320 R4=SQR«R1+R2)*(R1+R2)+R3*R3) 3330 RETURN 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistent units.", 7020 PRINT"Distance of observation point from discharging" 7030 INPUT" well";R 7040 INPUT" Storage coefficient";CS 7050 INPUT" Transmissivity"iT 7060 INPUT"Number of pumping steps"iNS 7070 FOR 1=1 TO NS 7080 PRINT:PRINT"Step No."iI 7090 INPUT"Discharge rate";Q1(I) 7100 IF 1=1 THEN P(1)=Q1(1) ELSE P(I)=Q1(I)-Q1(I-1) 7110 INPUT"Finishing time (days)"iTI(I) 7120 NEXT I 7130 PRINT"Distance from discharge well to" 7140 INPUT" boundary" ; R1 7150 PRINT"Distance from observation well to" 7160 INPUT" boundarY"iR2 7170 PRINT"ischarge or echarge boundary?" 7180 Z$="DdRr":GOSUB 9800:REM fJ Single key input 7190 IF ZX<3 THEN F2=0 ELSE F2=1 7200 PRINT"Do you want a paper copy of the data?" 7210 Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=1 ELSE FP=O 7220 PRINT: PRINT"Working . • . ." 7240 RETURN 7250 REM === Video output section --7260 PRINT"No." iII iTAB(8)i "Time" iT(II) ;TAB(27); "Drawdown" iD(II) i TAB(50);"Pumps"iKS
4.39
4.40 7490 7500 7510 7520 7530 7540 7740 8250 8260 8270 8280 8290 8300 8600 8610 8620 8630 8640 8650
Simulations RETURN REM === Printer output === LPRINT TAB(7);USING Gl;IIjT(II)jD(II)jKSjQ(II) IF INT(II/58)<>II/58 THEN 7740 FOR 1=1 TO 7:LPRINT:NEXT I LPRINT TAB(7)jSH RETURN REM === Store data on disc GOSUB 9600 OPEN"O" ,111 ,NM$ PRINTH1,3,2,R,ND FOR 1=1 TO ND:PRINTH1,T(I)*1440,D(I),Q(I):NEXT I CLOSE 8310 RETURN REM === Assign values to variables === These lines are identical to those in SIM1. PI=3.1415927H:RT=1.4142136H:SY="YyNn" SH="No. Time (days) Drawdown Pumps
8655 Gl="HHH HHIH.HHHH 8660 9060 9070 9080 9600 9610 9620 9840 9999
'HH.HHH
HHH
Discharge"
HH.HHH····"
RETURN REM -- Impossible combination of distances PRINT"There is an error in the entered distancesl" RETURN REM === File name These lines are identical to those in 3IM1. END 9.4.
A discharge test in a leaky bounded aquifer, SIM4
REM ••••• SIM4.BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM T(200),D(200),Q(200),C(40),Cl(15),C2(15) 40 CLS 50 PRINT" Simulation of a multi-stage discharge test in a leaky" 60 PRINT"confined aquifer. One discharge/recharge boundary is present."" 70 PRINT" Storage in the aquitard is neglected." 80 PRINT:PRINT" Loading constants; please wait." 90 G03UB 8600:REM , Assign values to variables. 100 GOSUB 8800:REM H All other constants
Simulations 200 REM === Program control === 210 220 These lines are identical to those in SIM3. 450 500 REM === Second part of control section _ 510 REM -- Discharge well section -520 GOSUB 3000:REM # Calculate u, RB 530 IF U1>80 THEN DD=O:GOTO 560:REM # Excessive u 540 GOSUB 5000:REM # Solve for W(u,RB) 550 GOSUB 3030:REM # Calculate drawdown 560 DE=DD 570 REM -- Image well section -580 GOSUB 3300:REM # Calculate distance of image well 590 R5=R:R=R4:REM # Save R, send R4 to subroutine 600 GOSUB 3000:REM # Calculate u, RB 610 IF U1>80 THEN DD=O:GOTO 630:REM # Excessive u 620 GOSUB 5000:GOSUB 3030:REM # Solve for W(u), calc. dd. 630 R=R5:REM # Restore R 640 IF F2=0 THEN DD=DD+DE ELSE DD=DE-DD 650 RETURN 2500 REM == Subroutine W(u) == 2510 2520 These lines are identical to those in SIM2. 3050 3300 REM === Calculate distance to image well === 3310 R3=SQR(R*R-(R1-R2)*(R1-R2)) 3320 R4=SQR«R1+R2)*(R1+R2)+R3*R3) 3330 RETURN 5000 REM === Group of subroutines for function W(u,RB) 5010 5020 These lines are identical to those in SIM2. 5760 7000 REM === Input section === 7010 PRINT 7020 PRINT"Please enter all figures in consistent units." 7030 PRINT"Maximum of ten pumping steps." 7040 PRINT 7050 PRINT"Distance of observation point" 7060 INPUT"from discharging well";R 7070 INPUT" Storage coefficient";CS 7080 INPUT" Transmissivity";T 7090 PRINT"Vertical hydraUlic conductivity" 7100 INPUT" of aquitard";VK 7110 INPUT"Thickness of aquitard";TB 7120 INPUT"Number of pumping steps";NS 7130 FOR 1=1 TO NS 7140 PRINT:PRINT"Step NO.";I
4.41
4.42 7150 7160 7170 7180 7182 7184 7186 7188 7190 7192 7194 7196 7200 7210 7240 7250 7260 7490 8660 8800 8810 8840 8850 8970 9060 9070 9080 9600 9610 9620 9999
Simulations INPUT"Discharge rate"jQ1(I) IF 1=1 THEN P(l)=Ql(l) ELSE P(I)=Ql(I)-Ql(I-l) INPUT"Finishing time (days)"jTI(I) NEXT I PRINT"Distance from discharge well" INPUT"to boundary"jRl PRINT"Distance from observation well" INPUT"to boundary"jR2 PRINT"ischarge or echarge boundary?" Z$="DdRr":GOSUB 9800:REM IJ Single key input IF ZX<3 THEN F2=0 ELSE F2=1 PRINT"Do you want a paper copy of the data?" Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=l ELSE FP=O PRINT:PRINT"Working . . . " RETURN REM === Video output section These lines are identical to those in SIM1. REM --- Read constants === FOR 1=1 TO 32:READ C(I):NEXT I These lines are identical to those in SIM2. REM -- Impossible combination of distances PRINT"There is an error in the entered distances!" RETURN REM === File name _ These lines are identical to those in SIM1.
9.5.
~_gjscharge
test in a confined strip aquifer, SIM5
REM ***** SIM5.BAS ***** 2 REM * Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40),T(200),D(200),Q(200) 40 CLS 50 PRINT" Simulation of a mUlti-stage discharge test in a confined" 60 PRINT"strip aquifer." 80 PRINT 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM IJ Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM IJ Input section
Simulations
4.43
220 IF ABS(R1-R2»R THEN GOSUB 9060:GOTO 200:REM # Distances wrong 230 IF FP=l THEN LPRINT TAB(7)jSH:REM # Printer heading 240 II=1:TP=1/1440:TS=TP:TM=TP:KS=1 250 FOR JJ=1 TO KS 260 Q=P(JJ):TI=TM-TI(JJ-1) 270 GOSUB 500:REM # Solve for current 'pump'. 290 FT=0:F3=0:DR=0 300 DF=DF+DE:DE=O 310 NEXT JJ 320 T(II)=TM:D(II)=DF:Q(II)=Q1(KS):DF=0 330 GOSUB 7250:REM # Video output 340 IF FP=l THEN GOSUB 7500:REM # Printer output 350 II=II+1 360 IF TM=TI(NS) THEN 410:REM # Finished calculations 370 IF TM=TI(KS) THEN TM=TI(KS)+TP:TS=TP:KS=KS+l:GOTO 250:REM # Next step 380 TS=TS*RT:TM=TM+TS:REM # Next reading 390 IF TM>TI(KS) THEN TM=TI(KS):REM # Get last reading for step 400 GOTO 250 410 ND=II-1 420 PRINT"Do you want the data saved in a disc file?" 430 Z$=SY:GOSUB 9800:IF ZX>2 THEN 9999 440 GOSUB 8250:REM # Save to disc 450 PRINT"Another save?":Z$=SY:GOSUB 9800 460 IF ZX<3 THEN 440 ELSE 9999 500 REM === 2nd. part of control section _ 510 REM -- Discharge well section -520 GOSUB 3000:REM # Calculate u 530 IF U>80 THEN DD=O:GOTO 560:REM # Excessive u 540 GOSUB 2500:REM # Solve for W(u) 550 GOSUB 3030:REM # Calculate drawdown 560 DE=DD:REM # Save drawdown 570 REM -- Image well section 580 GOSUB 3300:REM # Distance component along aquifer 590 R5=R:REM # Save R 600 GOSUB 3340:REM # Distance of image well 610 R=R4:REM # Prepare to send R4 to subroutine 620 GOSUB 3000:REM # Calculate u 630 IF U>80 THEN DD=O:GOTO 660:REM # Excessive u 640 GOSUB 2500:REM # Solve for W(u) 650 GOSUB 3030:REM # Calculate drawdown 660 DE:DD+DE:REM # Accumulate drawdown 670 IF (ABS(DD)
4.44
Simulations
710 RETURN:REM # To first part of control 2500 REM == Subroutine W(u) == 2510 U2=U'U:U3=U'U2:IF U<1 THEN 2540 2520 W=1/(U'EXP(U))'(C6+C7'U+U2)/(C8+C9'U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1'U+C2'U2+C3'U3+C4'U2'U2+C5'U2'U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U=R'R'CS/(4'T'TI) 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q'W/(4'PI'T) 3050 RETURN 3300 REM === Calculate distance to image well 3310 R3=SQR(R'R-(R1-R2)'(R1-R2)) 3320 RETURN 3330 REM -- Second part -3340 IF FT=1 THEN DR=DR+2 3350 IF FT=1 THEN D1=-R1 ELSE D1=R1 3360 IF F3=0 THEN D2=R2 ELSE D2=-R2 3370 IF FT=1 THEN FT=O ELSE FT=1 3380 R4=SQR((D2+DR'R6+D1)'(D2+DR'R6+D1)+R3'R3) 3390 RETURN 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistent units." 7020 PRINT"Maximum of ten pumping steps.":PRINT 7030 PRINT"Distance of observation point from discharging" 7040 INPUT" well" iR 7050 INPUT" Storage coefficient"iCS 7060 INPUT" Transmissivity";T 7070 INPUT"No. of pumping steps"iNS 7080 FOR 1=1 TO NS 7090 PRINT:PRINT"Step No."iI 7100 INPUT" Discharge rate"iQ1(I) 7110 IF 1=1 THEN P(1)=Q1(1) ELSE P(I)=Q1(I)-Q1(I-1) 7120 INPUT" Finishing time"iTI(I) 7130 NEXT I 7140 PRINT"Distance from discharge well to" 7150 INPUT" boundary" iR1 7160 PRINT"Distance from observation well to" 7170 INPUT" the same boundary"iR2 7180 INPUT" Width of aquifer"iR6 7190 PRINT"Do you want a paper copy of the data?" 7200 Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=1 ELSE FP=O 7210 PRINT:PRINT"Working 7240 RETlJRN
Simulations 7250 REM === Video output section === 7300 7490 These lines are identical to those in SIM1. 8630 8640 PI=3 .1415927/1: RT= 1.4142136#: SY="YyNn" :TL= 10000 8650 8655 These lines are identical to those in SIM1. 9999
1 REM f •••• SIM6/BAS ••••• 2 REM' Last modified 18th. Jan. 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM C(40),T(200),D(200),Q(200),C1(15),C2(15) 40 CLS 50 PRINT" SimUlation of a multi-stage discharge test in a leaky" 60 PRINT"confined strip aqUifer." 80 PRINT 90 PRINT" Loading variables, please wait." 100 GOSUB 8600:REM # Assign values to variables 110 GOSUB 8800:REM # All other variables 200 REM === Program control === 210 220 These lines are identical to those in SIM5. 460 500 REM === 2nd. part of control section === 510 REM -- Discharge well section -520 GOSUB 3000:REM # Calculate u, RB 530 IF Ul>80 THEN DD=O:GOTO 560:REM # Excessive u 540 GOSUB 5000:REM· # Solve for W(u,RB) 550 GOSUB 3030:REM # Calculate drawdown 560 DE=DD:REM # Save drawdown 570 REM -- Image well section 580 GOSUB 3300:REM # Distance component along aquifer 590 R5=R:REM # Save R 600 GOSUB 3340:REM # Distance of image well 610 R=R4:REM # Prepare to send R4 to subroutine 620 GOSUB 3000:REM # Calculate u, RB 630 IF U1>80 THEN DD=O:GOTO 660:REM # Excessive u 640 GOSUB 5000:REM # Solve for W(u,RB) 650 GOSUB 3030:REM D Calculate drawdown 660 DE=DD+DE:REM # Accumulate drawdown 670 IF (ABS(DD)
4.45
4.46
Simulations
690 GOTO 600:REM # Next image well 700 R=R5:REM # Restore R 710 RETURN:REM # To first part of control 2500 REM == Subroutine W(u) == 2510 U2=U*U:U3=U*U2:IF U<1 THEN 2540 2520 W=1/(U*EXP(U»*(C6+C7*U+U2)/(C8+C9*U+U2) 2530 GOTO 2550 2540 W=-LOG(U)+CO+C1*U+C2*U2+C3*U3+C4*U2*U2+C5*U2*U3 2550 RETURN 3000 REM === Calculation of u given R, S, T, & TI === 3010 U1=R*R*CS/(4*T*TI):RB=RISQR(T/(VK/TB» 3020 RETURN 3030 REM === Calculation of dd given W, Q, & T --3040 DD=Q*W1/(4*PI*T) 3050 RETURN 3300 REM === Calculate distance to image well --3310 R3=SQR(R*R-(R1-R2)*(R1-R2» 3320 RETURN 3330 REM -- Second part -3340 IF FT=1 THEN DR=DR+2 3350 IF FT=1 THEN D1=-R1 ELSE D1=R1 3360 IF F3=0 THEN D2=R2 ELSE D2=-R2 3370 IF FT=1 THEN FT=O ELSE FT=1 3380 R4=SQR«D2+DR*R6+D1)*(D2+DR*R6+D1)+R3*R3) 3390 RETURN 5000 REM === Group of subroutines for function W(u,RB) 5010 5020 These lines are identical to those of SIM2. 5760 7000 REM === Input section === 7010 PRINT:PRINT"Please enter all figures in consistent units." 7020 PRINT"Maximum of ten pumping steps.":PRINT 7030 INPUT"Distance of observation point from discharging well"iR 7040 INPUT" Storage coefficient"iCS 7050 INPUT" Transmissivity"iT 7060 PRINT"Vertical hydraulic conductivity" 7070 INPUT" of aquitard" jVK 7080 INPUT"Thickness of aquitard"iTB 7090 INPUT" No. of pumping steps"iNS 7100 FOR 1=1 TO NS 7110 PRINT:PRINT"Step No."iI 7120 INPUT" Discharge rate"jQ1(I) 7130 IF 1=1 THEN P(1)=Q1(1) ELSE P(I)=Q1(I)-Q1(I-1) 7140 INPUT" Finishing time"iTI(I) 7150 NEXT I 7160 PRINT"Distance from discharge well to" 7170 INPUT" boundarY"jR1
Simulations 7180 7190 7200 7210 7220 7230 7240 7250 7260 7500 8630 8640 8650 8660 9999
4.47
PRINT"Distance from observation well to" INPUT" the same boundarY"iR2 INPUT" Width of aquifer"iR6 PRINT"Do you want a paper copy of the data?" Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=1 ELSE FP=O PRINT: PRINT"I,orking . . . ." RETURN REM === Video output section _ These lines are identical to those in SIM1. PI=3.1415927#:RT=1.4142136#:SY="YyNn":TL=10000 These lines are identical to those in SIM2.
9.7. It_ 9;l..s~.h.?I'&1!l&- !'~1J_J!l_ [email protected],fil.r~ (Using the well equation, rather than the Well Function or the Leaky Well Function. 1 REM ••••• SIM7/BAS ••••• 2 REM • Last modified 14th. April, 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 30 DIM T(200),D(200),Q(200) 40 CLS 50 REM -- Preliminary print statements -60 PRINT" Simulation of multi-stage discharge test, with water levels" 70 PRINT"being measured in the discharging well. The Well Equation," 75 PRINT"rather than the Well Function, is used." 80 GOSUB 8600:REM # Assign values to variables. 200 REM === Program control === 210 GOSUB 7000:REM # Input section 220 IF FP=1 THEN LPRINT:LPRINT TAB(7)iSH:REM # Printer heading 230 II=1:TP=1/1440:TS=TP:TM=TP:KS=1:REM # Start at one minute 240 BB=O 250 FOR JJ=1 TO KS 260 TI=TM-TI(JJ-1):REM # Current time 270 BB=BB+B·LOG(TI.1440)/TL.P(JJ) 280 NEXT JJ 290 AA=A.Q1(KS) 300 CC=C·Q1(KS)~N 310 T(II)=TM:D(II)=AA+BB+CC:Q(II)=Q1(KS) 320 GOSUB 7250:REM # Video output 330 IF FP=1 THEN GOSUB 7500:REM # Printer output 340 II=II+1 350 IF TM=TI(NS) THEN 400:REM # Finished calculations
4.48
Simulations
360 IF TM=TI(KS) THEN TM=TI(KS)+TP:TS=TP:KS=KS+1:GOTO 240:REM # Next step 370 TS=TS*RT:TM=TM+TS:REM # Next reading 380 IF TM>TI(KS) THEN TM=TI(KS):REM # Get last reading for step 390 GOTO 240 400 ND=II-1 410 PRINT"Do you want the data ~aved in a disc file?" 420 Z$=SY:GOSUB 9800:IF ZX>2 THEN 9999 430 GOSUB 8250:REM # Save to disc 440 PRINT"Another save?":Z$=SY:GOSUB 9800 450 IF ZX<3 THEN 430 ELSE 9999 7000 REM === Input section === 7010 PRINT 7030 PRINT"Maximum of ten pumping steps." 7040 PRINT 7050 PRINT"Please enter the equation coefficients." 7060 INPUT" A = ";A 7065 PRINT"Note: Coefficient B must be calculated for times in minutes." 7070 INPUT" B = ";B 7080 INPUT" C = ";C 7085 INPUT"The exponent (often assumed to be 2). N = "iN 7090 INPUT"Number of pumping steps"jNS 7100 FOR 1=1 TO NS 7110 PRINT:PRINT"Step No.";I 7120 INPUT"Discharge rate"jQ1(I) 7130 IF 1=1 THEN P(1)=Q1(1) ELSE P(I)=Q1(I)-Q1(I-1) 7140 INPUT"Finishing time (days)"jTI(I) 7150 NEXT I 7155 INPUT"Effective radius of the well"iR 7160 PRINT"Do you want a paper copy of the data?" 7170 Z$=SY:GOSUB 9800:IF ZX<3 THEN FP=1 ELSE FP=O 7180 PRINT:PRINT"Working . . . " 7240 RETURN 7250 REM === Video output section 7260 PRINT"No."; II ;TAB(8) j "Time" ;T(II) ;TAB(27) i "Drawdown" iD(II) ;TAB(50)i"Pumps"iKS 7490 RETURN 7500 REM === Printer output === 7510 LPRINT TAB(7);USING G1iIIiT(II)iD(II);KS;Q(II) 7520 IF INT(II/58)<>II/58 THEN 7740 7530 FOR 1=1 TO 7:LPRINT:NEXT I 7540 LPRINT TAB(7)iSH 7740 RETURN 8250 REM === Store data on disc _ 8260 GOSUB 9600 8270 OPEN"O" ,#1 ,NM$ 8280 PRINT#1,3,1,R,ND 8290 FOR 1=1 TO ND:PRINT#1,T(I)*1440,D(I),Q(I):NEXT I
Simulations 8300 8310 8600 8640 8650 8655 8660 9600 9610 9620 9999
CLOSE RETURN REM === Assign values to variables TL=LOG(10):SY="YyNn":RT=SQR(2) SH="No. Time (days) Drawdown
Pumps
Discharge "
G1="HnH DIII.HHII
flU
##.IU~~AA"
HIH.HnH
RETURN REM === File name === These lines are identical to those in S1M1.
4.49
Interpolation
5.1
Chapter 5
At first sight you may think "What place does a chapter on interpolation have in a book on computer programs in groundwater?" In fact there is less direct connection between this chapter and groundwater science than any other in this book, but in spite of that I believe it to be well worth including. Interpolation can be very useful in groundwater science for several reasons. Some examples; 1/ It may be that you want to use a tabled function, but the value you are interested in is not tabled. In this case most people would take a stab at an interpolated value by estimating the required value from the adjacent values. Perhaps this may not be sufficiently accurate for all purposes. 2/ You may want to write a computer program which at some point evaluates a certain function. If you have no analytic solution for that function the best answer may be to include a table in your program, and interpolate the value from the table. 3/ I've also found interpolation useful when the values of a function could be calculated for small times, and for large times, but not for intermediate times. The intermediate time values could be interpolated from several points chosen on the upper end of the small time range, and several on the lower end of the large time range. Not ideal no doubt, but better than nothing, and the errors in data in many groundwater investigations are much larger than the errors likely from such computations. This chapter will explain how a type of interpolation, (named after the mathematician who developed it, Lagrange, hence Lagrangian interpolation) may be used in any of these situations. Perhaps it would be useful at this stage to explain exactly what is meant by 'interpolation' in this context. Consider the series of datum pairs; (1,0), (2,0.6931), <3,1.0986), (4,1.3863), (5,1.6094) This is the series of positive integers paired with their natural logarithms. The integers, 1, 2, etc. are the independent variables, and their logarithms, 0, 0.6931, etc. are the dependent variables. ie. The values of the logarithms depends upon the values of the integers for which they were calculated. Now, suppose that we have the series above, and we want to know the natural logarithm of 2.5, (and for the sake of this explanation, we don't have a book of logarithms, pocket calculator etc.) We must somehow estimate the value of the log of 2.5 by considering the known logs of 1, 2, 3, 4, and We could say that since 2.5 is half way between 2 and 3, therefore 5. In(2.5) will be close to half way between In(2) and In(3). This is linear interpolation and may be good enough as a rough estimate, but obviously the
5.2
Interpolation
above series of logs is not a linear series, ie. th~ differences are not consistent. Notice that what we have just done was to only the values of the logs of 2 and 3, but also of one or more logs in the series; this is exactly what must be done if we are accurate interpolation. Now look at the two dimensional series; Table 5.1
B 0.1 0.2 0·3 0.4
1 0 0 0 0
2 0.0692 0.1377 0.2048 0.2699
A 3 0.1097 0.2183 0.3247 0.4278
4 0.1384 0.2754 0.4097 0.5398
between them consider not of the other to obtain an
5 0.1607 0.3197 0.4756 0.6267
where the tabled values are equal to In(A)Sin(B) (where the value of B is in radians). Suppose we want the value In(2.5)Sin(.35). We will have to interpolate the table in two dimensions. We can proceed as follows; 1/ Decide on the number of points that we want to consider for the interpolation in each dimension. 2/ If we are to consider 3 points, then we may first interpolate the values of the row against 0.2 rads. So we interpolate a value between 0.2048 and 0.3247 corresponding to In(2.5)Sin(0.2); and we take into consideration either the value in the first or the fourth column to achieve greater accuracy. 3/ We now interpolate the next two rows in a similar way. If we are successful we will obtain three values close to 0.1820, 0.2708, and 0.3568. 4/ Finally we interpolate these three values, remembering that they correspond to Sin 0.2, 0.3, and 0.4 rads respectively, for Sin(0.25). Our final result should be close to the true value of 0.3142. 1. METHODS OF INTERPOLATION There are many methods available for interpolation. The simplest is linear interpolation where the assumption is that a linear function is sufficiently close to the tabled function, at least over the small gap between tabled values, to give an acceptable result. I will not give a program specifically for linear interpolation, although the program LAGRANGE may be used to give linear interpolations by specifying two as the number of known points. (Using LAGRANGE for linear interpolation as a regular practice would be like 'using a sledge hammer to crack an wallnut' because a much more efficient and simple program could be written. 1.1. Lagrangian interpolation Lagrangian interpolation (Hildebrand, 1968) was chosen for this chapter because it may be used when the intervals between the independent variables are unequal. Some other methods of interpolation demand equal intervals
Interpolation
5.3
between independent variables; a constraint that one can well do without. Lagrangian interpolation uses the equation:
u(x)
(x-x )(x-x ) 2 3
(x-x ) n
u(x
(x -x ) (x -x ) • • • (x -x ) 1 2 1 3 1 n (x-x )(x-x ) 1 3
(x-x ) n
u(x ) + . . • 2
(x -x )(x -x ) . . . (x -x ) 2
1
2
(x-x ) (x-x ) 1 2
+
1)
3
2
(x-x
n
n-1
)
+--------------(x -x )(x -x ) . . . (x -x ) n 1 n 2 n n-1
u(x ) n
where 11 U(x) is the value of the function at x.
ie. the unknown value.
21 x is the value for which the solution is required. 31 x , x , etc. are the independent variables.
J,
41 O(x U(x etc. are the values of the function at x x 1 1, 2, 2), etc., the dependent variables. 51 n is the number of values that are to considered in the interpolation. Note that this method of interpolation allows any number of independentIde pendent variable pairs to be used. 2. PROGRAM LAGRANGE This is designed for 'one off' interpolations. If you need to interpolate one value from a table, for example. The use of the program is very simple. You will first be asked to enter the number of points that you want to be considered, then you enter the first independent variable, followed by the first dependent variable, and so on. Finally you will be required to enter the value for which you want an interpolated solution. After the interpolation is completed, you will have an opportunity for another interpolation from the same set of independent and dependent values. 2.1. Program operation The x of equation 5.1 is replaced by MX in the vectors x x and U(x ), U(x ), are replaced 2' 2 1 1' and MF(x), respectively. 11 Lines 6010 to 6100 calculate the value 5.1 at a time. In each term:(1) You will notice that x does not 1 line of the first term, and that x does not 2 line of the second term etc.
program. Similarly the by the vectors MW(x), of one term of equation appear in the numerator appear in the numerator
5.4
Interpolation
(2) Also notice that each factor in the denominator line is calculated by subtracting a number from x in the first term, x in 2 1 the second term, etc. (3) In both the numerator and denominator lines, each factor in turn is evaluated by subtraction of the same number. ego In the first term the first factor in the numerator is calculated by subtraction of x and again in the denominator immediately below, 2, x is subtracted. T~ese rules allow lines 6030 to 6050 to calculate; (4) The vector MT(x), which contains the subtrahend of each respective factor in both the denominator and numerator. This vector will be slightly different in each term because of point (1) above. (5) Also in each factor of the denominator, the value of the minuend is stored in the variable Z. (6) After calculation of the vector MT(x) and the scalar Z, we are ready to move on to the calculation of the value of the first factor in the current term in line 6060. (7) Line 6070 merely causes line 6080 to be skipped in the case of linear interpolation. ie. two points specified. (8) The loop in line 6080 both evaluates the remaining factors of the current numerator and denominator, and accumulates the two products in MN (numerator) and MD (denominator). 2/ The variable MS accumulates the sum of all terms, in line 6090. At the end of the outer loop then, the value contained in variable MS is the required approximation of the function value at x (or MX as used in this program). The program LAGRANGE is the starting point for all interpolation routines used in this book. It will be built on, as needed, to cover requirements for interpolation between several known dependent variables. 2.2. Program verification Using the example above, of interpolation of the table of values of the function In(A)Sin(B). 1/ First we interpolate for x=2.5. (1) Interpolating (2,0.1377), (3,0.2183), and (4,0.2754), should give 0.1809. (2) Interpolating (2,0.2048), (3,0.3247), and (4,0.4097), should give 0.2691. (3) Interpolating (2,0.2699), (3,0.4278), and (4,0.5398), should give 0.3546. 2/ Now, the three values we have obtained are for In(2.5)Sin(0.2), In(2.5)Sin(0.3), and In(2.5)Sin(0.4). The final step, therefore, is to interpolate (0.2,0.1809), (0.3,0.2691), and (0.4,0.3546) for x=0.35. The result will probably be about 0.3122, close to the correct answer of 0.3142.
Interpolation
5.5
2.3.
Usage of variables in program LAGRANGE A counter which is set to one when the Jth factor in the Jth term is about to be evaluated. It is required because the Jth element of the independent variable vector is not used in the numerator of the Jth term. I The primary counter. It has a special roll as the counter for the term currently being evaluated. J The secondary counter. It has a special roll as the counter for the factor currently being evaluated. MD This accumulates the product which is the denominator for the current term. MF(x) Dependent variable number x, as typed in at the keyboard. MN This variable accumulates the product which is the numerator for the current term. MS The required value; ie. the dependent variable corresponding to the independent variable MX. It is the sum of all terms of equation 5.1. MT(x) The subtrahend (ie. that number in a subtraction operation by which the minuend is diminished) in both denominator and numerator of the current term. This vector receives the MW(x) The vector of independent variables. independent variables as they are entered via the keyboard. The independent variable for which the corresponding dependent MX variable is required. The number of points to be considered in interpolation. NK The minuend (ie. that number in a subtraction operation which is Z diminished) in each factor in the denominator of the current term. Z$, ZX, ZZ$, are all used for the single key program flow control subroutine.
c
3. PROGRAM INTERP1 The name INTERP1 is an abbreviation of 'interpolation in 1 dimension'. It may be used to interpolate a single dimensioned function such as the well function or the Bessel function, ie. a function of only one independent variable. The program as listed will interpolate the Bessel function (of the second kind, zero order) between x=O.Ol and x=5. The Bessel function has been chosen only as an example, program BESSEL in chapter one would be a better way of evaluating that function. Using program INTERP1 Setting up the program to interpolate a particular function. Decide on the number of independent/dependent variable pairs that you want, or have available, to use. If you have more than twenty eight pairs, you will have to increase the dimensioning statement in line 40 to one greater than the number of your pairs. The greater the number of datum pairs, over a given range, the more accurate will be the interpolation. Delete the present Bessel function values in the data statements in lines 7810 to 7860.
5.6
Interpolation
Enter the values of your function, a pair at a time, independent variable first, dependent variable second, in data statements before line 7870. Make sure that the last datum pair is (0,0), as this is used to mark the end of the function values. If it should happen that your independent variable values include zero, then it will be necessary to use a different value as a marker. You might, for example, use the value -999. Whatever value you choose must be inserted in place of the zero in line 7780, and must be in the position of the independent variable of the last datum pair to be read. If your independent variables are in order of decreasing magnitude, you must alter line 6040 from MX>C4(J) to MX
Interpolation
5.7
an interpolation). Line 6070 now loads the indicated values into the two small vectors MW(x), and MF(x), in readiness for the actual interpolation. Line 6080, which you may like to delete, simply displays the chosen independent/dependent variable pairs on the video display unit. (This checking printout may be found useful whenever the program, or even the data statements, are modified.) 3.2. Program verification If the program is typed into your computer correctly, and you enter the trial data shown below, you should obtain approximately the results given. Table 5.2 No. of points Input 2.2 3 4 " 5 6 4 0.064 4 0.026 4 0.68
Output 0.09009 0.08895 0.08958 0.08891 2.868 3.762 0.6825
Tabled value 0.0893
" " 2.869 3.766 0.682
%error 0.9 -0.4 0·3 -0.4 <0.1 -0.1 <0.1
3.3. Usage of variables in program INTERP1 Most, if not all, of the variables in program LAGRANGE are also used in this program; see above for details. In addition there are the variables described below. C4(x) The vector of independent variables written into the program. It is from this vector that the values to be used in the interpolation are chosen. The vector of dependent variables written into the program. C5(x) A string used to handle yes/no answers. SY 4. PROGRAM INTERP2 Interpolation of a two dimensional table (a table of values of a function of two variables). In the listed version of this program it is a tabulation of the leaky well function that is interpolated. Since this function is two dimensional, there is not now a vector of independent variables, and a corresponding vector of dependent variables. Rather there are two vectors of independent variables, and a matrix of dependent variables. See table 5.3. The vector of values of u is the first to be read, (The data is read in line 7770, and the data statements are in line 7810.) and is held in vector C4(x). The vector of RB values is read next, (lines 7780 and 7820) and is held in vector C5(x). Finally the function variables are read in line 7790 from the data statements in lines 7830 to 7900. (Note that it is of little importance exactly where in the program the data statements are, except that they will always be read in the order in which they appear.)
5.8
Interpolation Table 5.3 rIB
1.88H8 4.88E-86 1.88H5 4,88H5 1.88H4 U8E-84 1.88E-83 4,88E-83 1.88HZ 4088E-8Z 1.88E-81 4,88Hl 1.88E+88 4,88E t88 B.88E+88
l.88H3 4088H3 l.88H2 4088HZ l.88E-81 4,88HI l.88E+88 4,88E+88 6.88E+88 8.88E+88 l.4IE+81 l.IBEt81 1.89Et81 9.54E+88 B.63E+88 7.25Et88 6.33Et88 4.95E+88 4.84E+88 2.6BEt88 l.B2E+88 7.82Hl 2.19Hl 3.B8H3 B.88E+88
l.13E+81 l.11Et81 1.86E+81 9.45Et88 B.59E+88 7.24E+88 6.33E+88 4.95Et88 4,84Et88 2.6BEt88 l. B2E+88 7.82Hl 2.19E-81 3.B8H3 B.88E+88
9.44E+88 9.44Et88 9.42E+88 9.81E+88 B.48E+88 7.J9Et88 6.3JE+88 4.94E+88 4,84Et88 2.6BEt88 l. B2E+88 7.82Hl 2.19Hl 3.B8H3 8.88E+88
6.67E+88 6.67Et88 6.67E+88 6.67Et88 6.67E+88 6.45Et88 5.97Et88 4.B5E+88 4,88E+88 2.67E+88 l. B2Et88 7.82Hl 2.19Hl 3.B8H3 B.88E+88
4.B5E+88 4.B5E+88 4.B5E+88 4.B5Et88 4.B5E+88 4.B5E+88 4.B3Et88 4.42Et88 3.82E+88 2.63E+88 1. Bl E+88 7.88E-8J 2.19E-8J 3.B8E-83 B.88Et88
2.23E+88 Z.Z3Et88 2.23E+88 2.23E+88 2.23E+88 2.23E+88 2.23E+88 Z.23E+88 Z.23E+88 2.82Et88 l. 56E+88 6.65Hl 2.14E-81 3.B8H3 B.88E+88
B.4ZE-81 B.42E-81 B.42E-81 B.42Hl B.42Hl 8.42E-8J B.m-81 B.42E-81 8.42Hl B.42E-81 8.19E-81 5.82E-81 l.B6E-8J 3.68E-83 B.88Et88
Z.Z3E-82 2.23H2 2.23HZ 2.23H2 2.23H2 2.23H2 2.23H2 2.23H2 2.23H2 2.23E-82 2.23H2 2.23H2 2.87E-82 1.68H3 B.88E+88
2.58H3 2.58H3 Z.58E-83 2.58H3 2.58H3 2.58E-83 2.58E-83 2.58H3 2.58H3 2.58H3 2.58H3 2.58E-83 2.58E-83 6.88E-84 B.88Et88
3.88E-84 3.88E-84 3.88H4 3.88H4 3.88E-84 3.88E-84 3.88H4 3.88H4 3.88H4 3.88H4 3.88H4 3.88E-84 3.88E-84 2.88H4 B.88E+88
The values in both these vectors are much closer to being exponential series than linear series, so they are converted to logs when they are read to produce something close to a linear series. Lagrangian interpolation seems to be more accurate when the vectors being interpolated are reasonable close to linear series. Of course, if the independent variable vectors are log values, then the values of u and RB must also be converted to logarithms; this is done in line 250. 4.1. Program operation This approaches the problem in a very similar way to INTERP1, with the addition of a section of code that interpolates the values from which the final interpolation is then made. (The procedure is an automated version of that in the example given for two dimensional interpolation using the program LAGRANGE. ) In this program the pointer used to indicate the lowest element in the vector of u values to be considered for interpolation is variable Pl, and that used for the pointer for the RB values is P2. (It was not possible to use J as in INTERPl because J will be used to count passes through a loop.) The intermediate interpolations are calculated one at a time in the loop in lines 6110 to 6180, and placed in the vector MV(x) for temporary storage. (They cannot yet be placed in vector MF(x) because that vector is still being used to calculate the intermediate interpolations.) When all intermediate interpolations are done, the loop in lines 6200 to 6230 lodes the values for the final interpolation into vectors MW(x) and MF(x), and the Lagrangian interpolation routine is called for the last time from line 6240.
Interpolation
5.9
4.2. Program verification If the number of points and the values for u and RB shown below are entered on the program prompts, your computer should give results similar to those shown below. Table 5.4 Number of points u 0.08 3 4 " 5 " 6 " 0.002 3 4 " 0.08 3 6 " 4 0.00002 4 0.8
RB 0.6
" "
"
0.008
"
0.8 0.8 0.002
output 1.279 1.326 1.359 1.378 5.636 5.635 1.021 1.080 1.134 0.314
tabled value 1.39
" " "
5.63
"
1.08
"
1.13 0.311
% error -8.0 -4.6 -2.2 -0.9 0.1 0.1 -5.5 0.0 0.4 1.0
4.3. Usage of variables in program INTERP2 Most of the variables used in programs LAGRANGE and INTEHPl are also used in this program. The variables below are either additional variables, or are variables used in a different way to those previously described. C4(x) The first vector of independent variables. It is associated with the rows of the matrix C6(x,y). C5(x) The second vector of independent variables. This is associated with the columns of the matrix C6(x,y). C6(x,y) The matrix of dependent variables. x corresponds to the row number, and y to the column number. The number of elements in the first independent variable vector, ND and the number of rows in the dependent variable matrix. The number of elements in the second independent variable vector, NE and the number of columns in the dependent variable matrix. The elements of this vector are the xth intermediate interpolatMV(x) The columns of the dependent variable matrix are interpolated ion. using the first [C4(x)] independent variable vector giving the vector MV(x) as a result. Points to the first (lowest) value in the vector of u values to be Pl used for interpolation. Points to the first value in the vector of HB values to be used for P2 interpolation. This variable has the value of riB of the Leaky Well Function. RB The u value of the Leaky Well Function. U
5.10
Interpolation 5.
REFERENCE
Hildebrand, H.I., 1968. Interpolation Britannica, Vol. 12, p445.
and
Extrapolation.
6. PROGRAM LISTINGS. 6.1. Interpolation of keyed in data, program LAGRANGE. 1 REM ***** LAGRANGE.BAS ***** 2 REM * Last modified 18th. Jan. 1986 10 DEFINT F,I-L:DEFSTR G,S 200 REM === Control section 210 PRINT"How many points (2 - 9)?":Z$="23456789":GOSUB 9800 220 NK=ZX+1 230 FOR 1=1 TO NK 240 PRINT:PRINT"Datum pair No."jI 250 INPUT"Independent variable"jMW(I) 260 INPUT"Dependent variable "jMF(I) 270 NEXT I 280 PRINT:INPUT"Enter the value for which you want a solution"jMX 290 GOSUB 6000:REM # Lagrangian interpolation 300 PRINT"The reqUired value is "jMS 310 PRINT:INPUT"Enter another value (0 to end)"jMX 320 IF MX=O THEN 9999 330 GOTO 290 6000 REM === Lagrangian interpolation --6010 MS=O 6020 FOR 1=1 TO NK:C=O 6030 FOR J=1 TO NK-1:IF J=I THEN Z=MW(I):C=1 6040 MT(J)=MW(C+J):NEXT J 6050 IF I=NK THEN Z=MW(NK) 6060 MN=MX-MT(1):MD=Z-MT(1) 6070 IF NK=2 THEN 6090 6080 FOR J=2 TO NK-1:MN=MN*(MX-MT(J)):MD=MD*(Z-MT(J)):NEXT J 6090 MS=MS+MN/MD*MF(I) 6100 NEXT I 6110 RETURN 9800 REM -- Await valid key -9810 ZZ$=INKEY$ 9820 ZZ$=INKEY$:IF ZZ$="" THEN 9820 9830 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN 9840 NEXT ZX 9850 GOTO 9820 9999 END
Encyclopaedia
Interpolation 6.2.
Interp. of a one dimensional table, program INTERP1
REM ••••• INTERP1.BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 DEFINT F,I-L:DEFSTR G,S 40 DIM C4(29),C5(29) 50 CLS 60 PRINT" Interpolation of a single dimensional table using Lagrangian" 70 PRINT"interpolation." 80 PRINT" This program, as it is, will interpolate the Bessel function" 90 PRINT"of the first kind and zero order.":PRINT 200 REM === Control section === 210 GOSUB 7750:REM U Load function values 220 INPUT"Enter the value for which you want a solution";MX 230 PRINT"How many points (3 - 9)?":Z$="3456789":GOSUB 9800 240 NK=ZX+2 250 GOSUB 6000:REM U Lagrangian interpolation 260 PRINT"The required value is ";MS 270 PRINT:PRINT"Do you want to change the number of points?" 280 Z$=SY$:GOSUB 9800:IF ZX>2 THEN 310 290 PRINT"How many points C3 - 9)?":Z$="3456789":GOSUB 9800 300 NK=ZX+2 310 INPUT"Enter another value (0 to end)";MX 320 IF MX=O THEN 9999 330 GOTO 250 6000 REM === Lagrangian interpolation === 6010 REM -- Pick out values for interpolation 6020 PRINT:PRINT"Calculating" 6030 J=1 6040 IF MX>C4(J) AND J
5.11
5.12 7770 7780 7790 7800 7810 7820 7830 7840 7850 7860 7870 9800 9810 9820 9999
Interpolation 1=1 READ C4(I),C5(I):IF C4(I)<>0 THEN I=I+l:GOTO 7780 ND=I-l RETURN DATA .01,4.721,.02,4.029,.03,3.624,.04,3.337,.05,3.114 DATA .06,2.933,.07,2.78,.08,2.648,.09,2.531,.1,2.427 DATA .2,1.753,.3,1.373,.4,1.115,.5,.924 DATA .6,.778,.7,.661,.8,.565,.9,.487,1,.421 DATA 1.4,.244,2,.114,2.4,.0702,3,.0347 DATA 3.4,.022,4,.0112,4.4,.0071,4.8,.0046,5,.0037 DATA 0,0 REM -- Await valid key -These lines are identical to those in LAGRANGE.
6.3.
Interp. of a two dimensional table, program INTERP2
REM ••••• INTERP2.BAS ••••• 2 REM • Last modified 18th. Jan. 1986 10 DEFINT F,I-L:DEFSTR G,S 40 DIM C4(15),C5(10),C6(15,10) 50 CLS 60 PRINT" Interpolation of a two dimensional table using Lagrangian" 70 PRINT"interpolation." 80 PRINT" This program, as i t is, will interpolate the leaky well" 90 PRINT"function.":PRINT 200 REM === Control section === 210 GOSUB 7750:REM # Load function values 220 INPUT"Enter values for u and RB (eg . . 023,.135)"jU,RB 230 PRINT"How many points (3 - 9)?":Z$="3456789":GOSUB 9800 240 NK=ZX+2 250 U=LOG(U):RB=LOG(RB) 260 GOSUB 6000:REM # Lagrangian interpolation 270 PRINT"The required value is "jMS 280 PRINT:PRINT"Do you want to change the number of points?" 290 Z$=SY$:GOSUB 9800:IF ZX>2 THEN 320 300 PRINT"How many points <3 - 9)?":Z$="3456789":GOSUB 9800 310 NK=ZX+2 320 INPUT"Enter another pair of u, RB values (0,0 to end)"jU,RB 330 IF U=O THEN 9999 340 GOTO 250 6000 REM === Lagrangian interpolation === 6010 REM -- Pick out values for interpolation 6020 PRINT:PRINT"Calculating" 6030 P1=1 6040 IF U>C4(P1) AND P1
Interpolation 6050 IF P1<=NK-1 THEN P1=0:GOTO 6070 6060 P1=P1-(NK-1) 6070 P2= 1 6080 IF RB>C5(P2) AND P2
5.13
5.14 7855 7860 7865 7870 7875 7880 7885 7890 7895 7900 9800 9810 9820 9999
Interpolation DATA 7.25, 7.24,7.19,6.45,4.85,2.23,.842,.0223,.0025,.0003 DATA 6.33, 6.33,6.31,5.97,4.83,2.23,.842,.0223,.0025,.0003 DATA 4.95, 4.95,4.94,4.85,4.42,2.23,.842,.0223,.0025,.0003 DATA 4.04, 4.04,4.04,4.00,3.82,2.23,.842,.0223,.0025,.0003 DATA 2.68, 2.68,2.68,2.67,2.63,2.02,.842,.0223,.0025,.0003 DATA 1.82, 1.82,1.82,1.82,1.81,1.56,.819,.0223,.0025,.0003 DATA 0.702,0.702,.702,.702,.700,.665,.502,.0223,.0025,.0003 DATA 0.219,0.219, .219, .219, .219, .214, .186, .0207,.0025, .0003 DATA .0038,.0038,.0038,.0038,.0038,.0038,.0036,.0016,.0006,.0002 DATA 0,0,0,0,0,0,0,0,0,0 REM -- Await valid key -These lines are identical to those in LAGRANGE.
Analysis
6.1
Chapter 6
The programs of chapter four and some of those of chapter seven either write data into a disk file or use data previously stored in a disk file. One of the great advantages of using computers to handle data is the enormous flexibility that can be used in reorganising, adding to, or deleting from the data. The program described in this chapter, DTDHA, can be used to create, alter, or analyze the data from a disk file relating to either a simulated or real discharge test. (Or from a recharge, recovery, slug, or other such test.) It's name consists of the initial letters of Discharge Test Data Handling and Analysis. Note that all of the discharge test data analysis functions were designed to work on times expressed in minutes from the beginning of the test. (In some cases it is necessary to have time expressed in minutes from the beginning of the current discharge step.) Also, drawdowns should normally be in metres, and discharge rates in kilolitres (cubic metres) per day. Some of the functions will work on other units, provided that they are consistent, but some will not. If any users prefer to work with other units, there is no great problem. Option three of menu two can be used to convert your data to the above units before the analysis, and then back to your favourite units later. Output of transmissivity will normally be in cubic metres per day per metre. Delta s will normally be in metres per log (base 10) cycle. Average discharge rate will be in the same unit as is used to store discharge rates no matter what unit is used for storing times. 1.
FUNCTIONS OF PROGRAM DTDHA 11 Keyboard entry of discharge test data. 21 Flexible editing of data in memory, or data from a disk file that has been loaded into memory. 31 Merging the data in memory with data from a disk file. ego Joining two disk data files. 41 Sorting the data in memory into order of increasing times. 51 Saving the data in memory onto a disk file. 61 Analysis of the data; a. Evaluation of the well equation (two methods). b. Calculation of transmissivity from any desired part of the data. C. Calculation of storage coefficient from any desired record. d. Searching for points of inflection. 71 Converting the data from a stepped rate discharge test with no recovery between steps to simulate full recovery between steps. 81 Searching for, and optionally deleting, anomalous readings. 91 Converting times to t/t1. 101 Converting residual drawdown readings to recovery readings.
6.2
Analysis
WARNING As may be seen from the list above, the program has considerable flexibility. Also, in order to maximize flexibility, there is little check made within the program on the actions of the user (other than in relation to 'housekeeping', ego attempts to refer to nonexistent record numbers, have a transmissivity calculated from drawdowns associated with two different pumping rates, etc.) There are many operations that could be performed on the data that are inappropr-iate, and the user will have to keep careful track of what he is doing. The program is designed to do much of the hack-work of discharge test data handling and analysis, but it is not foolproof, nor is it capable of thought. In short, take care if you don't want to scramble your data, or come up with totally erroneous answers. Since the program is so large and complex, and designed to handle a great variety of forms of discharge test data, there will be faults in it that have not been discovered at the time of the writing of this book. The program will be continually upgraded, so please contact the author if you have problems. Avoiding lost data by accidental scrambling is easy. Be sure to make disk files of the data before you do some operation that may have unforeseen results. You can always delete the excess files later. There is one catch here; if your computer finds that there is insufficient disk space, you will not be able to save your file. Take care that you use a disk with plenty of free space. If a disk full condition arises, then (depending on your particular computer) you should be able to either view the directory and delete some unwanted file to make more room, or log in a disk with more free space. (With some computers this involves changing the disk only, with others you may have to type the Basic language key word RESET, after inserting the new disk. There are probably other variations as well.) The disk full error is an operating system error. The user may well find that at some time other error messages from either the Basic interpreter, or the operating system, may be displayed and program execution halted. The program and data should be recovered intact by typing GOTO 240 and pressing RETURN (or, depending on the computer, NEW LINE, ENDLINE, or ENTER). This will get you back to the main menu. Of course it will not solve the condition that caused the error to arise. Ideally all possible errors should be considered and guarded against at the time the program is written, but in reality this is all but impossible. One of many possible causes of a Basic error message would be to have a time of zero in your data at some position other than the first datum. I can imagine no reason for purposely doing this, but it may happen accidentally. This will cause an error if and when the interpreter attempts to calculate the log of this time. As with all of the programs in this book, the aim is to provide something that can not only be used as it is, but also be modified to suit particular uses. The modular structure of this program should allow easy addition of more features. It will be even easier to delete unwanted
Analysis
6.3
features. The program requires roughly 29K of memory after loading your Basic interpreter. If your computer has less memory than this you could delete one or more subroutines. 2. OVERALL PROGRAM STRUCTURE The program consists of a tiered subroutine structure. The primary controlling section is the main menu, this controls calls to the other menus and to other major subroutines. In turn, the menu 2 and menu 3 subroutines call other major subroutines. Many of the major subroutines call yet other subroutines. Table 6.1 shows the locations of the programs main subroutines by their first line number. 2.1. Major subroutines Table 6.1 First line Function Name, initialization, etc. 1 Preliminary control. 200 240 Menu # 1; Main menu. Menu # 2; Data modification. 700 1000 Menu # 3; Test analysis. 1500 Pick out, and optionally delete, anomalous readings. 1665 Report and record anomalous readings- for above. 1700 Search for inflection points. 1876 Calculate total absolute deviation- for above. 2000 Alter, or write in, test description data. 2100 Convert times to t/tl. 3000 Convert residual drawdown readings to recovery. 3400 Newtons method, applied to solving the well equation for storage coefficient, as in program CB2N. (Calculations only.) 3600 Alter a single record. 3650 Add a constant to some/all entries. 3700 Multiply some/all entries by a constant. 3750 Delete a number of readings. 3800 Merge data in memory with that from a specified disk file. 3850 Sort all records into order of increasing times. 3900 Delete a record (reading). 3950 Insert a record. 4000 Calculate the average discharge rate. 4200 Linear regression, applied to drawdowns and times. 4400 Calculation of delta s and transmissivity. 4500 Evaluation of the well equation by the s/Q vs. Q method. 4600 Find drawdown and discharge rate for each step at a given time, for evaluation of the well equation by Rorabaugh's method. 4700 Calculation of storage coefficient at any given time. 4800 Convert step test data to simulate full recovery between stages. 5000 Evaluation of the well equation by Rorabaugh's method.
--------
6.4
Analysis
5400 Linear regression, applied to evaluation of the well equation. 7000 Add to current data. Main keyboard input. 7250 List the current data to the VDU. Video output. 7500 List the current data to the printer. 7750 Input from data statements etc. 8000 Load a disk file. 8250 Save data to a disk file. 8500 Define functions, for Newtons method. 8600 Assign values to variables, for the well function. 9100 Get first and last record numbers from user. 9400 Delay for VDU message. 9500 Load strings and constants. 9600 Get a file rame from the user, and validate it. 9800 Await valid key. The data is handled in terms of the reading number, and with each reading number is associated a time, a drawdown, and a discharge rate. Each such set of data is referred to as a record, and is stored to, or retrieved from, a sequential access disk file as a record. 3. UNPROGRAMMED MODIFICATION OF DATA One of the greatest advantages of the Basic language is that it allows one to break the program execution at any time, examine and/or alter values of selected variables, and then continue with the program. As an example of this, suppose that all the records within one discharge phase were entered as time, drawdown, and the actual flow rate as calculated from a cumulative flow meter at every reading rather than the average flow for the whole step. The data might be something like the following. Record No. 20 21 22 23 . etc.
Discharge Drawdown Time 369kl/day 100 min. 17.20m 110 17.40 373 120 367 17.39 140 368 17.55 up to record No. 32
Since the method used to calculate transmissivity assumes a constant discharge rate, you may like to adjust all the drawdowns to what they would have been had the discharge rate remained constant at 370kl/day (and at the same time alter all recorded discharge rates to 370kl/day). This may be achieved by breaking program flow (with the break key, CTRL Break, or whatever else your computer may use), and then writing this command. "FOR 1=20 TO 32:DD(I)=DD(I)*370/Q(I):Q(I)=370:NEXT I" This correction assumes a constant specific capacity irrespective of discharge rate at any given time. While this is not strictly valid, it will be close to the mark so long as the drift in Q is small. Note that this correction should not be applied to data pertaining to an observation well
Analysis
6.5
because there is a large delay in any change in discharge rate and it's effect on the water level in an observation well. If the operation were carried out on the above data, the data would be changed as indicated below. Record No. 20 21 22 23
Time Drawdown 100 min. 17.25m 110 17.26 120 17.53 140 17.65
Discharge 370kl/day 370 370 370
4. RUNNING THE PROGRAM. Unfortunately, it will not be possible to fully follow the pattern of the preceding chapters and give program verification data for each function offered by this program. Many of the operations involve large quantities of data, and the space available in this book is insufficient for all the examples that would be required. However, many other of the operations can be easily tested by the user himself. When the program is run there will first be a brief pause for initialization, including the dimensioning of vectors, the loading of string constants etc. After initialization, the computer will ask for a file name, this name will then become the current file name and will be used for such operations as loading a file from disk or saving the data to disk. The user will then be asked whether he wants to load an existing file. Pressing the y key will cause the computer to search for and load the disk file under the name given above. Pressing the n key will allow the user to create a new file or read the date stored in data statements into memory. The program has data "built in" as data statements in the section from line 7750 to 7990. This may be used for testing. If you want to write in your own discharge test data, then you could follow these steps. 11 Delete present lines 7800 to 7850 and 7872 to 7906 21 Indicate in lines 7800 to 7850, the finishing times of you discharge steps as in the example. Note that the numbers written in this section are just slightly larger than the time of the last reading for the particular step involved, but smaller than the time of the first reading in the next step. [ego The discharge rate for the first 100 minutes was 173 kIlday, so line 7800 sets this value for all times less than 101 minutes. The next time value in the data is 105 minutes (line 7882).] 31 Write your time-drawdown datum pairs in data statements between lines 7870 and 7990; leave both those lines intact. Note that the time component of the pair comes first, and the drawdown second. If your data is to be used in a Sternberg analysis (see chapter 7), then initial conditions must be put first (in this case, zero drawdown at zero time). 41 The initial discharge rate [value of Q(x)] may be written in line 7780. 51 Code numbers specifying the type of test may be written into line 7760, but this could be left as it is, and option seven of menu one used
6.6
Analysis
to alter the test description as required. If a new file is created rather than using data statements, then the user will be expected to give a code number for the type of test (discharge, recovery, simulation, or t/t1 recovery), and for the type of well (either discharge or observation). (Note that the user could add more codes here by adding more descriptive strings in the section commencing at line 9500, and by modifying lines 2030 and/or 2060.) The user will also be expected to give a value for R, this being the effective radius of the well if the data apply to a discharge well, or the distance from the discharge well if the data apply to an observation well. After either loading a file from disk, or obtaining an answer to the above questions, the program will move on to the first of three menus. Note that the clear statement in line 10 serves to reserve space in memory for storage of strings in some computers. In most computers it is not required. 5. MENU NUMBER ONE; THE MAIN MENU It is to this menu that the program will return after all completed operations on the data in memory. 5.1. Option 1. Load a file Option one will load a file from disk. This path will not normally be taken from the main menu unless the current data have been saved to disk file, as it will cause all data in memory to be lost. (As a safety precaution, a warning, and an escape, will be given before proceeding with this step.) An opportunity to change the current file name will also be given before a file is loaded. 5.2. Option 2. Save the data Pressing two at the main menu will cause the current data to be saved on As above, there will be an opportunity to change the current a disk file. file name. Note that if the data is saved under a file name the same as one already in use on your disk, the old data on that file will be overwritten by the current data (that in primary memory), and will be lost. 5.3. Option 3. Data entry This is the option to choose for normal first time entry of data. The data entered by the keyboard will be added to the end of the data in memory. There are two alternatives within this option. 1/ Entry of time as elapsed time from the beginning of the test. For each record; time, drawdown, and discharge rate may be entered in that order. Since for most entries, the discharge rate, Q will remain the same as it was for the previous entry, the program assumes it is the same, unless the user indicates otherwise. To enter a different value for Q, the immediately previous entry, that of drawdown, must be suffixed with a 'q', the lack of the suffix will be taken as an indication that the discharge rate remains the same. This minimises keystrokes.
Analysis
6.7
2/ Entry of times as date and time of day Measuring the water level recovery over a very long period is occasionally valuable, especially for wells in strip aquifers with little leakage. It may, in some cases, be worth while measuring the water level everyone or two This alternative method of data entry allows the days for several weeks. user to enter the date and time of day of the start of the test, then enter the date and time of day of a reading. In an effort to minimize key strokes the following system has been used. The date is entered separately to the time of day. Both the dates and times of the start of the test, and of the first reading are typed in in full to start. From then on to enter a different date, you must suffix the time entry with a d. Note that 24 hour time is used in order to avoid the extra typing and unnecessary complications in programming that would be caused by entry of times as either am or pm. Some examples of entries of times; a. 1430 This will be interpreted as 2.30pm on the same day as was preViously entered. b. 32 This will be interpreted as 32 minutes past the hour, where the hour and day remain unchanged. c. 200d Two am; the date will be requested. d. 0000 Midnight at the beginning of the date previously entered. e. 2400 Midnight at the end of the date previously entered. f. 1234F, or F, or f, or 34f. No notice will be taken of the numbers. Data entry will be terminated, and control will pass back to the main menu. Some points to note The program does not allow for change of month. If one reading was on the 30th. of June, and the next on the 1st. of July, then that date should be entered as 31. Entries of more than 60 minutes or more than 24 hours will not be rejected. ego An entry of 9 hours, 80 minutes will have exactly the same value as one of 10 hours, 20 minutes. All entries of time in the file in memory will be recorded in total elapsed minutes from the first date, hour, and minute given. It is possible that the key word VAL may be handled slightly differently in different machines. In the computer that the program was written on, VAL("34d") would be evaluated as 34, but VAL("d34") would be evaluated as zero. Some slight modifications will be necessary if your computer evaluates VAL("34d") as zero. The time in total elapsed minutes will be immediately calculated and displayed, so it would be worth trying a few checks before relying fUlly on this system. 5.4. Option 4. Go to the editing menu Editing of the data in memory is done by choosing option 4 of the main menu. This will cause the program to display menu two. See below.
6.8
Analysis
5.5. Option 5. View the data Pressing the five key will allow viewing the data at present in memory. You will be asked to specify the number of the first record of interest. You may then page through the data (in the forward direction only) by pressing the C key, or exit to the main menu by pressing E. The program as it appears in the listing is best suited for a twenty four line display. For a sixteen line display replace the two appearances of the number 20 on line 7320 with the number 13. This feature will be found very useful for checking on the current status of the data, and to find the record number of a particular datum. 5.6. Option 6. Print the data Use this option to get a printed list of the data. Be sure that your printer is at the top of a page when you start. The program will allow for a 66 line page. Any "Forms" utility you may have (to paginate printed output) should not be set, as DTDHA will count the printed lines and roll on to a new page when necessary. DTDHA will also allow a small top margin, and a binding margin. 5.7. Option 7. Alter the test description This may be used to alter the code numbers describing the type of test. If, for example, you start off with all the data for a discharge test in the one file, including the recovery data, you will probably have called the data "Discharge". If you delete all the data relating to the drawdown part of the test, and convert the times of the recovery part to t/t1, you may like to alter the name of the data type to "t/t1 recovery". This option will also allow correcting of errors in the original entries in this area. 5.8. Option 8. Convert the data To reduce time, and hence costs, in running a mUlti-stage discharge test, it is a common practice to change from one discharge rate to the next with no recovery period between. On the other hand, analysis methods usually call for full recovery between steps. It is possible to graphically convert the data to the form it may be expected to take had there been full recovery before each step. This option automates this graphical procedure. Figure 6.1 is a graph of the trial data written into this program as data statements as it was recorded at the time of the discharge test, warts and all. This data is from a well in a hard rock area (Sibenaler, 1979) and so is not what one would expect from a simple confined aquifer. Figure 6.2 is a graph of the same discharge test after deleting anomalous readings (two of them), and then converting the data to simulate full recovery between steps. A similar exercise can be done using data produced by a program such as SIM7. It is important to realize that this feature gives approximate results only. Even when theoretically correct data is used as a starting point, (eg. the output of program SIM7) this option will not bring it back to exactly what it would have been with full recovery between steps. This is one of the strongest points in favour of the Sternberg analysis. (See chapter 7.)
Analysis
6.9
~
:/
o o o
_'fI
Ir
, ,
All _..i Ir' ~
IJ
o o
~
-----
o
Drawdown, Residual d.
-
6.10
Analysis
~
§ ....
i~
'"
""x, )
X
Ie
~
x X
x ~
~
X
)
X
X
~
)
X
o
Drawdown, Residual d.
X
8....
Analysis 5.9. This below.
6.11
Option 9. Go to the test analysis menu will cause the test analysis menu, number 3, to be displayed, see
5.10. The final option on the main menu is E for end If e or E is pressed the computer will check with the user before terminating the program; this is to avoid unintentional termination. 6.
MENU NUMBER TWO; DATA MODIFICATION
6.1. Option 1. Alter a datum set Individual entries may be altered by choosing option one of the data modifying menu. The entries are referred to by number. The current values are printed on the screen at the alteration stage for checking and so that they can be re-entered unchanged if desired.
6.2. Option 2. Add a constant to all items This applies to anyone vector, time, drawdown, or discharge rate. An example; your data were entered as depths to water, and you want to convert The standing water level was 11.11m at the beginning of them to drawdown. the test. Answer; add -11.11 to all data in this vector. 6.3. Option 3. Multiply all items by a constant All items in anyone vector will be multiplied by a given constant, it is probably the most useful function on this menu. Some examples; 11 You entered all your 'drawdown' values as pressure heads (in metres of water). To convert to true drawdown you can multiply by -1 (and perhaps add a constant using option 2). 21 You entered all your times in minutes and want to convert to days. Multiply by 6.94444E-4. 31 You entered all discharge rates as litres per second, and want to convert to litres per minute. Multiply by 60. (Note that there is no provision in the program to label the units used.) 41 Your drawdowns were measured in a 60 degree angle hole. Multiply by 0.86603 (Sin 60 degrees) to convert to vertical equivalent drawdown. Options two and three of menu three can be applied to a selected part of the data, rather than to all the data of a given vector, if so desired. 6.4. Option 4. Convert all times to t/t1 This option is aimed solely at recovery data. Users could use option 8 below to remove data relating to the drawdown phase before or after conversion. Note that if this conversion is to work correctly, all times must be measured from the beginning of the test, not from the beginning of the recovery. If your times are measured from the beginning of recovery, simply add the length of the discharge to them all using option 2 of menu 2. Alternatively, they can remain as they are for the present, and be converted to
6.12
Analysis
t/t1 by DTPLOT which requires times to be measured from the beginning of recovery for this procedure. If you do the conversion with this program, be careful not to do it again in DTPLOTj use the log-linear graphing option instead. 6.5. Option 5. Merge with another file The data in memory will be merged with data previously saved as a disk file. The data from the disk file will be added to the end of the data in memory. This function may be useful for such jobs as combining the readings from the discharge part of a test to those of the recovery part of the same test, if the two sets of data were originally recorded on separate files. 6.6. Option 6. Sort data into order of time All entries will be sorted into order of increasing time by pressing six at menu number two. Of course, all the datum sets (ie. each set of a time, a drawdown, and a discharge rate) will be treated as units. A Shell-Metzner sort is used. This is one of the faster of the sorts when the program is restricted to Basic. Sorting in Basic is hopelessly slow in comparison with a sort using a machine language utility or subroutine, but it is acceptable when the set of vectors to be sorted is fairly short as is usual with discharge test data. Many versions of Basic support the key word SWAP. If your interpreter can use SWAP, then alter lines 3874 to 3880 to read:3874 F=1:SWAP TI(I),TI(J) 3877 SWAP DD(I),DD(J) 3880 SWAP Q(I),Q(J) This will not only increase the speed of the sort by about 30%, but it will also make the sorting process easier to understand. 6.7. Option 7. Delete a single reading Any single reading may be deleted by choosing option three. The reading must be specified by it's associated reading number. All readings having higher reading numbers will be renumbered afterward, to fill the gap left by this deletion. 6.8. Option 8. Delete a number of readings This is similar to seven, but allows a group of consecutively numbered readings to be deleted. The user must specify a first and last reading number for deletion. Note that the readings specified will be deleted, as well as any readings between these end limits. 6.9. Option 9. Insert a reading A reading may be inserted anywhere in the file with this option. The record number must be specified by the user. All records with numbers equal to, or greater than the specified number will be incremented by one to make room for the new record.
Analysis
1.
6.13
MENU NUMBER THREE; ANALYSIS MENU
1.1. Option 1. Search for anomalous readings Removing the found anomalies is a further option. Note that it is anomalies in drawdown readings that are searched for, and not in either times or discharge rates. The decision that a particular reading is anomalous is a difficult one to computerize. When a human makes a decision of this sort, he (or she) makes it on many grounds. ego Could it have been due to an unrecorded change of pumping rate? Was a different probe used to take that reading? Was it taken by an unreliable or inexperienced operator? How does it compare to the other readings? It is only the last of these questions that can be answered by the computer; but even that one is not at all straight forward. It seems that animals in general, and perhaps humans in particular have remarkable abilities in recognition of lines; straight lines, curved lines, lines with one or more sharp angles. A computer can put the data on a graph, but it can't then stand back and look at it. What methods are available to a computer in making this sort of decision? A first step might be to take a statistical look at the data from one step and use linear regression to make a model of that data (since, with a simple confined aquifer, the data should approximate a straight line when plotted as drawdown vs. logarithm of time, see figure 6.3). Then we could have the computer test each datum pair in turn, and pick out any that were further away from the model than some arbitrary limit. But what if, during that discharge step, a boundary was encountered, and the line had a bend in it? (Figure 6.4.) Then the data furthest from that bend, and the data right on the bend, would have the worst fit when compared to the linear model, even if it contained no errors at all. Should we use two lines? But why stop at two? Perhaps then, we could instead test each datum pair in the way it fits in with it's neighbours. We could measure how far above or below the point that it might be expected to be from an examination of the points to either side. This also has it's problems. A 'correct' point might appear to be in the wrong place if both it's neighbours were too low, for example. Rightly or wrongly, it is a method of the second type which has been implemented here. First a linear regression model of the whole of the data for the discharge step is produced. Then, any datum pair which, in relation to one of it's neighbours, shows a slope of opposite sign to that of the linear regression, and in relation to the other neighbour, shows a slope at least four times that of the linear regression, is regarded as doubtful. The slope (using logs of times) is used rather than the distance between points on the horizontal scale. A point which seems anomalous when close to it's neighbours, might be acceptable when a greater distance separates the points. When this option is used, all datum points which appear to be doubtful under the above criteria will be reported, and then the user may, at the touch of a key, remove all of them.
6.14
Analysis
I suggest that this may be used as a guide, but that an examination of a graph of the data should also be made before deleting any data. Remember, if you decide to delete some of the points manually using option 7 of menu 2, that as soon as one datum set is deleted all sets with higher record numbers will be renumbered to fill the gap. (One way around this is to start deleting with the highest number, and work down.) 7.2. Option 2. Search for inflection points The catch in a computerised search for an inflection point is that some data series could contain two or more inflection points, rather than one. A search could be programmed for two inflection points, but it would have to be much more complex, and slower in operation. The implementation here searches for only one inflection. If you suspect two or more inflections, do two or more searches, each in the appropriate part of the data. As there seems to be some disagreement on the meaning of the word inflection (or inflexion) in dictionaries, a definition might be useful. The word is used here to describe a change in the slope of a series of data points plotted against the log of time. An inflection point, then, is the point at which the change of slope takes place. Figure 6.3 shows some 'noisy' data with no significant point of inflection, while an inflection is present in figure 6.4. Figure 6.3
Figure 6·3 s
i
10C)
time
--->
An example of 'noisy' data without any point of inflection. Figure 6.4
Figure 64
s
J
I~
x
l~. _.
)(.
.....X
x
x
x
x x
x
x
x log tirnc
->
An example of 'noisy' data with a point of inflection near the centre.
Analysis
6.15
The method The user is first asked whether he wants to define the starting and ending points by time or by record number. If the data consists of records relating to a number of steps, with times measured from the beginning of each step, then there may well be an ambiguity if the data segment is defined by times. (In this case the computer will consider the first occurrence of the starting time and then search for the first occurrence of the finishing time, which may relate to a different step.) If the discharge rate changed between the starting and finishing times given, the user will be notified, but the procedure will continue. A test will be made for a significant change of slope in the defined sectior. of the data, and if none is found the user will be informed and the procedure will be terminated. This test is done by making a linear regression of both the first and second halves of the data, and then comparing If neither slope is more than 5% steeper than the other, it will be them. considered that any inflection is insignificant. Assuming that a significant change in slope is found, a message will be displayed, and the search for the point of inflection will start. It is probably worth mentioning that if a large number of records are involved, the procedure could be rather slow. This is due to the nature of the procedure, which could be made more efficient, but at the cost of more complex programming, and perhaps occasionally missing the strongest inflection point. As it stands, the procedure is guaranteed to find the strongest inflection point, as defined by the lowest total absolute deviation. The search begins by measuring the slope of the line connecting the first two time-drawdown pairs. The total absolute deviation of those two data from this line is then calculated (in this case that should be zero of course). Next the slope of all of the data from the second pair onward is measured by linear regression, and the total absolute deviation is measured for this part. The two totals are summed, and the sum is recorded. Now the first three datum pairs are taken, and the total absolute deviation from the linear regression line calculated for those points is summed with that for the data from number three onward. This sum is compared with the first, and if it is the smaller, both it and the record number of the common point (number three in this case) are recorded. This process continues until the common point is the second to last, and then the inflection point is considered to be that for which the lowest total absolute deviation has been recorded. 7.3. Option 3. Calculate the average discharge rate Calculation will be from the beginning of the test to any given time. This simply sums the calculated quantity of water removed from the well as recorded for each reading, adds the amount of water removed between the specified time and the immediately preceding reading, and then divides the total by the specified time. It will not function correctly when the data relates to entirely separate steps with recovery in between.
6.16
Analysis
7.4. Option 4. Calculation of transmissivity Delta s and transmissivity will be calculated from any specified segment of the data. As for option 2 of menu 3 above, the desired segment of data may be specified by either time or record number (and the same conditions apply when times are specified for a test with full recovery between readings). Unlike option 2, if a change of discharge rate is found within the specified data, this operation will be terminated. For the calculation of T to work correctly, the data must be in the full recovery between steps form. Transmissivity calculated from the data of any stage other than the first, where there was no recovery between stages, will be effected by the modified slope of the drawdown line (due to residual effects of the previous step or steps). When the data has been marked, and it has been confirmed that there has been no change in discharge rate, the best fit slope is calculated by linear regression. Since the log function of microcomputers has the base e rather than the base 10, the slope is converted to it's base 10 counterpart before being reported as delta s. Finally the transmissivity is calculated from the slope and the discharge rate, and reported. Note that if you wish to calculate transmissivity from t/t1 residual drawdown, you will be requested to enter a value for the discharge rate as that on record is zero. The same appli~s to recovery. As a trial of this section, the transmissivity may be calculated from the output of program SIM1 using the test data given for table 4.1 and figure 4.1. If records 1 to 13 are used, a value of T=207 will be calculated, and for records 10 to 13, T=200.2. The first evaluation is slightly in error because the value of u for the earlier of these records would be quite large. You may also like to try the real discharge test data written in to this program (after conversion). You should find that T=76.5 for the data from 40 to 100 minutes in the first step, and T=37 for 825 to 1525 minutes in the last step. Presumably this difference is due to a discharge boundary showing up in the later part of the test. Option 5. In this menu there are actually two options number five. This is so because the storage coefficient can be caloulated only if the data applies to an observation well, and the well equation can only be oalculated if the data applies to a pumped well. Hence the option that you see in position five will depend on the type of well that you have specified. 7.5. Option 5a. Caloulation of storage ooefficient The method used to oalculate the storage coefficient is the solution of the Theis equation by Newtons method as used in program CB2N of ohapter three. The storage ooeffioient will be oaloulated from the values for time and drawdown recorded in the data veotors, from the value of R recorded in the test details, and from entered values for transmissivity and discharge rate. The time to be used for the caloulation is indicated by a value
Analysis
6.17
entered from the keyboard, then the program obtains the exact time value by searching the times vector. The user will be asked for the time for which he wants the storage coefficient calculated. After a time has been entered, the computer will check that there is a record for such a time, give or take 1 minute. If this test is passed, transmissivity and discharge rate will be requested. (Note that this option will not work if the times of the records are anything other than minutes.) As a test of the correct operation of this option, use the drawdown reading at t=0.208 days (299.5 minutes) from the data file output of program SIMl using the trial input for that program given for table 4.1. If Tis entered as 200, and Q as 300, S will be correctly calculated as 0.0004. 7.6. Option 5b. Evaluate the well equation (a) The s/Q vs. Q method will be used. This method is probably the simplest, and most commonly applied manually, of the solutions of the well equation. This analysis evaluates the coefficients of the equation 2 s=AQ+BQ Log t+CQ ,
(6.1)
where; s is the drawdown in the discharging well, t is time from commencement of discharge, in minutes. Q is the discharge rate, A and B are dependent upon characteristics of the aquifer, and C is the 'well loss'. The so called well loss is apparently due to the relatively high velocity flow near the well being turbulent. (While flow within a porous aquifer is very rarely sufficiently fast to be turbulent, flow through the slotted casing, gravel pack, or well screen, may be turbulent.) This first solution assumes the exponent in the third term to be two, while the next method evaluates that exponent. The coefficient B is directly proportional to the delta s slope of the time-drawdown data from a constant rate discharge test plotted with the drawdown on a linear scale, and the time on a logarithmic scale. Consequently, B is inversely proportional to transmissivity. Strictly speaking, the well equation is applicable only to discharge from a fUlly penetrating well in an infinite, homogeneous, isotropic, confined aquifer. In a confined strip aquifer for example, the second term is replaced by BQ root t. This work will not provide a detailed explanation of the use and limits of the well equation. A minimum of two discharge steps at different rates are required for solution by this method, and three or more are much better. Before starting the analysis, the data must be in the form of complete recovery between steps. The program calculates the drawdown at one minute (log time = 0) by
6.18
Analysis
linear regression. Then s/Q is calculated for each step, (where s is drawdown, and Q is discharge rate). Here the program departs from the manual method slightly. Manually, the s/Q values would be plotted on the y scale of a graph against Q on the x scale, with both scales being linear. The computer, of course, does not need to plot the data, but calculates the slope and y intercept of the best fit straight line, again by linear regression. This slope and y intercept are then used to calculate A and C of the well equation. Figure 6.5 illustrates this graphical method when performed manually. Figure 6.5
Figure 6· 5 002
0-01
_---y--
o
._-~-~.-
Q
_._.-
.----r-------..--.
----r---.~
--------r-
500
The data used to produce figure 6.5 is the example data built into the program. The steps used were; 11 Run the program and take the option of loading data from data statements. 2/ Use option 1 of menu 3 to find and delete anonalous readings. 31 Convert the data using option 8 of menu 1. 41 The later time data is inconsistent with that of the earlier part of the test, so it was deleted using option 8 of menu 2. (Delete readings 65 to 86.) 51 Choose option 5 of menu 3 to start the s/Q vs. Q analysis; enter a transmissivity of 70. The s/Q and Q values will now be calculated and listed. (I do not wish to imply that this is the way in which the most representative well equation should be obtained from this set of data.)
Analysis
6.19
The coefficients may now be calculated from: B = 0.183/T, YI, C = SL,
A
where YI is the y intercept, and SL is the slope, above. In the case of the example data, the y intercept was 0.0110, and the slope, 8. 92E-6 , this yielded A = 0.0110, B = 0.00261, C = 8.92E-6. This feature of DTDHA was tested on a data file of a simulated discharge test produced by program SIM7. The simulation was based on a well with the characteristics, A = 0.01, B = 0.02, C = 0.0001, and n = 2. The simulated discharge test was of four stages, Q = 100 kl/day for 0.1 days, then 200 kl/day for another 0.1 days, and two similar steps of 300 and 400 kl/day. The steps were consecutive, with no recovery in between. The data was loaded into DTDHA, and then option 8 of menu one was used to convert it to simulate full recovery between steps. Option 4 of menu three measured the transmissivity of the first step at 9.15 cubic metres per day per metre. The constants of the well equation were then calculated using the present option, and the values so produced were A = 0.0109, B = 0.02, and C = 0.0000948, a reasonably good result considering the approximate nature of the conversion method. 7.7. Option 6. Evaluate the well equation (b) Rorabaughs analysis (modified) will be used if this option is chosen. This has been adapted from Bouwer (1978) and was originally published by At some time, t, after the commencement of pumping, when Rorabaugh (1953). the water level is no longer declining rapidly, for any given discharge rate the drawdown, s, can be approximated by the equation; (6.2) Bouwer (1978, pp 83, 84) described the procedure. For each discharge stage s/Q-C is plotted against Q on double logarithmic paper. Then the f value of C is adjusted to give as straight a line as possible. This gives the value for C, and n can be calculated as the slope plus one. C can now be calculatea from the equation above. (Note that C here is theWwell w loss, identical to C in the notes on 5b above, except that here the exponent is not assumed to be two.) While this procedure is slow and tedious to do manually, it lends itself very well to computerisation. Given the transmissivity, drawdown and the discharge rate at a particular time, (these may either be entered by the user, or they will be calculated) the Y intercept of the delta s slope is calculated, and then the coefficients of the well equation may be evaluated using;
6.20
Analysis YI _. C,I
~,
On
o
0.1913 B
--Of
«. J)
C
T
These coefficients may now be used in a well equation of the form; (6.4)
s=AQ + BQ Log t + CQn
This method was checked against data produced by SIM7 similarly to the s/Q vs. Q method above. Results obtained were A = 0.00604, B = 0.0204, C = 0.000346, and n = 1.8. While these results seem to be inferior to those above, they may in fact not be. When used for projection the two calculated well equations produced the results below;
s/Q vs. Q Rorabaugh Simulation data
Q=100, Time=24.9 4.83m 4.79m 4.79m
Q=200, Time=2.41 7.49m 7.53m 7.53m
Q=400, Time=144 36.78m 36.80m 36.80m
While the constants produced by Rorabaugh's method did not agree well with those used to produce the simulated data, they suited the simulated data very well indeed, and the only faults may well be in the data conversion. 7.8. Option 7; Conversion from residual drawdown to recovery Before storage coefficient can be ca~culated from the data obtained during the final, zero discharge phase of an aquifer test, the measurements of residual drawdown must be converted to recovery. Recovery is defined roughly as follows. When discharge from a well is stopped, the water level rises. The height of the water level above the level at which it would have been had the discharge continued is the amount of the recovery at any given time. Method of calculation. The Delta s slope of the latter part of the drawdown phase is measured. (Alternatively the value of Delta s can be entered by the user.) All recovery period readings are then converted in both time and 'drawdown'. The times are changed to times from cessation of discharge, and the drawdowns are changed to the amount that the water level has risen above the projected Delta s line. The method was tested on artificial data produced by SIM1, and the recovery readings obtained were equal to the drawdown readings to three significant figures. I believe that analysing the results of a discharge test from recovery is valid only if the test consisted of a single discharge stage.
Analysis
8.
6.21
USE OF VARIABLES IN PROGRAM DTDHA. A general use single precision variable. A1 As above. A2 Used to sum the absolute deviations in the total absolute deviation sUbroutine, and to temporarily hold a calculated drawdown. Holds the slope on the lesser time side of the inflection point. A3 A4 Holds the slope on the greater time side of the inflection point. A5 Temporarily holds the first discharge rate. This value is then tested against other discharge rates. It is used for this purpose both in the inflection point search, and again in the calculation of delta s and transmissivity. AN Holds the number of data in the linear regression subroutine starting at 4200. AN(x) Holds the record numbers of the detected anomalies. The vector is limited to ten elements because it is not dimensioned. AV Holds the average slope in the Rorabaugh analysis. B A general use single precision variable. C The coefficient in the third term of the well equation. CO to cg Constants used in the evaluation of the well function. CF Constant for the formation in the Rorabaugh analysis. CS Coefficient of storage. CW Constant for the well in the Rorabaugh analysis; effectively identical to C in the well equation. D1 to D4 Defined functions used in the solution of the Well Function for S. See the notes on CB2N. DD A drawdown. DD(x) The main vector containing drawdown values. Holds selected drawdowns for the well equation calculations, and DE(x) also s/Q values. The number of datum sets currently held in memory. DP Delta s (base ten). DS A general use flag. F A flag Which, when set (=1) will stop the screen from being cleared FC on RETURN to any of the menus. A flag, which when set will stop the slope and Y intercept from FI being displayed in the linear regression subroutine. This flag is set when the subroutines loading the variables and FV defining the functions needed for the calculation of storage coefficient are called. It ensures that these subroutines will not be called twice in one run. G1 A numerical format. I The primary integer counter. II This is used as the primary counter at a second level. J The secondary integer counter. IS Holds the number of steps.
A
6.22
Analysis
An integer variable used to hold the number of the first record to delete. An integer was used because integer arithmetic is faster than floating point arithmetic. Used to hold the number of the last record to delete. JB The tertiary integer counter. K The counter for lines used (Line Count) on the current page of hard LC copy. The distance of the step that a datum is shifted when it is found M to be out of place in the Shell-Metzner sort. Holds the exponent in the third term of the well equation. N A defined function for solution of the well equation. N1 The second function for the solution of the well equation. N2 The number of the first record to be altered, deleted, or referencNF ed for some other purpose. The constant with which may be multiplied a natural logarithm to NG produce a ten base logarithm. (NG = ln10). The number of the last record number to be referenced. NL The disk file name. NM$ The counter for the pass number in the sort. P The first pointer. This is used to 'point at' a record of interest P1 for a number of operations. The second pointer. P2 The third pointer. P3 The forth pointer. These four pointers are used in the step data P4 conversion subroutine as follows; P1 and P2 point to the first and last records of the last converted step. (At the beginning, the first step of the discharge test.) P3 and P4 point at the first and last records of the step to be converted. The constant, Pi. PI Q Holds a particular discharge rate at various times. The discharge rate vector. Q(x) The discharge rate for the current step. Q1 The average discharge rate. QA QE(x) The discharge rate for step x for solution of the well equation. The sum of the discharges calculated for each period between QS records. QS(x) The vector of s/Q for each step for the Rorabaugh analysis. Either the distance from the observation point to the discharging R well, if the data applies to an observation well; or the effective radius of the well, if the data applies to a discharging well. A string used for various inputs which may have suffixes. ego When S used to enter drawdowns, if the string is suffixed with a q, then the program moves on to the section for entry of a discharge rate; if not then the discharge rate of the current datum set is made the same as that of the last. A string of sixty dashes, used for printed output. SD A heading for video and printed output. SR
JA
Analysis ST(x)
6.23
A string vector containing phrases descriptive of the type of test to which the data relates. SW(x) A string vector containing the type of well, either discharging or observation. SY A short string used to test for yes/no responses from the key board. T Transmissivity. T1 (x) The time recorded for the first reading in step x. T2(x) The time recorded for the second reading in step x. TD Total duration of discharge, and at a different time, the date of the month component of the time. TE Holds the finishing time (counting from the beginning of the whole test) of a step that has been converted, and at a different time, holds the date component of the time. TF The first time of interest. TI A selected, or entered, time. TI(x) The vector containing the time of each reading. TL The last time of interest. TL(x) Logarithm of time. TP The code number of the test type. TW The code number of the well type. U The value of u in the well function. U2 U squared. U cubed. U3 Accumulates a number of sums in various sections of the program. U5 Of general use. U6 Sums the absolute deviations, and used to hold x • y in both linear regression subroutines. Used to sum the x values in both linear regression subroutines. U7 Sums the y values in both linear regression subroutines. U8 Sums the x squared values in both linear regression subroutines. U9 The slope of a line. US W This holds the value of W(u), the well function. WO Used to adjust the value of u in Newtons method. WM As for WOo WU As for WOo X(x) Holds a vector of x values in the routine for producing the straightest possible line in the Rorabaugh subroutine. Y(x) Holds the y values, as above. YI The y intercept of a set of data, from linear regression. Z1(x) Detects the sign of the curvature of the line in the Rorabaugh analysis. Z1 to Z4 Dummy variables used to read the test description when merging a file from disk. The description from disk is not used because there is These variables are also used in already a description in memory. Rorabaughs analysis.
6.24 Z5 ZS ZX
Analysis
A marker for the first vacant datum set number above the existing data, at the beginning of merging with a disk file. Used in adjusting Cf in Rorabaughs analysis. Used for deletion. Note that the readings specifying the end limits will be deleted, as well as any readings between those end limits. This variable is also used in the single key entry routine.
9. PROGRAM DESCRIPTION This program is designed to be modifiable. As mentioned previously, modules may be added or deleted. The description below is given in an attempt to make this easier. The comments are given with the relevant line numbers. 1 - 70 Initialization Variables beginning with F, or letters from I to L are defined as integers; both to save memory and, more importantly, for greater speed. Variables beginning with either G or S are defined as string variables. Four vector arrays are dimensioned. One each for drawdown, time, log of time, and discharge rate. If more than two hundred records are to be entered, then this line should be changed accordingly. Lastly, two subroutines are called loading variables having constant values, and to enter and validate a file name. 210
240 Here the decision is made on whether data is to be loaded from a disk file or data statements. If neither is chosen, then it is assumed that data is to be entered via the keyboard, so a subroutine is called to enter the test description data.
240
270 The screen is cleared, and the heading for the main menu is printed, including the test description data.
280 - 360 Menu number one 370
390 Control of program execution as directed from menu one. There are two parts. Line 380 is used if the E key has been pressed; it will end the program if the user confirms that that is his desire. Line 390 calls the subroutine required to carry out the dictate of the user.
400
410 These two lines govern the return to menu one after the subroutine calls. If flag FC is set to one, then the screen is not cleared before menu one is displayed; this is used when a message from the previous subroutine is to be displayed.
700 - 830 Menu number two
Analysis 840
850 Control of program execution as directed from menu two. very similar to lines 370 - 390 above.
6.25 This is
860 Governs the return to menu two after the subroutine calls. 1000
1120 Menu number three. This menu is a little more complex than the other two because there are two options number 5 depending on whether the data is labelled as being from a discharge well or an observation well. Also, option number 6 is given only for discharge well data.
1130
- 1200 Control of program execution as directed from menu three. Again, this is a little more involved than the earlier menus because of the differing ways of treating items 5 and 6 depending on how the data is labelled Lines 1140 to 1150 deal only with observation well data, while 1160 deals only with discharge well data.
1210 Arranges clearing of the screen, if required, on return from the subroutine called after the option taken from menu three. 1500
1670 This major subroutine is responsible for the search for, and optional deletion of, anomalous drawdown readings. 1515 - 1530 sets markers for the beginning and end of the discharge stages, one at a time. At the end of this section, P1 has the record number of the first reading of the current step, and P2 has the record number of the last reading of the step. Line 1520 decides on whether the next reading is in the same step as the last by testing it's discharge rate against that of the last reading. It also checks for the end of the data as indicated by the value of DP. 1540 calls the linear regression subroutine to calculate the slope and y intercept of the data of the current step. This is calCUlated on drawdown vs. natural log of time. Lines 1545 and 1550 initialize the procedure by setting A equal to the sign (ie. positive or negative) of the slope between the first two points, and B equal to the sign of the slope between the second and third points. 1555 tests the first drawdown reading of the current stage. If the slope between the first and second readings is of the opposite sign to that between the second and third readings, and also opposite to the sign of the overall slope of the stage, the first reading is classed as anomalous, and the reporting routine is called (line 1675). The loop from lines 1560 to 1600 tests the values in the current stage after the first. Here a drawdown reading is classed as anomalous if the line joining it to it's neighbour on one side is of opposite slope to that of the whole stage, and the line joining it to it's neighbour on the other side has a slope of more than four times the slope of the whole stage. The last drawdown in any stage is not tested. Line 1595 causes the subroutine to terminate if ten anomalies
6.26
Analysis
are detected, as more than ten anomalous readings might indicate a fault in the method rather than in the data. 1615 1665 Prints the number of anomalies found and gives the option of deleting them. The job of deleting is done by the loop from 1635 to 1665, which starts with the last anomaly found, ie. the one with the highest record number, and next higher numbered record. anomalies. 1675
deletes it by overwriting it with the This process is repeated for all
1896 Search for and report, via the VDU, changes in the trend of the data. 1700 1748 This section accepts entries defining the segment of the data to be searched as either times or record numbers. Some checking for validity of the entries is done. 1752 1800 Does more checking for the validity of the entered values. The search is based on record numbers, no matter what unit was used to enter the beginning and ending of the chosen section. If the end points were entered as times, then the first record number for the search is found by lines 1756 to 1768. Similarly, the last record number is obtained from the given time by lines 1772 to 1776. The loop from 1792 to 1800 detects, and reports, any changes of discharge rate within the data segment. 1804 - 1808 Test the trend of the first half of the segment against that of the second half. If the difference in slope of the two is no more than 5% then 1812 reports no significant change in slope. (The trends are measured by the general purpose linear regression subroutine starting at line 4200. It uses logarithms of times.) The loop from 1820 to 1848 does the work of detecting the inflection point. In effect, it first assumes that the inflection point is immediately following the second record in the delineated section, and then 'fits straight lines to the parts of the data to either side of this point. The total absolute deviation of the data from those lines is then measured using the subroutine starting at line 1876. This value is recorded, as well as the location of the assumed inflection point, and then a new assumption is made that the inflection point is follOWing the third record. Again, the deviation is calculated. The minimum of the total absolute deviations is recorded, as well as the assumed inflection point associated with that minimum. This continues until the assumed inflection point is before the second to last reading. The inflection point is reported as being that corresponding to the minimum total absolute deviation. 1852 1860 Delta s and transmissivity is calculated for the two segments. 1864 Reports the location of the inflection point. 1896 This small subroutine calculates the total absolute 1876 deviation from the linear regression trend line for any segment of data.
Analysis
6.21
2000 - 2090 Alter the description of the test and well type. This very simple section allows the user to change the labels attached to the data in memory. The code is self explanatory. 2100 - 2110 Convert times to t/tl. Line 2110 calls a subroutine at 9100 which gets the user to enter the first and last record numbers of the section of the data to be converted. (ie. defining the recovery section.) The total duration of discharge is entered in line 2120. The loop from 2130 to 2150 converts the times in the vector TI(x) to tltl, and then line 2160 changes the label of the test type. 3000 - 3190 Convert residual drawdown to recovery. Lines 3010 to 3040 give a warning regarding the form in which the data is expected to be, and give a way out if the user decides to not proceed. 3050 3100 Here the beginning and end of each phase of the discharge test are labelled by storing the first reading reading of each phase in the vector Pl(x) and the last reading number of each in P2(x). The number of the last phase is stored in IS; this should be the recovery phase. 3110 3150 The procedure requires that the trend of the latter part of the drawdown be known, because recovery is defined as the rise of the water level above that trend line. Either the user can enter the slope as a Delta s (base 10) value, or it will be calculated. Line 3140 first sets pointers at the beginning and end of the last discharge phase, then it resets the first of the pointers to the fifth to last record if there are sufficient records in this phase. The latter part of the phase is used because the earlier part or any discharge phase may be effected by such things as well storage effects, and high values of u in the well function. Line 3150 calls the general purpose linear regression subroutine to calculate the trend. After this section, the Delta s (base e) slope is stored in the variable US. 3160 - 3180 All values in the defined part of the 'drawdown' vector are changed to recoveries in line 3110. This is done by taking the drawdown to be expected at the given time if the last drawdown phase had continued, and subtracting from that quantity the actual residual drawdown recorded. Line 3115 converts the values in the time vector to times from the beginning of recovery. 3400 - 3540 Newtons method; used to calculate storage coefficient. The operation of this section of program has been described in chapter 3; the description will not be repeated here. 3600 - 3635 Alteration of a single record. 3605 to 3610 The user enters a record number for correction, and the computer checks the validity of the number.
6.28
Analysis
Lines 3615 to 3620 print the data at present held in the given record number. 3625 to 3635 Entry of the correct data. 5650 - 3694 Add a constant to some or all of the data in one of the vectors. Line 3654 calls a small subroutine at 9100 so that the user may enter the first and last record numbers in which he is interested. 3658 3666 Directs program execution to the appropriate part of the program depending on the parameter to be altered. 3670 3674 Causes entry of a value, and then the addition of that value to all specified times. 3678 3682 Causes entry of a value, and then the addition of that value to all specified 'drawdowns'. 3686 3690 Causes entry of a value, and then the addition of that value to all specified discharge rates. 3700
3744 Multiplication of some or all of the data in one of the vectors by a constant. As this subroutine is very similar to that above it will not be described here.
3750 - 3795 Deletion of a number of records. 3755 3770 Accepts from the user, numbers for the first and last record to be deleted, and checks the validity of those numbers. 3775 3785 This section deletes the data by writing over it with values having higher record numbers. Finally the recorded total number of datum sets is adjusted in line 3785. 3800
3835 The merging of the data at present in memory with that contained in a disk data file. 3805 3815 Obtains the name of the data file from the user by a call to the subroutine starting at line 9600. 3820 - 3835 Reads in the data from disk and places it after all the data at present in memory; ie. the new data are given record numbers starting with the integer one greater than the last record in memory. Dummy variables Z1 to Z4 are used to receive the test description codes from the disk file in line 3825. (The test description will remain what it was before this operation.) The variable recording the total number of datum sets in memory is adjusted in line 3825 to include the number of the new data. The data is added to the vectors in line 3825.
3850 - 3898 Sorting of the data in memory into order of increasing time. This is achieved by use of a Shell-Metzner sort. Computerized sorting is described in other works (including Miller, 1981), and will not be dealt with in any depth here. In general, the sorting process works as follows.
Analysis
6.29
Time values in the first half of the vector are compared, one by one, with those in the second half of the vector. (The method compares the first value in the first half with the first value in the second half, then the second value in the first half with the second value in second half, etc.) Where a time in the first half is found to be greater than it's counterpart in the second half they are swapped. (At the same time the associated drawdown and discharge rate are also swapped.) When all of the first half has been checked against the values in the second half, the next phase is commenced. In the second phase, the step size is halved. ie. Instead of comparing values separated from each other by half the length of the vector, now values separated by a quarter of the length of the vector are compared, and swapped as necessary. As one swap in a higher numbered part of the vector may change a relationship between values in the lower numbered part of the vector, this process continues until no more pairs of times can be found to swap. In the third phase, the step size is again halved, and the checking and swapping process is repeated. This process goes on until the step size is reduced to one, and no more times that are out of order can be found. At that point, all times will be in order. 3900 - 3940 Delete a single record. This is a very simple subroutine which merely obtains a record number from the user, and then deletes that record by moving all records having higher numbers down to overwrite the unwanted data. 3950 - 3975 Insert a reading. Again, a very simple subroutine. A record number is requested of the user, then all records having numbers equal to, or greater than, that are moved up by one. This leaves the required space into which is placed the new record when it is obtained from the user. 4000 - 4150 Calculation of the average discharge rate. The weighted average discharge rate from the beginning of the test to any specified time is calculated. Lines 4010 to 4060 initialize this subroutine, enter the time, and check it's validity. 4070 Moves the pointer, I, to the first reading with non zero discharge (this will normally be either the first or second record). 4080 Supposing that discharge commenced at time = 0, line 4080 calculates the quantity of water discharged up to the first reading. The loop in lines 4090 and 4100 goes on to add the quantity of water discharged between each subsequent reading up to the specified time. Lines 4110 and 4120 then add on any discharge that there may have been between the last reading (with time lower than that specified) and the actual specified time.
6.30
Analysis Line 4130 calculates the average discharge per time unit. To summarize then, the total volume of water discharged is calculated, then this is divided by the specified time. The units will be those of your data. ego If you are using minutes and metres, the average discharge rate will be in cubic metres per minute.
4200 - 4360 Linear regression of 'drawdowns' vs log (base e) times. Linear regression gives the best fit straight line through a set of data in two parallel vectors according to the formula:
nLxy A
-LxIY
r:I./ . , rLx)2
(6.5)
where A is the slope of the best fit line through the vectors x and y. The variable n contains the number of values in each vector. The equation;
(6.6)
gives the y intercept, B. The values passed to this subroutine are; P1 and P2, the numbers of the first and last records to undergo linear regression, respectively. Lines 4210 to 4240 change times to logs of times, and line 4220 warns of, and alters, any zero time in the vectors. (Of course an attempt to calculate the log of zero would lead to an error message from the Basic interpreter). Line 4250 sets the variables U6, U7, UB, and U9 to zero, ready to receive the summations called for by equations (6.5) and (6.6) above. 4260 - 4310 Contain the loop which produces tha summations. The number of values involved is calculated in line 4320, and then the slope is calculated from equation (6.5) in line 4330, and the y intercept is calculated from equation (6.6) in line 4340. Finally, line 4350 will print the values of the slope and y intercept unless the flag FI is set. 4400
4484 The calculation of Delta s (base 10) and transmissivity for a given segment of the data. 4403 - 4421 Do the initialization. 4424 4430 Accept the entry of record numbers delimiting the segment of data to be used, and check their validity. 4433 4439 Accept the entry of times delimiting the segment of data to be used, and check their validity.
Analysis
6.31
4445 4463 Set the pointers NF (number of first record), and NL (number of last record), to times in the time vector close to those given by the user. Also, more checking is done in this section for validity of the entered times. 4466 4472 Check for a change in discharge rate within the chosen segment of the data, and if one is found, abort the procedure with an appropriate message. 4475 Calls the linear regression subroutine to get the best fit slope. 4476 If the discharge rate for the segment of data is zero (eg. in the case of t/t1 residual drawdown, or recovery), then the user is called upon to enter a discharge rate here. 4478 Calculates Delta s (base 10) from the linear regression slope and from NG which has the value of the natural log of 10. The same line goes on to calculate transmissivity. 4500 - 4584 Evaluation of the coefficients of the well equation by the s/Q vs Q method. 4502 Transmissivity is used to calculate the value of B. This line gets transmissivity from the user. 4508 - 4510 The procedure requires that the beginning and ending of each step be known, as well as the number of steps. The next major subroutine (conversion of step data) has the same requirement. On this line the general purpose flag F is set, and a subroutine call to 4804 is made. F is used in that procedure to indicate a required return to this subroutine after counting and marking of the steps. If flag FC is set on return from that call it indicates that there is an incompatibility in the data, so the procedure is aborted, and 4510 causes return to menu three. 4512 4518 This loop calls the general purpose linear regression subroutine at line 4200, and stores the y intercept for each step in vector DE(x) and the discharge rate for each step in QE(x). The counter II is used because I is used in linear regression. Note that the y intercept is the drawdown for each step projected back to log time = o. 4520 4540 Drawdowns (conventually represented by s) in vector DE(x) are replaced by s/Q (ie. drawdown over discharge rate) in line 4532. Line 4536 prints all values of s/Q and Q, so that the user may check the consistency of the data. 4544 Calls a special linear regression subroutine to obtain the slope and y intercept of the s/Q vs Q values. (The general use linear regression subroutine cannot easily be used because it is set up for drawdown vs log time.) 4548 4556 Calculates B from the transmissivity entered above, equates C to the slope, and A to the y intercept produced by the linear regression. Lines 4552 and 4556 display the calculated values of the coefficients of the well equation.
6.32
Analysis 4560 4580 Accepts discharge rates and times from the user, and uses the well equation, with it's calculated coefficients, to project a drawdown. Line 4564 ends this procedure any time that the user enters a zero discharge rate.
4600 - 4695 Rorabaugh's procedure requires a drawdown at a given time for each discharge stage. This is not entirely simple, because in any stage there may not have been a drawdown measured at exactly the time entered by the user; interpolation becomes necessary. This subroutine produces a drawdown at a given time for each stage. 4630 Enters the time for which the drawdowns are to be found. 4645 Sets the 'current' discharge rate, held in Ql, to the first non zero discharge rate in the data. 4650 If the given time is before the first time reading then the procedure is aborted. 4655 Calls 4610 if the given time is between the current time (of the data), and the next time. 4660 Detects the end of the data, and causes the procedure to be terminated when the end is reached. 4665 This line works with 4655 to search through the data of a discharge stage for times bracketing the given time. If the end of any step is reached without yet finding a time greater than that given by the user, this line causes the procedure to be aborted. 4610 Linearly interpolates the drawdowns associated with the times that bracket the given time, and records the interpolated drawdown in DE(U5). If it happens that the given time is exactly equal to a time in the data, then that time will be used. 4615 Records the discharge rate for the current stage in QE(U5). 4680 Displays the interpolated drawdown, and the discharge rate for the current stage. 4685 4690 These two lines work together to find the next discharge stage in the data, or the end of the data. If another discharge stage is found, then control passes back to line 4655, if the end of the data is found (ie. I=DP), then the procedure is concluded. 4100 - 4110 Calculation of storage coefficient. This subroutine does the more general work associated with the function. The Newtons Method subroutine starting at line 3400 does the actual 'hard work' of the calculation. 4105 4125 Obtain the time of the reading which is to be used for the solution, and verify that there is such a reading. On exiting this section, the integer variable I has the number of the relevant reading. 4130 A number of functions used in Newtons Method are defined in the subroutine at 8500, and a number of constants that are used in the polynomial approximation of the well function are loaded into program variables in the subroutine at 8600.
Analysis
6.33
4735 This line loads the values to be used in the solution into variables DD, Q, and TI. Note that time is converted from the minutes used in the main times vector to days for this calculation. 4740 4745 The transmissivity is entered into T in line 4740, and the discharge rate to be used for the calculation of storage is entered in line 4745. Note that line 4745 may be deleted if you would like Q to be automatically obtained from the value recorded in the discharge rate vector. 4750 Here the Newtons Method subroutine is called. It calculates the values of u, W(u), (the well function of u), and the storage coefficient. 4755 4765 This part displays the values of u, W(u), and storage, then waits on the user before proceeding back to the main menu. 4800 - 4972 Conversion of data taken from a stepped rate discharge test with no recovery between readings to simulate a series of discharge steps each starting from a state of full recovery. 4802 Flag F is set to zero here because the segment of code from 4804 to 4846 is also used by the subroutine solving the well equation by the s/Q vs Q method. In effect, flag F having a value of zero indicates that this segment of code is being used, in this case, for conversion of the data. 4804 4824 This section finds the first and last datum of each step, and sets markers in the vectors P1(x), (first datum for step x) and P2(x), (last datum for step x). Line 4820 will cause the procedure to be aborted is any discharge step contains only one datum. 4824 Causes the procedure to be aborted is there is only one discharge step in the data. 4832 4844 Displays the beginning and ending record number for each step, and also stores the times associated with those records in vectors T1(x) and T2(x). 4846 This returns execution to the well equation solution, if that was the calling subroutine. 4848 to 4864 Calculates the trend of the first discharge step. As there is often some effect of well storage in the first few readings, these will be omitted by line 4856, so long as there are at least seven readings in this stage. Line 4860 calls up the linear regression subroutine, and line 4864 saves the calculated slope in US(1) and the y intercept in YI(1). 4868 4952 This section converts the data of the second and sUbsequent steps. 4872 Sets the counter II to the number of the current step. 4880 4908 Converts the data of the current step. This is done one datum at a time, with the secondary counter J pointing at the current datum number. 4884 The drawdown due to the discharge rate of the previous step at the current time ,TI(J), is subtracted from the measured drawdown of the current record, DD(J), to give
6.34
Analysis the amount of the additional drawdown due to the increased discharge rate. 4888 Converts the time of the current record to time from the beginning of the current stage by subtracting the time of the ending of the last stage from the time of the current reading. 4892 Calculates the drawdown due to the previous rate at the current time as given by the linear regression. 4896 Calculates the converted drawdown by adding the drawdown due to the current discharge rate to that due to the previous discharge rate. 4900 stores the new time in the times vector, and line 4904 displays the converted time and drawdown. 4968 Skips the following section if the current step is the last. (In this case there is no need to project from the end of the current step in preparation for the next step.) 4916 - 4952 It is necessary to extend the trend line of the data of the current step so that the additional drawdown due to the next discharge rate may be calculated. 4920 Sets the pointers P1 and P2 to the latter part of the data of the current step. (The earlier part of the step is usually misleading because of the recent change in discharge rate.) 4922 Gets the slope and y intercept of the current stage in it's corrected form. Line 4924 stores these values in the vectors US(x) and YI(x). 4928 4952 Calculates the drawdown that would be be expected had the discharge rate of the current stage been continued. Line 4932 calculates the time for the plot that is to be added onto the end of the (measured) drawdown data. 4936 Calculates how far below the previous projected drawdown trend line the new plot is to be placed. 4940 Calculates the total drawdown of the extension plot by adding the drawdown to be expected from the previous discharge rate to that expected from the increase in discharge rate. Note that the time-drawdown data for these 'extensions' are temporarily stored in the main 'drawdown' and times vectors, at the end of all the normal data. 4960 The slope and y intercept of the extended data is now measured, so that this trend line may be used to move on to the correction of the following stage. If the explanation above is difficult to follow, I apologize. Unfortunately it is a complex procedure, but it does arrive at reasonably accurate answers, and at the time of writing I know of no better method.
5000 - 5395 Solution of the well equation by Rorabaugh's prooedure Line 5010 oalls the subroutine starting at line 4600 to obtain a time for the applioation of the prooedure, and a drawdown for eaoh step at that time.
Analysis
6.35
Line 5015 causes the value calculated for the drawdown at the given time from the beginning of discharge divided by the discharge rate for that step to be entered into vector QS(x). ie. Using conventional symbols, s/Q for the given time from the beginning of each step. 5025 and 5030 set a first estimate for CF at 1000 (constant for the formation). This is purposely very high. 5035 5055 Calculate the x and y coordinates for the natural log of the discharge rate, against the natural log of s/Q-CF. 5060 - 5070 Calculates the slope between each of the adjacent pairs of 'plots'. 5075 5085 Calculates the difference between the adjacent pairs of slopes. (These are called curves, for want of a better name.) 5095 5115 If there are more than three discharge stages, there will be more than one 'curve' In this case, the average curve is calculated in this section. 5120 Displays the current value of CF. As explained under 6.7 above, the aim is to obtain as straight a line as possible by adjusting CF. The adjusting of CF is done in lines 5140 to 5150. If it is found that the line is acceptably straight, line 5130 causes the procedure to move on to the next step. 5135 If, when CF:O, the 'curve' is found to be convex (ie. Z3<0), then the constant for the formation at this time is negligible, and due to minor data errors, appears to be negative. In this case it is made equal to zero and execution moves on to the next section after a message. 5160 The exponent in the well equation, N, is made equal to the average slope plus 1. 5165 5210 Display the results of Rorabaughs procedure. Here the best fit drawdowns for each discharge rate are given, as calculated by the coefficients produced by the procedure. These may be checked against the drawdown obtained from the data, and printed on the screen somewhat earlier. For the calculation of the remainder of the well equation, some more information is required. This includes transmissivity, a drawdown, and the discharge rate and time when that drawdown was recorded. 5215 - 5225 The user may enter transmissivity, discharge rate, time and drawdown, or the computer will obtain that information automatically from the data in the main vectors. These lines allow that choice. 5230 - 5235 Entry of data if the manual entry is chosen. 5240 Calculation of Delta s (base 10) and the y intercept from the data entered manually above. 5245 5270 This section checks that the latter part of the data contains the necessary data for solution of the remainder of the well equation. If there is found to be something lacking, the manual entry section above is resorted to. 5275 Discharge rate and transmissivity are calculated from the last five data, and are displayed.
6.36
Analysis 5280 5285 For both manual entry of data, and automatic calculation, the remaining coefficients of the well equation are calculated and displayed. 5290 Calls the latter part of the s/Q vs Q subroutine so that the user may obtain projections of drawdown using the well equation as evaluated by the Rorabaugh procedure. 5370 5395 A minor subroutine called in the case of CF being made equal to zero. It displays the message, and calculates the value of the exponent from the average slope.
5400 - 5510 The linear regression subroutine used to obtain the trend for s/Q vs Q for that method of evaluating the well equation. The method is identical to that in the subroutine starting at line 4200, except that in that case, the logarithm of one of the vectors (time) is used. 7000 - 7225 Keyboard entry of discharge test data. 7005 - 7010 Times may be entered in whatever unit the user chooses, or they may be entered as date and time of day. In the latter case, they will be stored as minutes automatically, but in the former case the user will have to use option 3 of menu 2 to convert times to minutes if he has entered times in some other units, and he wants to use such features as the calculation of transmissivity. These lines allow the user to decide on the system of entry that he will use. 7015 Increments the variable DP which keeps track of the number of the last record. 7025 - 7030 Give some instruction. 7035 Displays the last data entered. If the current entry is the first record, then non existent record zero will be displayed; this consists only of zeros. 7040 and 7045 Time is entered, and checked for a negative value. If it is found to be negative, then the subroutine is exited. 7050 7065 The drawdown is entered as a string in 7050, and then this is checked for the presence of a suffixed q in line 7055. If the q is found, then line 7055 goes on to make DD(x) equal to the part of the entered string without the suffix, and then causes discharge rate to be entered. 7060 Tests whether the value of the entered string is equal to zero, and if so, checks that this is intended. (It might have been an error caused by prefixing with a q, for example.) 7065 Makes DD(x) equal to the numerical value of the entered string. 7070 If the present entry is record number one, then discharge rate must be entered, otherwise this line makes the present recorded discharge rate equal to the last. 7075 Entry of discharge rate. 7080 7085 Incrementing of the counter, and return to line 7020 for entry of the next record. 7090 Return to the main menu.
Analysis
6.37
The next section deals with entry of times as time of day. See section 4.3 above for instructions on the use of this feature. 7110 7110 Entry of the date and time of the start of the test. Two variables are expected, both numeric. 7115 Variable TH is given the value of the entered hour of day by dividing the entered time by 100 and truncating the fractional part of the result. Variable TM is then given the part of the time that is the number of minutes past the hour by taking the difference between the entered value, and the hours multiplied by 100. 7120 and 7125 The date and time of day of the reading is entered here in a very similar way to that above. 7130 The counter of the number of entries is incremented, and the drawdown of the current record is entered. Function Tl calculates the current time as minutes from the start of the test. Then execution is directed to 7205 for entry of drawdown. 7135 Discharge rate is entered, and flag F is set to zero. 7140 As required, and indicated by flag F, the date on which the reading was taken can be entered here. If so, then function Tl is used to convert the time to minutes from the beginning of the test. 7145 7165 Displays the last entries, with times now converted to minutes, increments the data counter, and then displays some notes on using this section of the program. Finally, a string is entered for the time of reading. 7170 String S2 is given the suffix (if any) from the entered value. If it is found to be an f, then data entry is terminated. 7175 The suffix is compared to d. If it is a d, then flag F is set and will later be used to cause a date to be requested. 7180 Checks for an unintentional zero, similarly to line 7060 above. 7185 If the ASCII value of the last character is greater than 57 then it is not a numeral, and is removed. 7090 7195 The minutes past the hour are placed in variable TN, and if it is given, the hour of the day is placed in TG. Note that if the entry consisted of no more than two numerals, the hour of the day remains as it was. 7200 If flag F has been set back in line 7175, then this line causes a jump to line 7140 for the entry of a different date. 7205 Entry of drawdown for any but the first record entered in the present use of this subroutine. 7210 7220 A suffix of q on the entered drawdown is tested for, and if found then flag F is again used to indicate that more data is required. In this case, if flag F is set, a discharge rate will be requested by line 7135. 7225 DP is incremented before entry of a reading, so if no reading is entered it must be decremented. This line does that, and then causes a return to the main menu.
6.38
Analysis
7250 - 7360 Display of the data in memory. 7260 Clears the screen, and sets ZX to zero. ZX is used as a flag in line 7330. 7270 - 7280 A user may not be interested in looking at the whole of a large file, so here the option is given of entering a record number for the beginning of the display. Line 7280 checks the entry for validity. 7290 7340 Displays the data a page at a time. String SH is the heading of the page. The test on line 7320 is true every time that the current reading number is devisable by twenty; when true, the delay subroutine beginning in line 7370 is called. If e is pressed to request exiting from the display subroutine, then ZX will be found to be greater that two in line 7330. 7350 Causes a delay when the last datum set has been displayed. 7360 Is the return to the main menu. 7350 - 7390 This is a delay subroutine, so that the user can study a display on the screen as long as he needs to before going on. It very simply prints a message, sets the string of valid characters in Z$, and calls on the subroutine at 9800 so that as soon as one of the valid characters is received from the keyboard, the return (to the calling subroutine) in line 7360 will be executed. 7500 - 7650 This subroutine sends the information contained in the data file in memory to the printer, so that the user may have a paper copy. 7510 Prints four blank lines at the top of the page. 7520 - 7540 Print the descriptive details of the current test. 7560 7640 The drawdown, time, and discharge rate data are printed. This is very similar to the display of file details above, except that the line count goes to 55 instead of 20, and when that figure is reached, the printer is rolled on to the next page (lines 7600 and 7610). A string of dashes is printed after every fifth line of data to make the listing easier to read. 7650 Causes return to the main menu. 7750 - 7990 The user has the option of typing his data into data statements rather than using the interactive data entry subroutine built into the program. This section contains and reads in those data statements. 7760 Sets the test type, well type, the value of H, and initializes the integer counter to one. 7770 This line reads in time and drawdown data until it comes to a time value of minus one. This is the marker of the end of the data statements. 7780 Variable DP is given the number of data in memory. The initial conditions are included in the data set built into the program; hence Q in the first record is made zero. 7790 - 7860 Fill the discharge rate vector.
Analysis
6.39
7870 Is the return to the main menu. 7872 7906 Are the data statements for the trial data that is built into the program. If the user wishes to write in his own data, this present data should be deleted, and replaced with the users data. Do not delete line 7990 as this is the marker of the end of the data. 8000 - 8090 Reading data from a disk data file. 8010 If TP has not been given a value (indicating the type of test), then it indicates that there is no data at present in memory. 8020 - 8070 Checks that the user is sure that he wants to overwrite any data that there may be in memory, and then checks that the current file name is the one to use. If the user does not want to use the current file name, then the subroutine at line 9600 is called to enter a new file name. 8080 8120 Reads the data from the specified sequential access disk file, then returns to the main menu. 8250 - 8320 Saves the data in memory to a sequential access disk file. 8260 8270 Checks whether the present file name is acceptable; if not then a call is made to 9600 for a new file name. 8280 - 8320 Reads the data in from the disk file. 8500
8570 The calculation of storage coefficient uses Newtons Method to solve the polynomial approximations to the Theis function for S. This requires not only the polynomial approximations themselves, but also their derived functions. These mathematical functions are defined in this section.
8600
8650 In this section values are given to variables that will have fixed values throughout the program.
9100
9150 A number of options in the program require the portion of the data that is to be searched, analysed, or altered to be defined by a first and a last record number. This section enters those values. If the user enters no values, then the operation will default to the first and last records.
9400
9420 This is to delay program execution so that the user has as much time as he requires to study the display. On the key C being pressed, execution resumes.
9500
- 9590 Loads a number of strings, numerical values, and functions, to be used in various parts of the program.
9600
9610 This subroutine, which obtains and verifies a file name from the user is used in a number of the programs in this book. It checks that the name given is no longer that eight characters, that the first
6.40
Analysis character is a letter, and that all the other characters are either letters or numerals. 9620 Rejects a name that is too long. 9630 Rejects the first character if it is found to be other than a letter. 9650 Rejects any character other than the first if it is neither a letter nor a numeral. 9670 Adds the suffix ".WTD" (for well test data) to the file name.
9800
- 9850 This subroutine waits until the user enters any character that is contained in the string Z$. As soon as this condition is fulfilled, a number indicating the position of that character within the string is given to the variable ZX, and the return is performed.
9999 I usually have an end statement at line 9999 so that any special commands to set up a printer may be cancelled on completion of the program. As this program is designed to work with very many printers, only the END statement itself is needed. 10.
REFERENCES
Bouwer, H., 1978. Groundwater Hydrology. McGraw-Hill Kogakusha Ltd. 80pp. Rorabaugh, M.I., 1953. Graphical and theoretical anal. of step-drawdown tests of artesian wells. Proc. Am. Soc. Civ. Eng. 79, separate No. 362, 23 pp. Miller, A.R., 1981. Basic Programs for Scientists and Engineers. Sybex, Berkley, California. 318 pp. Sibenaler, X.P., 1979. Quorn Town Water Supply Well 3. Unpub. Rpt., Rpt. Bk. No. 79/11. S. Australian Dept. Mines & Energy.
Analysis 9.
PROGRAM LISTING.
Discharge Test Data Handling and Analysis, program DTDHA. 1 REM ••••• DTDHA/BAS ••••• 2 REM • Last modified 21st. May, 1986 10 CLEAR 200:REM n Reserve string space. Not required on most computers. Discharge Test Data Handling and Analysis." 20 CLS:PRINT" 30 DEFINT F,I-L:DEFSTR G,S 40 DIM DD(200),TI(200),TL(200),Q(200) 50 GOSUB 9500:REM # Load strings & cons tans 60 PRINT 70 GOSUB 9600:REM # Get file name 200 REM === Control section === 210 PRINT 220 PRINT"Do you want to load a disk data file?":Z$=SY:GOSUB 9800:IF ZX<3 THEN ZX=1:GOTO 390 222 PRINT"Do you want to load data from data statements?" 224 Z$=SY:GOSUB 9800:IF ZX<3 THEN GOSUB 7750:GOTO 240 230 GOSUB 2000:REM n Enter test description 240 CLS 250 PRINT"Main menu; Menu No. 1";:PRINT TAB(35);"No. of records is";DP 260 PRINT"Test type, ";ST(TP);TAB(40)"Well type, ";SW(TW) 270 PRINT"File name, ";NM$;TAB(40);"R =";R:PRINT 280 PRINT"Enter your choice" 290 PRINT"Load a file from disc • 1" 2" 300 PRINT"Save the file to disc . 310 PRINT"Keyboard entry of (additional) data 3" 4" 320 PRINT"Alter the current file (Menu 2). 5" 330 PRINT"View the current file • 6" 340 PRINT"Print the current file 7" 350 PRINT"Alter the test description data 8" 353 PRINT"Convert step drawdown and times 9" 356 PRINT"Test analysis menu (Menu 3) E" 360 PRINT"End • 370 Z$="12345678geE":GOSUB 9800 380 IF ZX>9 THEN PRINT"You want to end the program?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 240 ELSE 9999 390 ON ZX GOSUB 8000,8250,7000,700,7250,7500,2000,4800,1000 400 IF TP=O THEN 230 410 IF FC=O THEN 240 ELSE FC=O:GOTO 250 700 REM === Menu No. 2 === 710 CLS 720 PRINT"Data modifying menu; Menu No.2." 730 PRINT"What type of modification?" 740 PRINT"Individual entries 1" 2" 750 PRINT"Add a constant to entries
6.41
6.42
Analysis
760 PRINT"Multiply entries by a constant 3" 770 PRINT"Convert time to tit 1 . 4" 5" 780 PRINT"Merge current data with another file 790 PRINT"Sort into order of increasing time 6" 800 PRINT"Delete a reading 7" 8" 810 PRINT"Delete a number of readings. 820 PRINT"Insert a reading 9" 830 PRINT"Return to main menu R" 840 Z$="123456789rR":GOSUB 9800:IF ZX>9 THEN RETURN 850 ON ZX GOSUB 3600,3650,3700,2100,3800,3850,3900,3750,3950 860 IF FC=O THEN RETURN ELSE FC=O:GOTO 720 1000 REM === Test analysis menu === 1010 CLS 1020 PRINT"Test Analysis Menu; Menu No.3." 1030 PRINT"which option?" 1040 PRINT"Search for (and remove) anomalous readings. 1" 1050 PRINT"Search for inflection points 2" 1060 PRINT"Calculate average discharge rate . 3" 1070 PRINT"Calculate transmissivity from data segment 4" 1080 IF TW=l THEN 1100 1090 PRINT"Calculate storage coefficient from datum 5":GOTO 1115 5" 1100 PRINT"Evaluate well equation by s/Q vs , Q method 1110 PRINT"Evaluate well equation by Rorabaughs method 6" 1115 PRINT"Convert residual drawdown to recovery 7" 1120 PRINT"Return to Main Menu R" 1130 IF TW=l THEN 1160 1140 Z$="123457rR":GOSUB 9800:IF ZX>6 THEN 1210 1145 IF ZX=6 THEN ZX=7 1150 GOTO 1170 1160 Z$="1234567rR":GOSUB 9800:IF ZX>7 THEN 1210 1170 IF ZX=5 THEN 1200 1180 ON ZX GOSUB 1500,1700,4000,4400,9999,5000,3000 1190 GOTO 1210 1200 ON TW GOSUB 4500,4700 1210 IF FC=l THEN FC=O:GOTO 1020 1220 RETURN 1500 REM === Search for, and opt. delete, anom. readings _ 1505 CLS:PRINT"Searching for anomalous readings." 1510 REM -- Mark beginning and end of steps -1515 Pl=1:P2=1:FI=1:K=0 1520 IF Q(P2+1)=Q(P2) AND P2<=DP THEN P2=P2+1:GOTO 1520 1525 IF P2>DP THEN P2=DP:GOTO 1535 1530 IF Pl=P2 THEN Pl=Pl+l:P2=P2+1:GOTO 1520 1535 REM -- Check current step -1540 GOSUB 4200:REM # Linear regression 1545 A=SGN«DD(P1+1)-DD(P1))/(TI(P1+1)-TI(P1))) 1550 B=SGN«DD(P1+2)-DD(P1+1))/(TI(P1+2)-TI(P1+1)))
Analysis 1555 IF A<>O AND A<>SGN(US) AND A<>B THEN J=P1:GOSUB 1675 1560 FOR J=P1+1 TO P2-1 1565 A=SGN«DD(J)-DD(J-1»/(TI(J)-TI(J-1») 1570 B=(DD(J+1)-DD(J»/(LOG(TI(J+1»-LOG(TI(J») 1575 IF A<>O AND A<>SGN(US) AND B>4*US THEN GOSUB 1675 1580 A=SGN«DD(J+1)-DD(J»/(TI(J+1)-TI(J») 1585 B=(DD(J)-DD(J-1»/(LOG(TI(J»-LOG(TI(J-1») 1590 IF A<>O AND A<>SGN(US) AND B=>4*US THEN GOSUB 1675 1595 IF K=10 THEN PRINT"Too many anomolies.":FC=l:GOTO 1670 1600 NEXT J 1605 IF P2<>DP THEN P1=P2:GOTO 1520 1610 REM -- Option of deleting -1615 IF K=O THEN PRINT"No anomalies found":FC=1:GOTO 1670 1620 PRINT"Do you want all the anomalies deleted?":Z$=SY 1625 GOSUB 9800:IF ZX>2 THEN 1670 1630 PRINT:PRINT"Deleting" 1635 FOR I=K TO I STEP -1 1640 FOR J=AN(I)+1 TO DP 1645 TI(J-1)=TI(J):DD(J-1)=DD(J):Q(J-1)=Q(J) 1650 NEXT J 1660 DP=DP-1 1665 NEXT I 1670 FI=O:RETURN 1675 REM -- Report, and record, anomalous readings 1680 K=K+1:AN(K)=J:PRINT"Anomalous reading at time ="jTI(J) 1685 PRINT"A ="jAj", B ="jBj", General slope ="jUS 1695 RETURN 1700 REM === Search for inflection point === 1704 CLS:PRINT" Search for point of inflection between given limits." 1708 PRINT"You may indicate the data you want to use by number or by time." 1712 PRINT"If you use time and the data is that of a step test with" 1716 PRINT"recovery between steps, then the search will start at the" 1720 PRINT"first step reaching that time." 1724 PRINT"Do you want to enter imes or ecord numbers?" 1728 Z$="TtRr":GOSUB 9800:IF ZX<3 THEN 1744 1732 INPUT"First and last record numbers for search (eg. 24,34)"jNF,NL 1736 IF NFDP OR NF>=NL THEN PRINT"Invalid":GOTO 1732 1740 GOTO 1780 1744 INPUT"Earlyer and later time limits (eg. 100,1000)"jTF,TL 1748 IF TF>=TL THEN FC=l:PRINT"Invalid entryl":GOTO 1872 1752 REM -- Check for change of Q, and set markers -1756 I=l:IF TI(4»=TL THEN PRINT"Upper time too lowl":FC=l:GOTO 1872 1760 IF TI(I»=TF THEN NF=I:GOTO 1772 1764 I=I+1:IF I=DP THEN PRINT"Lower time too greatl":FC=l:GOTO 1872 1768 GOTO 1760 1772 IF TI(I)=TL THEN NL=I:GOTO 1780
6.43
6.44 1774 1776 1780 1784 1788 1792 1796 1800 1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 2100 2110
Analysis IF TI(I»TL THEN NL=I-1:GOTO 1780 I=I+1:IF IA5 THEN PRINT"Change of Q at time ="iTI(I):A5=Q(I) NEXT I FI=1:P1=NF:P2=INT«NF+NL)/2):GOSUB 4200:A=US P1=P2:P2=NL:GOSUB 4200:IF ABS(1-US/A».05 THEN 1816 PRINT"No significant change in slope.":GOSUB 9400:GOTO 1872 A1=1E+30:PRINT"Inflection presentj evaluating.":PRINT FOR J=NF+l TO NL-1 P1=NF:P2=J:GOSUB 4200:REM U Linear regresion GOSUB 1876:REM U total absolute deviation A=US:A2=U6 Pl=P2:P2=NL:GOSUB 4200:GOSUB 1876 A2=A2+U6:IF A2O THEN PRINT"Alter test type?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 2040 PRINT"Press the number of the test type." PRINT "1, ";ST(1) ,"2, "iST(2):PRINT"3, "iST(3),"4, "iST(4):Z$="1234" :GOSUB 9800:TP=ZX IF TW<>O THEN PRINT"Alter well type?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 2070 PRINT"Press the number of the well type." PRINT "1, "iSW(1),"2, "iSW(2):Z$="12":GOSUB 9800:TW=ZX IF ROO THEN PRINT"Alter R?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 2090 INPUT"What value for R"jR RETURN REM === Convert times to t/tl _ CLS:GOSUB 9100:REM # Get first and last line numbers
Analysis 2120 2130 2140 2150 2160 2170 3000 3010 3020 3030 3040 3050 3060 3070 3080 3100 3110 3120 3130 3140 3150 3160 3170 3175 3180 3190 3400 3410 3420 3430 3440 3450 3460 3470 3490 3500 3510 3520 3540 3600 3605 3610 3615
INPUT"Total duration of discharge"jTD FOR I=NF TO NL TI(I)=TI(I)/(TI(I)-TD) NEXT I TP=4:REM # Test type is now t/t1 recovery RETURN REM === Convert residual drawdown to recovery _ CLS:PRINT" This procedure assumes that there is only one recovery phase" PRINT"and that that is at the end of the test." PRINT"ontinue or <E>xit?":Z$="CcEe":GOSUB 9800:IF ZX>2 THEN 3190 PRINT"Calculating" I=1:Pl(1)=1:P2(1)=1:J=1:IF Q(l)=O THEN J=2:P1(1)=2:P2(1)=2 J=J+1:IF Q(J)=Q(P1(I» AND J<=DP THEN P2(I)=J:GOTO 3060 IF J>DP THEN 3100 I=I+1:P1(I)=J:P2(I)=J:GOTO 3060 IS=I PRINT"Will you enter Delta s (if not, i t will be calculated from the last" PRINT"5 drawdown readings)?":Z$=SY:GOSUB 9800:IF ZX>3 THEN 3140 INPUT"Delta s (base 10)"jA:US=A/NG:GOTO 3160 P1=P1(IS-1):P2=P2(IS-1):IF P2-P1>4 THEN P1=P2-4 GOSUB 4200:REM U Linear regresion FOR I=Pl(IS) TO P2(IS) DD(I)=DD(P2(IS-1»+US*LOG(TI(I)/TI(P2(IS-1»)-DD(I) TI(I)=T(I)-TI(P2(IS-l» NEXT I RETURN REM === Newtons method === W=DD*4*PI*T/Q:U=.01:F=0:I=0:REM PRINT"W ="jW U2=U*U:U3=U*U2:I=I+l:IF 1>99 THEN PRINT"Failure to converge.":FC=1: GOTO 3540 IF U<1 THEN WU=FN N1 ELSE WU=FN N2 WM=WU-W REM PRINT"WU="jWU,"u="jU,"WM="jWM WO=ABS(W-WU):IF WO<W*TL THEN 3520 IF U<1 THEN U=U-WM/FN D4 ELSE U=U-WM/FN D3 IF U<=O AND F=O THEN U=.0001:F=1 ELSE IF U<=O AND F=1 THEN U=1E-10:F=2 ELSE IF U<=O AND F=2 THEN U=9.999999E-21 IF U>80 THEN U=80 GOTO 3420 CS=U*4*T*TI/(R*R) RETURN REM -- Alter single entry -CLS:INPUT"Number of entry to modify"jA IF A>DP OR A<1 THEN CLS:PRINT"Errorj no such entryl":FC=1:RETURN PRINT"Present values arej"
6.45
6.46
Analysis
PRINT"Time ="jTI(A)jTAB(21);"DD =";DD(A)jTAB(42);"Q =";Q(A) ";TI(A) INPUT"Time ";DD(A) INPUT"Drawdown INPUT"Discharge rate ";Q(A) RETURN REM -- Add a constant to some/all entries -CLS:GOSUB 9100:REM # Get first and last line numbers PRINT"ime, rawdown, or Discharge ate7" Z$="TtDdRr":GOSUB 9800 IF ZX>4 THEN 3686 ELSE IF ZX>2 THEN 3678 INPUT"Constant to add to times"jA FOR I=NF TO NL:TI(I)=TI(I)+A:NEXT I:GOTO 3694 INPUT"Constant to add to drawdowns";A FOR I=NF TO NL:DD(I)=DD(I)+A:NEXT I:GOTO 3694 INPUT"Constant to add to discharge rates";A 3690 FOR I=NF TO NL:Q(I)=Q(I)+A:NEXT I 3694 RETURN 3700 REM -- Multiply by a constant -3704 CLS:GOSUB 9100:REM # Get first and last line numbers 3708 PRINT"ime, rawdown, or Discharge ate7" 3712 Z$="TtDdRr":GOSUB 9800 3716 IF ZX>4 THEN 3736 ELSE IF ZX>2 THEN 3728 3720 INPUT"Constant to multiply times by";A 3724 FOR I=NF TO NL:TI(I)=TI(I)-A:NEXT I:GOTO 3744 3728 INPUT"Factor to multiply drawdowns by";A 3732 FOR I=NF TO NL:DD(I)=DD(I)-A:NEXT I:GOTO 3744 3736 INPUT"Factor to multiply discharge rates by";A 3740 FOR I=NF TO NL:Q(I)=Q(I)-A:NEXT I 3744 RETURN 3750 REM -- Delete a number of records 3755 CLS:PRINT"This option deletes a number of consecutive records." 3760 INPUT"Enter the number of the first record to delete";JA 3765 INPUT"Enter the number of the last record to delete";JB 3770 IF JA>=JB OR JB>DP OR JA<1 THEN PRINT"Invalid entry; nothing deleted.":FC=1:GOTO 3795 3775 FOR I=JA TO JA+DP-JB-1 3780 TI(I)=TI(I+JB-JA+1):DD(I)=DD(I+JB-JA+1):Q(I)=Q(I+JB-JA+1) 3785 NEXT I:DP=DP-(JB-JA)-1 3790 PRINT"The data has been deleted.":FOR I=1 TO 500:NEXT I 3795 RETURN 3800 REM -- Merge with another file -3805 CLS:PRINT"Enter the name of the file you want to merge." 3810 PRINT"The new data will be placed at the end of the present data." 3815 GOSUB 9600 3820 OPEN"I" ,#1 ,NM$ 3825INPUT#1,Z1,Z2,Z3,Z4:Z5=DP+1:DP=DP+Z4 3830 FOR I=Z5 TO DP:INPUT#1,TI(I),DD(I),Q(I):NEXT I 3620 3625 3630 3635 3640 3650 3654 3658 3662 3666 3670 3674 3678 3682 3686
Analysis 3835 CLOSE 3840 RETURN 3850 REM -- Sort into order of increasing time -3853 PRINT"Sorting has started." 3856 P=O:M=DP:F=O 3859 M=INT(M/2):IF M=O GOTO 3898 3862 P=P+1:PRINT"Pass ="jP,"M ="M 3865 FOR K=1 TO M 3868 I=K:J=K+M:F=O 3871 IF TI(I)<=TI(J) GOTO 3883 F=1:B=TI(I):TI(I)=TI(J):TI(J)=B 3874 3877 B=DD(I):DD(I)=DD(J):DD(J)=B 3880 B=Q(I):Q(I)=Q(J):Q(J)=B 3883 I=J:J=J+M:IF J<=DP THEN GOTO 3871 3886 IF F=O THEN 3892 3889 GOTO 3868 3892 NEXT K 3895 GOTO 3859 3898 RETURN 3900 REM -- Delete a record 3905 CLS:INPUT"Which record No. to delete"jB 3910 FOR I=B TO DP-1 3915 TI(I)=TI(I+1):DD(I)=DD(I+1):Q(I)=Q(I+1) 3920 NEXT I 3925 DP=DP-1:PRINT"Record No."jBj" has been deleted, all records with higher" 3930 PRINT"numbers have been renumbered." 3935 FOR 1=1 TO 2000:NEXT I 3940 RETURN 3950 REM -- Insert a reading 3955 CLS:INPUT"What reading No. to insert";B 3960 DP=DP+1:FOR I=DP-1 TO B STEP-1 3965 TI(I+1)=TI(I):DD(I+1)=DD(I):Q(I+1)=Q(I) 3970 NEXT I 3975 INPUT"Time"jTI(B):INPUT"Drawdown";DD(B):INPUT"Discharge rate";Q(B) 3980 RETURN 4000 REM === Calculate average discharge rate === 4010 CLS:PRINT"Warning: this option will give false answers if used on a" 4020 PRINT"data file that has been adjusted to simulate full recovery" 4030 PRINT"between discharge steps." 4040 INPUT"Average pumping rate to what time";TI 4050 IF TI>TI(DP) THEN PRINT"Time beyond end of testl":GOTO 4040 4060 I=1:PRINT:PRINT"Calculating" 4070 IF Q(I)=O THEN I=I+1:GOTO 4070 4080 QS=TI(I).Q(I) 4090 I=I+1:IF TI(I»TI THEN 4110 4100 QS=QS+(TI(I)-TI(I-1».Q(I):GOTO 4090 4110 IF TI(I-1)=TI THEN 4130
6.47
6.48 4120 4130 4140 4150 4200 4210 4220 4230 4240 4250 4260 4270 4280 4290 4300 4310 4320 4330 4340 4350 4360 4400 4403 4406 4409 4412 4415 4418 4421 4424 4427 4430 4433 4436 4439 4442 4445 4448 4451 4454 4457 4460 4463 4466
Analysis QS=QS+(TI-TI(I-1»'Q(I) QA=QS/TI PRINT"Average discharge rate is "iQA GOSUB 9400:RETURN REM === Linear regresion, drawdown data --FOR I=P1 TO P2 IF TI(I)=O THEN PRINT"ERROR: Linear regresion from zero time." :TL(I)=-1000001:GOTO 4240 TL(I)=LOG(TI(I» NEXT I U6=0:U7=0:U8=0:U9=0 FOR I=P1 TO P2 U6=U6+TL(I)'DD(I) U7=U7+TL(I) U8=U8+DD(I) U9=U9+TL(I)'TL(I) NEXT I AN=1+P2-P1 US=(AN'U6-U7'U8)/(AN'U9-U7'U7) YI=(U8'U9-U7'U6)/(AN'U9-U7'U7) IF FI<>1 THEN PRINT"Slope = "jUS," Y intecept = "iYI RETURN REM === Calculate delta s and transmissivity === CLS:PRINT"Calculation of delta s and transmissivity." PRINT"You may indicate the data you want to use by number or by time." PRINT"If you use time and the data is that of a step test with" PRINT"recovery between steps, then T will be calculated for the" PRINT"first step reaching that time." PRINT"Do you want to enter imes or ecord numbers?" Z$="TtRr":GOSUB 9800:IF ZX<3 THEN 4433 INPUT"First and last record numbers for calculation (eg. 24,34)" iNF,NL IF NF<1 OR NL>DP OR NF>=NL THEN PRINT"Invalid":GOTO 4424 PRINT"Working":GOTO 4463 PRINT"Enter the lower and upper time limits of the data" INPUT"segment. (eg. 100,1000)"jTF,TL:PRINT"Working" IF TF>=TL THEN FC=1:PRINT"Invalid entryl":GOTO 4484 REM -- Check for change of Q, and set markers -I=1:IF TI(2»=TL THEN PRINT"Upper time too lowl":FC=1:GOTO 4484 IF TI(I»=TF THEN NF=I:GOTO 4457 I=I+1:IF I=DP THEN PRINT"Lower time too greatl":FC=1:GOTO 4484 GOTO 4448 IF TI(I»=TL THEN NL=I:GOTO 4463 I=I+1:IF I
Analysis
6.49
4469 IF Q(I) <>A5 THEN PRINT"Change of Q at time =" iTI (1) i ", reading H"jI:FC=l:GOTO 4484 4472 I=I+1:IF I<=NL THEN 4469 4475 P1=NF:P2=NL:GOSUB 4200 4476 IF Q(NF)<=O THEN PRINT"Q = "iQ(NF)j", enter a value for Q"i:INPUT Q ELSE Q=Q(NF) 4478 PRINT"Delta s ="jUSING," Transmissivity ="i.183 IQ/(USING) 4481 GOSUB 9400 4484 RETURN 4500 REM === Evaluation of well equation by s/Q vs. Q === 4502 INPUT"What value for transmissivity for this calculation"jT 4504 CLS:PRINT"Well equation by s/Q vs. Q method" 4508 F=l:GOSUB 4804:REM n Count and mark steps 4510 IF FC=l THEN 4584 4512 FOR 11=1 TO IS 4514 PRINT"Step"iIIj:P1=Pl(II):P2=P2(II):GOSUB 4200:REM n Linear regression 4516 DE(II)=YI:QE(II)=Q«P1+P2)/2) 4518 NEXT II 4520 PRINT"Below are the values used to calculate the slope and intercept." 4524 PRINT"s/Q","Q" 4528 FOR 1=1 TO IS 4532 DE(I)=DE(I)/QE(I) 4536 PRINT DE(I),QE(I) 4540 NEXT I 4544 U5=IS:GOSUB 5400:REM n Linear regresion 4548 B=.183/T:C=US:A=YI 4552 PRINT"A ="jA," B ="iB 4556 PRINT"C ="iC 4560 INPUT"Enter trial Q (0 to exit)"iQ 4564 IF Q=O THEN 4584 4568 INPUT"Enter time"iTI 4572 IF ZX=5 THEN N=2 4576 PRINT"Drawdown ="iAIQ+BIQILOG(TI)/NG+CIQAN 4580 GOTO 4560 4584 RETURN 4600 REM === Get a drawdown and discharge rate for each step === 4605 PRINT" Data must be in the full recovery between stages form for" 4610 PRINT"this operation.":PRINT 4615 PRINT" There is a maximum of ten steps due only to dimensioning of" 4620 PRINT"variables." 4625 PRINT" Data within each step must be in order of increasing times." 4630 INPUT"What time for Rorabaugh"iTI 4640 U5=1:I=1:PRINT:PRINT"Calculating" 4645 IF Q(I)=O THEN I=I+1:GOTO 4645 ELSE Q1=Q(I) 4650 IF TI( 1l>TI THEN PRINT"Given time is too small" :FC=1 : GOTO 4695
6.50
Analysis
4655 IF TI(I)<=TI AND TI(I+1»=TI THEN 4670 4660 IF I+1=DP THEN 4695 4665 IF Q(I+1)=Q1 THEN I=I+1:GOTO 4655 ELSE PRINT"Given time is too great or too small.":FC=1:GOTO 4695 4670 DE(U5)=DD(I)+(TI-TI(I»/(TI(I+1)-TI(I»*(DD(I+1)-DD(I» 4675 QE(U5)=Q(I) 4680 PRINT"Step No."jU5:PRINT"Drawdown ="jDE(U5),"Q ="jQE(U5):U5=U5+1 4685 I=I+1:IF I=DP THEN 4695 4690 IF Q(I)=Q1 THEN 4685 ELSE Q1=Q(I):GOTO 4655 4695 U5=U5-1:RETURN 4700 REM === Calculation of storage coefficient --4705 CLS:PRINT" Time of the reading for which you want the" 4710 INPUT"calculation (minutes)"jTI 4715 1=1 4720 IF TI(I)+1>TI AND TI(I)-1<TI THEN 4730 4725 I=I+1:IF DDP THEN PRINT"No such reading.":FC=1:GOTO 4770 ELSE 4720 4730 IF FV=O THEN FV=1:GOSUB 8500:GOSUB 8600 4735 DD=DD(I):Q=Q(I):TI=TI(I)/1440 4740 INPUT"Transmissivity for this calculation"jT 4745 INPUT"Discharge rate for this calculation"jQ 4750 GOSUB 3400 4755 PRINT"Value of u is "j:PRINT USING G1jUj:PRINT" and W(u) is "j:PRINT USING G1 jW 4760 PRINT"Storage coefficient is "j:PRINT USING G1jCS 4765 GOSUB 9400 4770 RETURN 4800 REM === Convert step data --4802 F=O 4804 PRINT:PRINT"Calculating" 4808 I=1:P1(1)=1:P2(1)=1:J=1:IF Q(1)=0 THEN J=2:P1(1)=2:P2(1)=2 4812 J=J+1:IF Q(J)=Q(P1(I» AND J<=DP THEN P2(I)=J:GOTO 4812 4816 IF J>DP THEN 4828 4820 IF P2(I)-P1(I)<2 THEN PRINT"Too few data in step"jI:FC=1:GOTO 4972 4824 I=I+1:P1(I)=J:P2(I)=J:GOTO 4812 4828 IF 1=1 THEN PRINT"Incompatible data, single step only.":FC=1:GOTO 4972 4832 PRINT"Step 1","First rec.","Last rec." 4836 IS=I:FOR 1=1 TO IS 4840 PRINT I,P1(I),P2(I):T1(I)=TI(P1(I»:T2(I)=TI(P2(I» 4844 NEXT I 4846 IF F=1 THEN RETURN:REM U To s/Q vs. Q 4848 REM -- Calculate trend of first stage 4852 P1=P1(1):P2=P2(1):II=1 4856 PRINT"Step "jII+1:IF P2-P1>6 THEN P1=P2-INT«P2-P1)*.3) 4860 GOSUB 4200:REM I Linear regresion of data of first step 4864 US(1)=US:YI(1)=YI:VS=US:AI=YI 4868 REM -- Transfer data --
Analysis
6.51
4812 FOR 11=2 TO IS 4816 REM -- Convert data of current step -4880 FOR J=P1(II) TO P2(II):REM # All of current step 4884 A=DD(J)-(VS*LOG(TI(J»+AI):REM # Additional drawdown due to increased rate 4888 A1=TI(J)-T2(II-1):REM # A1 is converted time 4892 A2=US(II-1)*LOG(A1)+YI(II-1):REM # Drawdown due to prevo rate at current time 4896 DD(J)=A+A2:REM # New drawdown 4900 TI(J)=A1:REM # New time 4904 REM PRINT"Time ";TI(J);TAB(30);"Drawdown ";DD(J) 4908 NEXT J 4912 IF II=IS THEN 4968 4916 REM -- Extend line of currents steps test data -4920 IC=1:P1=P1(II):P2=P2(II):IF P2-Pl>6 THEN Pl=P2-INT«P2-P1)*.1):REM H Use latter part of stage 4922 GOSUB 4200:REM H Lin. reg. corrected stage 4924 US(II)=US:YI(II)=YI 4928 FOR J=Pl(II) TO P2(II) 4932 TI(DP+IC)=T2(II)+TI(J):REM # Time for extension point 4936 A=US(II)*LOG(T1(II)+TI(J»+YI(II)-(US(II-l)*LOG(Tl(II)+TI(J» +YI(II-1»:REM n Displacement below previous extension 4940 DD(DP+IC)=VS*LOG(T2(II)+TI(J»+AI+A:REM n Dd. of point of extensions 4944 IC=IC+1 4948 REM PRINT"Ext. time =";TI(DP+IC-1),"Drawdown =";DD(DP+IC-1) 4952 NEXT J 4956 IC=IC-l:Pl=DP+l:P2=DP+IC 4960 GOSUB 4200:REM n Lin. reg. of data line extension 4964 VS=US:AI=YI:PRINT"Step ";II+l 4968 NEXT II 4912 RETURN 5000 REM === Rorabaugh analysis --5005 CLS:PRINT"Rorabaugh's analysis" 5010 GOSUB 4600:IF FC=l THEN 5295 5015 FOR 1=1 TO U5:QS(I)=DE(I)/QE(I):NEXT I 5020 REM -- 'Plotting' section -5025 ZS=1000 5030 CF=ZS 5035 FOR 1=1 TO U5 5040 X(I)=LOG(QE(I» 5045 IF QS(I)<=CF THEN Y(I)=O:GOTO 5150 5050 Y(I)=LOG(QS(I)-CF) 5055 NEXT I 5060 FOR 1=1 TO U5-1 5065 Z(I)=(Y(I+1)-Y(I»/(X(I+l)-X(I»:REM # Slope 5010 NEXT I
6.52 5075 5080 5085 5090 5095 5100 5105 5110 5115 5120 5125 5130 5135
Analysis
FOR 1=1 TO U5-2 Zl(I)=Z(I+1)-Z(I):REM I If Zl>O, curve is concave NEXT I IF U5=3 THEN Z3=Zl(1):GOTO 5120 Z2=0 FOR 1=1 TO U5-2 Z2=Z2+Z1(I):REM # Sum of 'curves' NEXT I Z3=Z2/(U5-2):REM # Av~rage 'curve' PRINT"CF ="jCF, REM -- Adjustment of CF -IF ABS(Z3)<.001 then 5155 IF CF=O AND Z3<0 THEN GOSUB 5370:GOTO 5165:REM # Formation constant is zero 5140 IF CF0 THEN CF=CF+ZS:GOTO 5035 5150 CF=CF-ZS:ZS=ZS/10:GOTO 5035 5155 Z4=0:FOR 1=1 TO U5-1:Z4=Z4+Z(I):NEXT I 5160 N=Z4/(U5-1)+1:REM # N=l+Slope 5165 REM -- Printout section -5170 PRINT:PRINT"N =","CW =","CURV =","CF =" 5175 CW=(DE(U5)-CF*QE(U5»/QE(U5)AN 5180 PRINT N,CW,Z3,CF:PRINT 5185 GOTO 5190 5190 PRINT" ","Form'n. loss","Well loss","Totals" 5195 FOR 1=1 TO U5 5200 A=CF*QE(I):B=CW*QE(I)AN:REM D A is for exponentiation 5205 PRINT"Step";I,A,B,A+B 5210 NEXT I 5215 PRINT"Do you want to enter transmissivity, discharge rate etc. for" 5220 PRINT"the calculation of the well equation?" 5225 Z$=SY:GOSUB 9800:IF ZX>2 THEN 5245 5230 INPUT"TransmissivitY"jT:INPUT"Discharge rate";Q 5235 INPUT"Time of drawdown measurement";TI:INPUT"Drawdown"jDD 5240 DS=.183*Q/(T*NG):YI=DD-DS*LOG(TI):GOTO 5280 5245 PRINT"Transmissivity will be calculated from the last 5 data." 5250 P1=DP-4:P2=DP:GOSUB 4200 5255 I=DP-4:A=Q(I) 5260 I=I+l:IF Q(I)<>A THEN PRINT"Change of rate in data. Please enter T.":GOTO 5230 5265 IF I
Analysis
6.53
5370 REM -- Formation constant zero -5375 PRINT"Formation constant zero." 5380 A=O 5385 FOR 1=1 TO U5-1:A=A+Z(I):NEXT I 5390 AV=A/(U5-1):N=AV+1:CF=0 5395 RETURN 5400 REM === Linear regresion, well eq. _ 5410 U6=0:U7=0:U8=0:U9=0 5420 FOR 1=1 TO U5 5430 U6=U6+QE(I).DE(I) 5440 U7=U7+QE(I) 5450 U8=U8+DE(I) 5460 U9=U9+QE(I).QE(I) 5470 NEXT I 5480 US=(U5.U6-U7.U8)/(U5.U9-U7.U7) 5490 YI=(U8.U9-U7.U6)/(U5.U9-U7.U7) 5500 IF FI<>1 THEN PRINT"Slope = ";US," Y intecept ";YI 5510 RETURN 7000 REM === Add to the current data === 7005 CLS:PRINT"Entry of times as nits or ate and time of day?" 7010 Z$="UuDd":GOSUB 9800:IF ZX>2 THEN 7095 7015 DP=DP+1 7020 CLS 7025 PRINT"Enter a negative time to end input" 7030 PRINT"Suffix the drawdown with q to alter rate" 7035 PRINT"Previous entry; NO.";DP-1;", TI =";TI(DP-1);", DD =" ;DD(DP-1);", Q =";Q(DP-1) 7040 INPUT"Time "; TI (DP) 7045 IF TI(DP)2 THEN 7050 7065 DD(DP)=VAL(S) 7070 IF DP<>1 THEN Q(DP)=Q(DP-1):GOTO 7080 7075 INPUT"Discharge rate ";Q(DP) 7080 DP=DP+1 7085 GOTO 7020 7090 RETURN 7095 REM --- Entry of time as date and time of day 7100 F=O:CLS:PRINT"Note that this feature does not allow for the number of days" 7105 PRINT"in the month (see the notes).":F1=0 7110 INPUT"Date, time, of start of test (eg. 25,1630)";TD,A 7115 TH=INT(A/100):TM=A-(TH.100) 7120 INPUT"Date, time, of reading";TE,A 7125 TG=INT(A/100):TN=A-(TG·100)
6.54 7130 7135 7140 7145 7150 7155 7160 7165 7170 7175 7180 7185 7190 7195 7200 7205 7210 7215 7220 7225 7250 7260 7270 7280 7290 7300 7310 7320 7330 7340 7350 7360 7370 7380 7390 7500 7510 7520 7530 7540 7560 7570
Analysis DP=DP+1 :INPUT"Drawdown" jDD(DP) :TI(DP)=FN T1 INPUT"Discharge rate"jQ(DP):F=O:GOTO 7145 INPUT"Date of reading"jTE:TI(DP)=FN T1:GOTO 7205 PRINT:PRINT"Last entriesj Time ="jTI(DP)j", Drawdown ="jDD(DP)j ", Q ="jQ(DP) DP=DP+1 PRINT" Enter time of readingj (Suffix with d to change day, eg." PRINT"1630d. I f you do not want to change the hour, then enter" INPUT"minutes only, ego 35. Suffix with f to finish data entrY"jS S2=RIGHT$(S,1):IF S2="F" OR S2="f" THEN 7225 IF S2="D" OR S2="d" THEN F=1 ELSE F=O IF VAL(S)=O THEN PRINT"You are entering zero, correct?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 7155 IF ASC(RIGHT$(S,1))>57 THEN S=LEFT$(S,LEN(S)-1):REM U Remove non numeral A=VAL(S):IF LEN(S»2 THEN TG=INT(A/100):TN=A-(TG*100) IF LEN(S)<3 THEN TN=A IF F=1 THEN 7140 ELSE TI(DP)=FN T1 INPUT"Drawdown (suffix with q to change rate)"jS1 S2=RIGHT$(S1,1):IF S2="Q" OR S2="q" THEN F=1:DD(DP)=FN V1(S1):GOTO 7135 ELSE Q(DP)=Q(DP-1) IF VAL(S1)=0 THEN PRINT"You are entering zeroj correct?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 7205 DD(DP)=VAL(S1):GOTO 7145 DP=DP-1:RETURN REM === Display file details --CLS:ZX=O INPUT"Enter the number of the first record of interest"jA IF A<1 OR A>DP THEN PRINT"Inval1d":GOTO 7270 PRINT SR FOR I=A TO DP PRINT IjTAB(17)jTI(I)jTAB(33)jDD(I)jTAB(48)jQ(I) IF INT(I/20)=I/20 THEN GOSUB 7370:PRINT SR IF ZX>2 THEN 7360 NEXT I GOSUB 7370 RETURN REM -- Continue or exit -PRINT"Press C to continue, E to eXit":Z$="CcEe":GOSUB 9800 RETURN REM === Printer output === PRINT:PRINT"Printing":F=O:LPRINT:LPRINT:LPRINT:LPRINT LPRINT TAB(27)j"Flle name, "jNM$ LPRINT TAB(7)j"Test type, "jST(TP)jTAB(32)j"Well type, "jSW(TW) LPRINT TAB(12)j"R ="jR 7550 LPRINT TAB(7)jSR:LC=4 FOR 1=1 TO DP LPRINT TAB(7)jIjTAB(23)jTI(I)jTAB(39)jDD(I)jTAB(55)jQ(I)
Analysis 7580 LC=LC+1 7590 IF LC<>55 OR I=DP THEN 7620 7600 FOR J=1 TO 11:LPRINT:NEXT J:LPRINT TAB(10)jNM$j" cont." 7610 LPRINT TAB(7)jSR:LC=2:GOTO 7640 7620 IF INT(I/5)=I/5 AND F=O THEN LPRINT TAB(7)jSD:F=1:GOTO 7580 7630 F=O 7640 NEXT I 7650 RETURN 7750 REM === Load data from data statements === 7760 PRINT"Loading data":TP=1:TW=1:R=.1:I=1 7770 READ TI(I),DD(I):IF T1(1)<>-1 THEN 1=I+1:GOTO 7770 7780 DP=I-1:Q(1)=0 7790 FOR 1=2 TO DP 7800 IF TI(I)<101 THEN Q(1)=173:GOTO 7860 7810 IF TI(I)<201 THEN Q(1)=242:GOTO 7860 7820 IF TI(I)<266 THEN Q(1)=300:GOTO 7860 7830 IF TI(I)<305 THEN Q(I)=343:GOTO 7860 7840 IF TI(I)<376 THEN Q(I)=386:GOTO 7860 7850 Q(I)=444 7860 NEXT I 7870 RETURN 7872 DATA 0,0,1,2.6,3,2.33,4,2.33,5,2.35 7874 DATA 6,2.37,7,2.37,8,2.38,9,2.4,10,2.42 7876 DATA 12,2.46,14,2.47,16,2.48,18,2.48,20,2.48 7878 DATA 22,2.5,24,2.5,26,2.51,28,2.51,30,2.52 7880 DATA 35,2.55,40,2.58,45,2.6,50,2.62,60,2.65 7882 DATA 70,2.68,80,2.7,90,2.72.100,2.75,105.3.95 7884 DATA 110,4.01,120,4.1,130,4.15,140,4.2,150,4.22 7886 DATA 160,4.23,170,4.24,180,4.28,190,4.3,200,4.31 7888 DATA 210,5.4,220,5.5,230,5.54,240,5.6,250,5.66 7890 DATA 265,5.65,270,6.6,280,6.7,290,6.62,304,6.65 7892 DATA 310,7.64,320,7.76,335,7.79,340,7.86,350,7.92 7894 DATA 362,7.97,375,8,380,9.48,390,9.64,402,9.72 7896 DATA 410,9.8,420,9.86,430,9.95,440,10,460,10.08 7898 DATA 470.10.13,490,10.2,510,10.28,525,10.36,545,10.4 7900 DATA 560,10.48,590,10.53,650,10.66,700,10.74,740,10.85 7902 DATA 800,10.92,850,11.04,900,11.13,940,11.25,1000,11.3 7904 DATA 1100,11.4,1200,11.54,1300,11.61,1500,11.82,1600,11.89 7906 DATA 1700,11.94,1800,12.01,1900,12.1 7990 DATA -1,-1,-1 8000 REM === Load Disk File === 8010 IF TP=O THEN 8080 8020 PRINT"Proceding will destroy any data in memory. Procede?" 8030 Z$=SY:GOSUB 9800:IF ZX>2 THEN 8120 8040 PRINT"Do you want to load "jNM$;"?" 8050 Z$=SY:GOSUB 9800 8060 IF ZX<3 THEN 8080
6.55
6.56
Analysis
8070 GOSUB 9600 80800PEN"I",1J1,NM$ 8090INPUTIJ1,TP,TW,R,DP 8100 FOR 1=1 TO DP:INPUTIJ1,TI(I),DD(I),Q(I):NEXT I 8110 CLOSE 8120 RETURN 8250 REM === Store Data to Disk === 8260 PRINT"Present file name is ": NM$j". is this OK?" 8270 Z$=SY:GOSUB 9800:IF ZX>2 THEN GOSUB 9600 82800PEN"0",1J1,NM$ 8290 PRINTIJ1,TP,TW,R,DP 8300 FOR 1=1 TO DP:PRINTIJ1,TI(I),DD(I),Q(I):NEXT I 8310 CLOSE 8320 RETURN 8500 REM === Define functions === 8510 DEF FN N1=-LOG(U)+CO+C1*U+C2*U2+C3*U3+C4*U2*U2+C5*U2*U3 8520 DEF FN N2=1/(U*EXP(U»*(C6+C7*U+U2)/(C8+C9*U+U2) 8530 DEF FN D1=(U*-EXP(-U)-EXP(-U»/U2 8540 DEF FN D2=«C8+C9*U+U2)*(C7+2*U)-(C6+C7*U+U2)*(C9+2*U»1 «C8+C9*U+U2)*(C8+C9*U+U2» 8550 DEF FN D3=1/(U*EXP(U»*FN D2+(C6+C7*U+U2)/(C8+C9*U+U2)*FN D1 8560 DEF FN D4=-1/U+C1+2*C2*U+3*C3*U2+4*C4*U3+5*C5*U2*U2 8570 RETURN 8600 REM === Assign values to variables === 8610 CO=-.577215661J:C1=.999991931J:C2=-.24991055#:C3=5.51996 8E- 02 8620 C4=-9.76004E-03:C5=1.07857E-03 8630 C6=.250621:C7=2.334733:C8=1.681534:C9=3.330657 8640 TL=.0001:G1="#IJ.##IJ·· A A " 8650 RETURN 9100 REM === Get first and last record numbers === 9110 NF=1:NL=0:PRINT"Defaults are first and last record numbers." 9120 INPUT"Number of first record to alter"jNF 9130 INPUT"Number of last record to alter"jNL 9140 IF NL=O THEN NL=DP 9150 RETURN 9400 REM === Delay for VDU message === 9410 PRINT"Press 'C' to continue"j 9420 Z$="Cc":GOSUB 9800:PRINT:RETURN 9500 REM === Load strings & constants --9530 ST(1)="Discharge":ST(2)="Recovery":ST(3)="Step discharge simulation":ST(4)="t/t1 recovery" 9540 SW( 1)="Pumped" :SW(2)="Observation" 9550 SD=STRING$(60,"-"):B=0 Drawdown Rate" 9560 SR="Record No. Time 9570 SY="YyNn":NG=LOG(10):PI=3.14159271 9575 DEF FN T1=TE*1440+TG*60+TN-(TD*1440+TH*60+TM) 9580 DEF FN V1(S)=VAL(LEFT$(S,LEN(S)-1»
Analysis 9590 9600 9610 9620 9630 9640 9650 9660 9610 9680 9690 9100 9110 9800 9810 9820 9830 9840 9850 9999
RETURN REM === File name === PRINT"What file name (without the extension)?" PRINT"NOTE : The name is a max. of 8 characters, must consist of only" INPUT"letters and numerals, and must start with a letter";NM$ IF LEN(NM$»8 THEN PRINT:PRINT"Too long":PRINT:GOTO 9610 A=ASC(LEFT$(NM$,1»:IF A<65 OR A>122 OR (A>90 AND A<91) THEN PRINT:PRINT"First character unacceptable":PRINT:GOTO 9610 IF LEN(NM$)=1 THEN 9110 FOR Al=2 TO LEN(NM$) A=ASC(MID$(NM$,Al,1» IF A<48 OR A>122 OR (A>51 AND A<65) OR (A>90 AND A<91) THEN PRINT:PRINT"No.";A1;1t character unacceptable.It:PRINT:GOTO 9610 NEXT Al NM$=NM$+".WTD":RETURN REM -- Await valid key ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$=It" THEN 9820 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END
6.51
Sternberg
7.1
Chapter 7
The previous chapter used two methods for evaluating the well equation. Neither of those methods would be suitable for analysing data from a discharge test in which there were very numerous changes in the pumping rate, especially where few water level readings were associated with each rate. The modified Sternberg analysis (Eden & Hazel, 1973) described in this chapter is very flexible in this regard, being able to analyze data from tests with numerous changes in rates, including periods of zero discharge. There are two slightly different versions of the Sternberg analysis included in the program STRNBRG, of these the preferred one requires data from a period of recovery as well as that from the drawdown period. If, then, you intend to analyze your discharge test using STRNBRG, you should try to record recovery for a reasonably long period. The trend of the recovery data will be measured using linear regression, and the longer the time span covered by the recovery, the more accurate this operation will be. 1. THE MODIFIED STERNBERG ANALYSIS, PROGRAM STRNBRG 1.1. Data requirements The method calls for time-drawdown-discharge rate readings from a stepped rate discharge test consisting of at least two rates. All times must be measured from a common point, the beginning of the first discharge step is best. The first time must be zero, and will give the initial conditions. This reading will most often be time = 0, drawdown = 0, discharge rate = O. (The alternative word 'record' may be used instead of 'reading' in these notes.) The data is in the form of sets of three values, with the first value of the set being time, the second drawdown, and the third discharge rate. It should be noted that the program assumes that changes in rate occur immediately after the last reading at the old rate, and not immediately before the first reading at the new rate. For example, one set is; TI=10(min.), DD=l(m), and Q=100(cubic metres per day), (where TI is time, DD is drawdown, and Q is discharge rate) and the following set is; TI=12, DD=l .6, and Q=200. The program assumes that the discharge rate changed to 200 cubic metres per day immediately after the earlier reading, ie. at about Ti=10.000001 minutes, not at 11.999999 minutes. (This also applies to other programs in this book using time-drawdown-discharge rate datum sets.) (I believe that the discharge rate recorded in each datum set should be the average discharge rate for the time between the instant of the current record and the instant of the previous record.) Actual program input is by either one of two methods. 1/ The data may be written into the program as DATA statements between program lines 7770 and 7985; both of these lines must themselves be left unchanged. If this method is used then the data must be entered in the
7.2
Sternberg
order; time # 1, drawdown # 1, discharge rate # 1, time # 2, drawdown # 2, etc., similarly to the example data included in the program listing. The present program has three sets of data on each line, this is quite arbitrary. Eazel gave some example data from a test on the Richmond, Qld. Town Bore (w1li ch Ls a flowing ar-t esLan well) ~Ii th notes that he vr-ot,e for a groundwater school in South Australia. These are written into the program as it is listed so that they may be used to test the correct operation of the program. 2/ Probably the more convenient method is to use data from a disk file produced by the program DTDHA. (Program DTDHA is de~eribed in chapter 6, and allows convenient entry and editing of discharge test data.) This method will give more flexibility, and allow easier checking, correction of errors, conversion of units and reference points, etc. If the unmodified program is used to analyze data collected by an automated flow rate recorder, then it is most likely that it will fail. This will be due to minor fluctuations in the flow rate. If, for example, consecutive discharge rates of 10.01, 9.998, 9.996, litres per second have been recorded, they will not be considered to be one discharge rate. This may be corrected by some alteration such as changing line 6540 from; "6540 J=J+1:IF Q(J)=Q(P1(I»
AND J<=DP THEN P2(I)=J:GOTO 6540", to
"6540 J=J+1 :IF Q(J)
AND
Q(J»Q(P1 (I))*.97
AND
J<=DP
THEN
This would allow the data to be defined as one step so long as it was within a 3% tolerance of the initial pumping rate for that step. I have not tested this alteration, so I cannot be sure that it will work correctly. 1.2. The method ~sed by program STRNBRG The procedure can best be described in a series of steps. 1/ Calculation of the vector H(x). are calculated from the equation;
H= i
The values in the vector H(x)
Log (t -t ) 10 1 j-1
This in turn involves several separate steps. (1) Delta Q(I) is calculated for each time after the first, and stored in vector DQ(x). (2) Then H(I) is the sum of all the terms; DQ(J)*LOG(Time(I)-Time(J-1». Of course, terms in which DQ(J)=O have zero value. They are not calculated.
Sternberg
1.3
The example data built into the program are those recorded by Hazel during a flow test of the Richmond town water supply well, in Queensland, Australia. Table 1.1 show the data recorded (discharge rates, times for each reading, and drawdowns), as well as the calculated vectors delta Q and H(x). Drawdowns are negative because they are back-pressures in an artesian flow. Vector H(x) is also shown plotted against drawdown on natural scale in figure 1.1, the significance of this will be explained later. Table 1.1 is the printed output of the program. 2/ The menu gives the option of; (1) Saving the data to a disk file. This file may then be used for graphing, if an appropriate graphing program is available. (There is not one included in this book.) It could also be edited by DTDHA, if required. (Such a file could not then be loaded back into STRNBRG as the vectors would be out of order.) (2) Listing of the data in it's present state to the printer. For such things as checking, manual analysis, etc. (3) Display of the data on the screen; again, this would probably be for checking. (4) The fourth option is the most important; this will cause the remainder of the analysis to be performed. 3/ Marking the beginnings and endings of each discharge step. Lines 6530 to 6510 record the first and last record numbers of each step in the vectors P1(x) and P2(x) respectively. For this purpose, a step has been defined as consisting of a minimum of three consecutive records each having identical discharge rate. As mentioned above, this will need to be modified if discharge rate data have been collected by a logging unit. 4/ The discharge rates for all the steps defined above are recorded in the vector QS(x) in lines 6590 to 6640. Line 6630 records the last step having a discharge rate of zero in the variable P1 (x). As the data in this recovery step are of great importance in a subsequent part of the analysis, tests should be arranged to finish with a lone;ish recovery period; or as in the example data, to include a reasonably long period of recovery. 5/ The section of the program from line 6610 to 6130 calculates the slopes and y intercepts for all of the steps. Assuming a confined, homogeneous, isotropic, unbounded aquifer, all the slopes should be identical, in the real wodd they are unlikely to be, so the average slope is used to calculate the coefficient B of the well equation in line 6140. This section also calculates the y intercept divided by the discharge rate for each (non zero discharge) step, for possible later use. This is stored in the vector YQ(x) in line 6120. 6/ Line 6150 decides which method is to be used to calculate the coefficients A and C, based on the presence or absence of recovery step data.
7.4
Sternberg Table 7.1 File name, Sternberg output data Delta Q Drawdown 0.00 -26.570 -2.280 2697.00 -2.240 -45.00 -2.200 -23.00 -2.060 -38.00
No. 1 2 3 4 5
0.00 2697.00 2652.00 2629.00 2591.00
Time 0.0 1.0 2.0 3.0 5.0
6 7 8 9 10
2576.00 2573 .00 2523.00 2516.00 2500.00
7.0 10.0 12.0 15.0 20.0
-2.160 -2.160 -2.160 -2.070 -2.070
-15.00 -3.00 -50.00 -7.00 -16.00
2200.7 2589.3 2774.6 2997.7 3287.2
11 12 13 14 15
2493.00 2463.00 2447.00 2440.00 2432.00
25.0 47.0 60.0 75.0 90.0
-2.030 -2.030 -2.030 -1.990 -1.950
-7.00 -30.00 -16.00 -7.00 -8.00
3515.0 4141.6 4378.9 4600.1 4778.2
16 17 18 19 20
2417 .00 2402.00 2402.00 2387.00 2380.00
120.0 152.0 180.0 210.0 240.0
-1.950 -1.950 -1.910 -1.910 -1.910
-15.00 -15.00 0.00 -15.00 -7.00
5051.2 5269.3 5439.1 5573.6 5695.3
21 22 23 24 25
0.00 0.00 0.00 0.00 0.00
242.0 243.0 246.0 250.0 255.0
-23.000 -23.340 -24.040 -24.460 -24.790
-2380.00 0.00 0.00 0.00 0.00
4986.9 4571.9 3867.4 3355.3 2955.7
26 27 28 29 30
0.00 0.00 0.00 0.00 0.00
260.0 270.0 285.0 300.0 330.0
-24.950 -25.240 -25.570 -25.740 -25.910
0.00 0.00 0.00 0.00 0.00
2677.5 2295.9 1930.7 1684.7 1361.5
31 32 33 34 35
0.00 0.00 0.00 0.00 0.00
352.0 385.0 473.0 543.0 1170.0
-26.030 -26.110 -26.240 -26.320 -26.570
0.00 0.00 0.00 0.00 0.00
1200.6 1024.5 743.7 613.0 241.6
36 37 38 39 40
0.00 788.00 788.00 788.00 788.00
1320.0 1322.0 1323.0 1324.0 1325.0
-26.690 -21.930 -21.840 -21.800 -21.760
0.00 788.00 0.00 0.00 0.00
211. 2 448.1 586.7 685.0 761.1
41 42 43
788.00 788.00 788.00
1327.0 1330.0 1332.0
-21.680 -21.600 -21.550
0.00 0.00 0.00
875.9 997.5 1059.5
Q
H
0.0 0.0 811.9 1273.2 1835.6
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
Sternberg Table 7.1 continued. No. 44 45
Q
788.00 788.00
Time 1335.0 1340.0
Drawdown -21.470 -21.430
1341.0 1342.0 1343.0 1344.0 1345.0
-18.690 -18.610 -18.570 -18.530 -18.490
349.00 0.00 0.00 0.00 0.00
1249.5 1370.3 1446.8 1504.8 1552.4
Delta Q H 0.00 1135.4 0.00 1233·0
------------------------_._---------------------------------46 47 48 49 50
1137.00 1137.00 1137.00 1137.00 1137.00
-----------------------------------------------------------51 52 53 54 55
1137.00 1137.00 1137.00 1137.00 1137.00
1347.0 1350.0 1352.0 1355.0 1360.0
-18.400 -18.320 -18.320 -18.280 -18.240
0.00 0.00 0.00 0.00 0.00
1629.4 1719.0 1768.4 1832.4 1920.9
56 57 58 59 60
1515.00 1515.00 1515.00 1515.00 1515.00
1361.0 1362.0 1363.0 1364.0 1365.0
-14.800 -14.710 -14.550 -14.550 -14.470
378.00 0.00 0.00 0.00 0.00
1936.6 2065.5 2146.7 2208.0 2258.4
1515.00 1515.00 1515.00 1515.00 1515.00
1367.0 1370.0 1372.0 1375.0 1380.0
-14.380 -14.300 -14.300 -14.220 -14.130
0.00 0.00 0.00 0.00 0.00
2339.8 2435.1 2487.9 2556.8 2653.2
------------------------------------------------------------
-----------------------------------------------------------61 62 63 64 65
-----------------------------------------------------------66 67 68 69 70
1894.00 1894.00 1894.00 1894.00 1894.00
1381.0 1382.0 1383.0 1384.0 1385.0
-10.240 -10.070 -10.030 -9.990 -9.950
379.00 0.00 0.00 0.00 0.00
71 72 73 74 75
1894.00 1894.00 1894.00 1894.00 1894.00
1387.0 1390.0 1392.0 1395.0 1400.0
-9.950 -9.820 -9.780 -9.740 -9.660
0.00 0.00 0.00 0.00 0.00
2670.5 2801.3 2884.2 2947.2 2999.2
-----------------------------------------------------------3083.9 3183.8 3239.6 3313.1 3416.9
-----------------------------------------------------------76 77 78 79 80
2273.00 2273.00 2273.00 2273 .00 2273.00
1401.0 1402.0 1403.0 1404.0 1405.0
-5.470 -5.310 -5.220 -5.180 -5.060
379.00 0.00 0.00 0.00 0.00
3435.5 3567.7 3652.1 3716.5 3769.9
-----------------------------------------------------------81 82 83 84 85
2273.00 2273.00 2273.00 2273.00 2273.00
1407.0 1410.0 1412.0 1415.0 1420.0
-5.020 -5.020 -4.970 -4.850 -4.770
0.00 0.00 0.00 0.00 0.00
3857.4 3961.3 4019.9 4097.3 4207.5
------------------------------------------------------------
7.5
7.6
Sternberg
Figure 7-1 -
-_..
__
..
._-
--_._-_ ..
~-
l
8 o
to 0 0 0 0
8o
0
p
LD
0 0
/'>
0 0
b I
0 0
M C'-N N II
0 0 II
-r
to
~
<:II
(J)
0 LO
~
II
0
0
Q!
<:II
II
LO
Vi,
C'--
M
II
co ~
0
II
r-,
0
~
N Q
<:II
U)
r
0 ~
Q
Vi
C Q0 (/) (/)
(>10 U
~0
3
0
[L0
§ N
0
Q
<:II
Vi
Q
<:II
0
Vi
o o
$2 0
t> a
M
The y ax i s ) .
o
N
8
contents of vector H(x) (on the x axis) plotted against time (on the
Sternberg
7.7
7/ If no recovery data is present, then the slope and y intercept of QS(x) vs. YQ(x) [with YQ(x) on the y axis] is calculated by linear' regression. Well equation coeffiCient A is equal to the y intercept produced by this operation, and coefficient C is equal to the slope. As this method relies on projecting the step trends back to the y axis, any slight errors in the st'-'l' (1" t.a Hill be magnified. I see this as the main limitation of this version of the Sternberg analysis. 8/ If the data does contain a recovery step, then a rather more involved, but probably a.lso more accurate, method may be used to evaluate A and C. Referring again to figure 7.1, Hazel states that the distances between the Q=O line and each of the other lines corresponds to the drawdown at one minute for each respective discharge rate. ego The distance on the y scaJ~ between the zero line and the Q=788 line is approximately 4.5 metres, therefore this is the drawdown that could be expected if you were to pump this particular well at a rate of 788 (litres per minute in this case) for one minute. From the data, this one minute drawdown is calculated for each step of non zero discharge rate. This is accomplished by calculating the distance between the linear regression line for the Q=O data and that of the current step at a point about half way along the data of each step. These functions are carried out in lines 6910 to 6990 of the program. (This part of the program contains some print statements which could be used to see the program operation in more detail. Simply edit out the REM before each print statement.) 9/ The last step in the solution involves; (1) Taking each step from the first to the second to last in turn. In the program (line 7020) and in these notes, the current step will be called I. (2) For each step I, taking each of the other steps in turn. (Each of these will be called J program line 7030.) (3) Subtract the pressure (or drawdown) of step J from that of step I. Call this D2(I,J) (line 7040). (4) Subtract the discharge rate of step I from that of step J. Call this Q1(I,J) (line 7040). (5) Sum the discharge rate for each of these steps. Call this Q2(I,J) (line 7050). (6) Calculate the slope and y intercept of all Q2(I,J) vs. all (D2(I,J)/Q1(I,J)) (program lines 7060 to 7140). The variable A is given the total number of the datum pairs by the equation in line 7120. A graphical representation of this operation is shown in figure 7.2. (7) Coefficient A is equal to this y intercept, and coefficient C is equal to this slope. (Program line 7150).
7.8
Sternberg
Figure
7' 2 0 0 0 l£)
N
D
z
w w
<..9 .-J
0. c::;
M
~
en
0. 0. 0. 0. c::; c::; c::; c::;
lil lil lil lil lil c::; (/)
CY
tf)
CY tf)
CY tf)
CY
tf)
ro ro ro ro ro
III III III III III 0
x
0
+
..
0 0 0
~
+
§ M
-,
-"
N
o
§ N
Evaluation of the well equation intercept), and C (equal to the slope).
coefficients
A (equal
to
the
y
Sternberg
7.9
10/ Execution now passes to the section of code from line 6790 to line 6830 which allows the user to enter trial values for discharge and duration of pumping, and then calculates the drawdown to be expected from each pair of valu~~ ~~nording to the well equation. 11/ Entry of execution to the menu.
a
zero
value
for
the
d Lachar-ge
rate will return
12/ The final option of the menu is to press E to end the program. Comment As can be seen from Hazels example data, this method may be used to evaluate the well equati.on from data that would be very difficult to handle by a manual method. It should be c;vi 1 P ,ossible to successfully analyze the results of discharge tests during which the pump unexpectedly stopped, or the pumping rate, for one reason or another, was at some stage highly variable.
1.3.
Usage of variable~ in program STRNBRG A general purpose single precision variable. It is also used as the first coefficient in the well equation. A1 As above. AN The number of datum pairs involved in the linear regression subroutine starting at line 4200. B The second coefficient in the well equation. C The third coefficient in the well equation. DO The drawdown for Q=O for the step under consideration. D1(x) The calculated one minute drawdown for step number x. D2(x,y) Hazels P1(base)-P(n) for base=x, n=y. Also see text under 9/, (3) above. DD(x) Drawdown reading number x. (Alternatively, the drawdown component of record number x.) DP The number of records. ie. The change in discharge rate from record DQ(x) Delta Q number x. x-1 to record x , A flag used to ensure that the paper listing of the data is F paginated correctly no matter how the lines of dashes every five lines may fall due. A flag which, when set, will stop the screen from being cleared on FC return to the menu. The main numerical format. G1 G2 A numerical format. H(x) The vector of H(x) values as calculated using equation 7.1. I The primary integer counter. An integer counter used when I is to be used for subsidiary tasks. II The secondary integer counter. J LC The counter for lines of printed output. A
7.10
Sternberg
NG
The natural logarithm of ten. Used to convert natural logs to logs at the base ten. The current file name. NM$ The number of discharge steps of sufficient duration to include at NS least three records. Points at (contains) the step number of the recovery step. PO P1(x) The first record number for linear regression in step number x. P2(x) The last record number for linear regression in step number x. Q The discharge rate for calculation of drawdown from the well equation. Q(x) The discharge rate of record number x. Hazels Q(n)-Q(base) for n=y and base=x, also see 9/, (4) above. Q1 (x,y) Q2(x,y) Hazels Q(n)+Q(base) for n=y and base=x, also see 9/, (5) above. QS(x) The discharge rate for step number x. The distance from the discharging well to the piezometer R (observation well). (In the case of data relating to drawdowns in the discharging well, this holds the effective radius of the well.) SD A string of dashes used in printing the paper listing. SR The heading used for the paper listing. ST(x) A string vector listing test types. SW(x) A string vector listing well types. SY Contains "YyNn" for handling yes/no answers, not used. The time for calculation of the drawdown using the well equation. TI TI(x) The time of the collection of the data of record number x. TP The code number for the test type of the data. ie. The type of test as defined when the disk file containing the data used in this program was created by program DTDHA. TW The code number of the well type, similar to the above. Accumulates the sum of the slopes of the data from each step, in U5 the form used to produce figure 7.1. This sum is then used to calculate the average slope. U6 to U9 are used to sum intermediate terms in the linear regression subroutines. US The slope as calculated in the linear regression subroutines. US(x) The slope of the data from step number x. YI The y intercept as calculated in the linear regression subroutines. YI(x) The y intercept of the data from step number x. YQ(X) YI(x)/QS(x) Z$, ZX, and ZZ$ are used in the one key program control subroutine. 2. Eden,
REFERENCE. R.N., and Hazel, C.P., 1973. Computer and Graphical Analysis of Variable Discharge Pumping Tests of Wells. Civil Eng. Trans., Vol. 15( 1+2) , Inst. Eng. Australia. pp 5-10.
Sternberg
7.11
3. PROGRAM LISTING. 3.1. Solution of the Well Equation. program STRNBRG REM ••••• STRNBRG/BAS ••••• 2 REM # Last modified 27th. Apr. 1986 10 CLEAR 200:REM # Not required for most computers 20 DEFINT F,I-L:DEFSTR G,S 30 DIM DD(200),TI(200),Q(200),DQ(200),H(200),P1(20),P2(20) 70 CLS: PRINT" Modified Sternberg Analysis" 80 PRINT 200 REM === Control section === 210 PRINT"Input from disk ile or ata statements?":Z$="FfDd" 220 GOSUB 9800:IF ZX>2 THEN GOSUB 7750:GOSUB 9500:GOTO 260 230 GOSUB 9600:REM # Get file name 240 GOSUB 9500:REM # Load strings & constants 250 GOSUB 8000:REM # Load data from disk file 255 IF TI (1) <>0 THEN PRINT"Data invalid. Initial conditions not present.": GOTO 9999 260 PRINT"Calculating vectors DQ (delta Q) and H" 270 FOR 1=2 TO DP 280 DQ(I)=Q(I)-Q(I-1) 290 FOR J=2 TO I 300 IF DQ(J)=O THEN 320 310 H( I) =H( I )+DQ(J).LOG(TI(I )-TI(J-1» /NG 320 NEXT J 330 PRINT USING G2jH(I), 340 NEXT I 400 CLS 410 PRINT TAB(10);"Menu" 420 PRINT"Which option?" 430 PRINT"Save data to disc 1" 440 PRINT"List data on printer 2" 450 PRINT"Display data on screen 3" 460 PRINT"Solve the well equation 4" 470 PRINT"End En 480 Z$="1234Ee":GOSUB 9800:IF ZX>4 THEN 9999 490 ON ZX GOSUB 8250,7500,7250,6500 500 IF FC=1 THEN FC=O:GOTO 410 510 GOTO 400 4200 REM === Linear regression, drawdown data --4210 U6=0:U7=0:U8=0:U9=0 4220 FOR I=P1(II) TO P2(II) 4230 U6=U6+H(I)·DD(I) 4240 U7=U7+H(I) 4250 U8=U8+DD(I) 4260 U9=U9+H(I).H(I) 4270 NEXT I
7 . 12 Sternberg 4280 4290 4300 4320 4400 4410 4420 4430 4440 4450 4460 4470 4480 4490 4500 4510 6500 6510 6520 6530 6540 6550 6560 6570 6580 6590 6600 6620 6630 6633 6636 6640 NEXT 6650 6660 6670 6680 6690 6700 6710 6720 6730 6740 6750 6760 6770 6780
AN=1+P2(II)-P1(II) US=(AN*U6-U7*U8)/(AN*U9-U7*U7) YI=(U8*U9-U7*U6)/(AN*U9-U7*U7) RETURN REM === Linear regression, well equation --U6=0:U7=0:U8=0:U9=0 FOR I=1 TO NS U6=U6+QS(I)*YQ(I) U7=U7+QS(I) u8=U8+YQ(I) U9=U9+QS(I)*QS(I) NEXT I US=(NS*U6-U7*U8)/(NS*U9-U7*U7) YI=(U8*U9-U7*U6)/(NS*U9-U7*U7) PRINT"Slope = "iUS," Y intercept = ";YI RETURN REM === Solve the well equation === PRINT:PRINT"Calculating" REM -- Set pointers at the start and end of each step -I=1:P1(1)=1:P2(1)=1:J=1 J=J+1:IF Q(J)=Q(P1(I» AND J<=DP THEN P2(I)=J:GOTO 6540 IF J>DP THEN 6590 IF P2(I)-P1(I)<2 THEN P1(I)=J:P2(I)=J:GOTO 6540 I=I+1:P1(I)=J:P2(I)=J:GOTO 6540 REM -- Record discharge rate for each step PRINT"Step '","First rec.","Last rec.","Q" FOR J=1 TO I 6610 QS(J)=Q(P1(J» PRINT J,P1(J),P2(J),QS(J) NEXT J PO=0:A=0:A1=0 FOR J=1 TO I IF QS(J)=O THEN A1=A1+1:IF P2(J)-P1(J»A THEN PO=J:A=P2(J)-P1(J) 6645 J:REM • PO marks the largest recovery step NS=I:U5=0 REM -- Calculate slope, Y intercept of each step -PRINT"Step '","y int.","Slope" FOR II=1 TO NS GOSUB 4200:REM • Linear regression YI(II)=YI:US(II)=US PRINT II,YI,US U5=U5+US:IF QS(II)<>O THEN YQ(II)=YI(II)/QS(II) NEXT II B=US/NS:PRINT"Average slope, B =";B IF PO<>O THEN 6900 PRINT"No recovery step present, using inferior method." GOSUB 4400:REM • 2nd. linear regression A=YI:C=US:PRINT"A =";A,"C =";C
Sternberg 6790 6800 6810 6820 6830 6840 6900 6910 6920 6930 6940 6950 6960 6970 6980 6990 7000 7010 7020 7030 7035 7040 7050 7060 7070 7080 7090 7100 7110 7120 7130 7140 7150 7160 7250 7260 7270 7280 7290 7300 7330 7340 7350 7360 7370 7500 7510
INPUT"Enter trial 0 (0 to exit)";O IF 0=0 THEN 6840 INPUT"Enter time";TI PRINT"Calculated drawdown ="jA*O+B*O*LOG(TI)/NG+C*O*O GOTO 6790 FC=1:RETURN REM -- Final part of anal. of data including recovery -FOR I=1 TO NS IF OS(I)=O THEN D1(I)=0:GOTO 6990 A=INT«P1(I)+P2(I»/2):REM # Point to mid. datum of step REM PRINT"Mid. datum of step"jIj" is fl"jA DO=YI(PO)+US(PO)*II(A):REM # Calc. dd. at 0=0 & H=H(A) REM PRINT"Drawdown for 0=0 there is" JDO D1(I)=DO-DD(A):REM # Drawdown at 1 min. REM PRINT"Drawdown at 1 min. for step"jI;" is''jD1(I) NEXT I REM -- Calculate P(base)-P(n), O(n)-O(base), O(n)+O(base) U6=0:U7=0:U8=0:U9=0 FOR I=1 TO NS-1 FOR J=I+1 TO NS IF (OS(J)=O AND PO<>J) OR (OS(I)=O AND PO<>I) THEN 7100 D2(I,J)=D1(I)-D1(J):01(I,J)=OS(J)-OS(I) 02(I,J)=OS(J)+OS(I) U6=U6+(D2(I,J)/01(I,J»*02(I,J) U7=U7+02(I,J) U8=U8+D2(I,J)/Q1(I,J) U9=U9+02(I,J)*02(I,J) NEXT J NEXT I A=(NS-A1)*(NS-A1)/2+(NS-A1)/2 US=(A*U6-U7*U8)/(A*U9-U7*U7) YI=(Ua*U9-U7*U6)/(A*U9-U7*U7) A=YI:C=US:PRINT"C =";C,"A =";A GOTO 6790 REM === VDU output of file details --CLS PRINT"R =";R PRINT SR FOR I=1 TO DP PRINT USING G1;I,O(I),TI(I),DD(I),DO(I),H(I) IF INT(I/20)=I/20 THEN GOSUB 9400:PRINT SR NEXT I PRINT"Press any key to continue." ZZ$=INKEY$:IF ZZ$="" THEN 7360 RETURN REM === Printer output === PRINT"The printer should be switched on and at top of form."
7. 13
7. 14 Sternberg 7520 7530 7540 7550 7560 7570 7600 7610 7620 7630 7640 7650 7660 7670 7750 7755 7760 7765 7770 7775 7780 7785 7790 7795 7800 7805 7810 7815 7820 7825 7830 7835 7840 7845 7850 7855 7860 7865 7870 7875 7880 7885 7890 7895 7900 7905 7910
LPRINT TAB(27)j"File name, "iNM$ LPRINT TAB(10)i"Sternberg output data" LPRINT LPRINT TAB(7)iSR:LC=4 FOR 1=1 TO DP LPRINT TAB(7)jUSING G1jI,Q(I),TI(I),DD(I),DQ(I),H(I) LC=LC+1 IF LC<>55 THEN 7640 FOR J=1 TO 12:LPRINT:NEXT J LPRINT TAB(7)jSR:LC=2:GOTO 7660 IF INT(I/5)=I/5 AND F=O THEN LPRINT TAB(7)iSD:F=1:GOTO 7600 F=O NEXT I RETURN REM === Input from data statements --PRINT"Loading data":I=1 READ TI(I),DD(I),Q(I) IF TI(I)<>-1 THEN I=I+1:GOTO 7760 DP=I-1 DATA 0,-26.57,0,1,-2.28,2697,2,-2.24,2652 DATA 3,-2.2,2629,5,-2.06,2591,7,-2.16,2576 DATA 10,-2.16,2573,12,-2.16,2523,15,-2.07,2516 DATA 20,-2.07,2500,25,-2.03,2493,47,-2.03,2463 DATA 60,-2.03,2447,75,-1.99,2440,90,-1.95,2432 DATA 120,-1.95,2417,152,-1.95,2402,180,-1.91,2402 DATA 210,-1.91,2387,240,-1.91,2380,242,-23,0 DATA 243,-23.34,0,246,-24.04,0,250,-24.46,0 DATA 255,-24.79,0,260,-24.95,0,270,-25.24,0 DATA 285,-25.57,0,300,-25.74,0,330,-25.91,0 DATA 352,-26.03,0,385,-26.11,0,473,-26.24,0 DATA 543,-26.32,0,1170,-26.57,0,1320,-26.69,0 DATA 1322,-21.93,788,1323,-21.84,788,1324,-21.8,788 DATA 1325,-21.76,788,1327,-21.68,788,1330,-21.6,788 DATA 1332,-21.55,788,1335,-21.47,788,1340,-21.43,788 DATA 1341,-18.69,1137,1342,-18.61,1137,1343,-18.57,1137 DATA 1344,-18.53,1137,1345,-18.49,1137,1347,-18.4,1137 DATA 1350,-18.32,1137,1352,-18.32,1137,1355,-18.28,1137 DATA 1360,-18.24,1137,1361,-14.8,1515,1362,-14.71,1515 DATA 1363,-14.55,1515,1364,-14.55,1515,1365,-14.47,1515 DATA 1367,-14.38,1515,1370,-14.3,1515,1372,-14.3,1515 DATA 1375,-14.22,1515,1380,-14.13,1515,1381,-10.24,1894 DATA 1382,-10.07,1894,1383,-10.03,1894,1384,-9.99,1894 DATA 1385,-9.95,1894,1387,-9.95,1894,1390,-9.82,1894 DATA 1392,-9.78,1894,1395,-9.74,1894,1400,-9.66,1894 DATA 1401,-5.47,2273,1402,-5.31,2273,1403,-5.22,2273 DATA 1404,-5.18,2273,1405,-5.06,2273,1407,-5.02,2273 DATA 1410,-5.02,2273,1412,-4.97,2273,1~15,-4.85,2273
Sternberg 7915 DATA 1420,-4.77,2273 7985 DATA -1,-1,-1 7990 RETURN 8000 REM === Load Disk File _ 80100PEN"I",'1,NM$ 8020 INPUT'l,TP,TW,R,DP 8030 FOR 1=1 TO DP:INPUT'1,TI(I),DD(I),Q(I):NEXT I 8040 CLOSE:PRINT"Test type; ";ST(TP)," Well type; "jSW(TW) 8050 RETURN 8250 REM === Store Data to Disk _ 8255 GOSUB 9600:REM , File name 82600PEN"0",'1,NM$ 8270 PRINT'1,l,l,R 8290 PRINT'l ,DP 8300 FOR 1=1 TO DP:PRINT'1,H(I),DD(I),DQ(I):NEXT I 8310 CLOSE 8320 RETURN 9400 REM == Delay for printout == 9410 PRINT"Press 'c' to continue"; 9420 Z$="Cc":GOSUB 9800:PRINT:RETURN 9500 REM === Load strings & constants _ 9510 ST(1)="Discharge":ST(2)="Recovery":ST(3)="Step discharge 9520 SW(1)="Pumped":SW(2)="Observation" 9550 SD=STRING$(60,"-") No. Q Time Drawdown Delta Q H" 9560 SR=" 9570 9580 9590 9600 9610 9620 9630 9640 9650 9660 9670 9680 9690 9700 9710
7.15
simulation"
Gl=""'" "",.,' ""',., "',.," " " , . , ' ""',.," SY="YyNn":G2=" i1#####'":NG=LOG(10) RETURN REM === File name === PRINT"What file name (without the extension)?" PRINT"NOTE : The name is a max. of 8 characters, must consist of only" INPUT"letters and numerals, and must start with a letter";NM$ IF LEN(NM$»8 THEN PRINT:PRINT"Too long":PRINT:GOTO 9610 A=ASC(LEFT$(NM$,l»:IF A<65 OR A>122 OR (A>90 AND A<97) THEN PRINT: PRINT"First character unacceptable":PRINT:GOTO 9610 IF LEN(NM$)=l THEN 9710 FOR Al=2 TO LEN(NM$) A=ASC(MID$(NM$,Al,l)) IF A<48 OR A>122 OR (A>57 AND A<65) OR (A>90 AND A<97) THEN PRINT: PRINT"No."jAl;" character unacceptable.":PRINT:GOTO 9610 NEXT Al NM$=NM$+".WTD":RETURN
1.16
9800 9810 9820 9830 9840 9850 9999
Sternberg
REM -- Await valid key -ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$="" THEN 9820 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END
Matrix model
8.1
Chapter 8
This chapter deals with a simple groundwater head model that can approximate head changes in an infinite confined aquifer. The changes in head are assumed to be due to discharges or recharges from a number of wells who's locations have been given by the user. Also the duration of operation of all the wells must be specified. In this model, although initial heads may be specified, flows due to head differences in the aquifer are not considered; changes in head are calculated only on a summation of drawdowns The model should be useful in due to the discharging/recharging wells. getting a first approximation of the changes in an existing piezometric surface, due to a superimposed pattern of drawdown cones. 1. GROUNDWATER MATRIX MODELS There are two major classes of models dealing with a matrix of piezometric heads, depending on the method used to obtain a solution. 1/ Analytical, where an exact solution is at least theoretically obtainable, given that the aquifer fits the conceptual model exactly. (In practice it never does.) 2/ Numerical, where in effect, numbers are allowed to flow through the model similarly (it is hoped) to the way water flows through the real aquifer, or system of aquifers. Here the aquifer is divided up into smaller units (called elements) which are assumed to have constant hydraulic properties within themselves. An equation approximates the flow between each element and it's neighbours over the given time span, and for the given initial conditions. The equation constants vary from one element junction to the next depending on the values given to transmissivity, and storage coefficient for the elements on either side of the junction. The equations used for flow to and from elements along the boundary of the model are slightly different to those relating to the interior of the model. All of the equations must be solved simultaneously. This book will not give any examples of numerical models. If the reader wishes to pursue the subject he might try Kinzelbach's Groundwater Modelling, (1986) which includes programs in Basic. As mentioned in the introduction, in all real groundwater problems where numbers are given to aquifer properties, we are dealing only with approximations to reality. This becomes especially apparent in groundwater matrix models. The art is to fit the model to reality sufficiently closely so that the projections it gives will be similar to the behaviour of the real system, and, at the same time, to keep it as simple as possible. (A generous application of Ochams razor is called for.) Matrix models can also be divided into two classes depending on the behaviour of the flow system in time. 1/ In the steady state class, it is assumed that all changes to the flow system have occurred sufficiently far into the past for all heads aoo
8.2
Matrix model
flows to reach an equilibrium. That is, not only does flow into the aquifer system equal flow out of the system, but flows into and out of any definable part of the system are also equal (this excepts points of recharge or discharge) . The steady state class of model has a limited application because in practice it is changes in an aquifer system that cause problems, and therefore it is a changing system that must be modelled. 2/ So we come to the unsteady, or transient, state. In models of this type time is a variable that must be considered. Depending on the model, it may be the time from the beginning of discharge from a well or series of wells, or it may be the time over which groundwater has been flowing through an aquifer under the influence of unequal piezometric heads. Other examples are the duration of the leakage of a contaminant from a land fill, or of saline groundwater from the raised water table beneath an irrigation area. The model described in this chapter is an analytical model of transient state discharge or recharge. Since flows due to variations in the preexisting piezometric surface are not considered, the model is neither fully transient state, nor fully steady state, but is a hybrid type. 2. PROGRAM ANMODL The basis of this program is in the fact that the change in piezometric surface at a point in an aquifer under the influence of several discharging or recharging wells, is the sum of the drawdown due to each well individually. Puting it another way, suppose at a given time, t, the water level in a piezometer has changed by A units due to discharge from well A1. At some other time drawdown in the piezometer under the influence of another well, B1 is measured as B units, and on a third occasion, drawdown due to discharge from well C1 is found to be C. (In all three cases the pumps have operated for the same length of time before the measurement of the drawdown.) If all three pumps start now at the same time, and go on discharging for the same length of time as before, the drawdown in the piezometer should be A+B+C. 2.1. Program verification Load and run the program. You will first be asked if you want to use the printer. I suggest answering in the affirmative for this run. The computer will next display "Size of the array", and then ask "No. of nodes in x direction?" Answer with 8. Answer with 10 to the question "No. of nodes in the y direction?" The program will use this information to dimension three 8 by 10 matrices, one for heads, one for discharges/recharges, and the third for times; ie. duration of discharge/recharge. Give 100 (metres) as the spacing between (There is no need for these two nodes in both the x and y direction. distances to be the same in other cases.) Transmissivity and storage coefficient will be asked for; reply With 40 cubic metres per day per metre and 0.0005 respectively. The time unit to use is days, so press d or D at the prompt.
Matrix model
8.3
Now we have come to the part of the program that allows the setting up of the matrices. This part will require some care, although you can recover from any mistakes by causing the program to write over the erroneous data. In this example run you will be given data to enter, but in practical applications it would be all but essential to have a drawing of the matrices that you want to set up laid out in front of you. You will notice that you are given the option of setting up either the initial head, or discharge/recharge matrix first. For the example run leave the initial heads, they will default to zero right across the matrix. Press 2 to set up the discharge/recharge matrix. Menu 2 will now be displayed, giving the options of several groupings for the setting up of parts of the matrix. Choose the column option by pressing 2. Now you must define which column it is that you are interested in, the portion of that column, and the discharge rate for each node within that portion. Type 2,4,6,300. This indicates to the computer that you want to set discharge rates in column 2, which is the third column from the left as numbering starts at zero. The 4 and 6 indicate that within column 2 you want to set up three nodes, numbers 4, 5, and 6. ie. You will put discharge points at elements (2,4), (2,5), and (2,6). Each of the discharges will be (Note that even if the time unit, minute was 300 metres cubed per day. chosen, discharge rates would still be based on days. The minute would only apply to the unit used for duration of discharge/recharge. Press enter. The program checks for errors in entries at this stage, but may not pick up all operator mistakes. For example, entry of a negative number for duration of discharge will probably lead to some Basic error message. No difficulty should be experienced if a little care is used. After accepting the entry of the discharge rate, the program will request the duration of the pumping. Reply with 10 (days). Before requesting a printout, enter a last single recharge node by pressing 1, and then typing 7,8,-500. [ie. A recharge rate of 500 cubic metres per day at element (7,8).] Give a duration for this recharge of 5 days. Now, if all has gone well, you have set up the matrices as shown below. Get a printout and check by pressing 5 in menu 2. Table 8.1; 0.(\0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
The discharge rate matrix of the example run. 0.00 0.00 0.00 300.00 300.00 300.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 R 9 0.00 -500.00 R 8 0.00 0.00 R 7 0.00 0.00 R 6 0.00 0.00 R 5 0.00 0.00 R 4 0.00 0.00 R 3 0.00 0.00 R 2 0.00 0.00 R 1 0.00 0.00 R 0
8.4
Matrix model Table 8.2;
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
The duration of operation of discharge/recharge (days). 0.00 0.00 0.00 10.00 10.00 10.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 5.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
R9 R8 R1 R6 R5 R4 R3 R2 R 1 R0
After printing the tables above, you will be returned to the main menu. Choose option 3, "finished" (with setting up). The calculations of drawdowns due to each discharging node, and the summation of all such drawdowns at each node will now commence. The total drawdowns will appear on the screen, and on your printer as they are calculated. Depending on what printer you have, it may wait to build up a line of type before printing anything, or it may print as it receives data. There is a special case in the drawdown calculations which should be mentioned. In the example data given above, for the calculation of drawdown at node (2,4) due to discharge from node (2,4), a distance of zero will be calculated. If this is fed into the Theis equation subroutine so that the drawdown may be calculated, an error will result. Whenever a distance of zero is detected then, it is changed to a quarter of the distance between nodes in the x direction, in this case it is changed to 25m (in program line 1080). This only applies to the distance used in calculation of the drawdown at a node due to the discharge from the same node, drawdowns due to discharges at other nodes will be dependent on the distances calculated. The values for change in piezometric head for the example data are given below. Table 8.3; -3·21 -3.92 -4.14 -5.41 -5.81 -5.61 -5.01 -4.29 -3.64 -3·09 C0
-3.28 -4.21 -5.48 -6.90 -1.53 -7.09 -5.85 -4.71 -3.86 -3.22 C 1
Calculated heads. -3.11 -4.13 -5.19 -8.83 -9.19 -9.11 -6.31 -4.82 -3.89 -3.23 C2
-2.62 -3.51 -4.82 -6.32 -1.05 -6.72 -5.56 -4.49 -3.69 -3·09 C 3
-1.83 -2.41 -3.31 -4.30 -4.86 -4.88 -4.44 -3.86 -3·31 -2.84 C4
-0.18 -1.10 -1.84 -2.68 -3·29 -3.52 -3.44 -3.18 -2.86 -2.53 C5
0.53 0.82 -0.21 -1·35 -2.11 -2.50 -2.62 -2.56 -2.40 -2.19 C 6
1.62 4.08 1.08 -0.45 -1.28 -1.75 -1.98 -2.03 -1.98 -1.86 C7
R9 R8 R1 R6 R5 R4 R3 R2 R 1 R0
Matrix model
8.5
If you set up the model for more than 8 or 9 columns, the printout to the screen and/or the printer will become less tidy because of insufficient space on one row for all the columns of data. Little can be done about this problem on the screen, the limit of 80 character columns is fixed. With the printer, however, there is usually an answer. Most readers will be using dot matrix printers which can usually be set up to print a character every 1.45mm instead of the default of a character every 2.54mm. This will give you about 132 characters on a 'standard' 210mm wide page, and much more on a wide printer. Unfortunately each printer has it's own set of commands, and you will have to check your manual for the command to set your printer to condensed print. A second problem may arise if you attempt to send more than 80 characters from your computer to your printer without an instruction to change to the next line. Several computers I've used (including an IBM PC clone) count the characters sent to the printer, and if the count gets to 80 before a command to roll on to a new line (line feed, or just LF) is sent, the computer will take matters into it's own hands and send a line feed (with usually a carriage return as well. ie. an instruction to go back to the start of the line. Abbreviated to CR.) This problem is fixed by an instruction to the computer to send longer lines, usually with the WIDTH command. As the way the command is used will depend on your computer, you will need to refer to your manuals. 2.2. The method used by the program Initialization and the loading of constants are done first, similarly to many other of the programs in this book. Then the first part of interactive input, up to and including the entry of the time unit for discharges. Line 60 dimensions arrays before the subroutine to set-up those arrays is called. This subroutine uses variables LX, LY, UX, UY, and V to handle the values entered for lower x, lower y, upper x, upper y, and value, respectively. In the case of entry of a single point, or a single column, UX is made to equal LX, and similarly in the case of a single row, UY is made to equal LY. A flag, PA, keeps track of the parameter that is being entered. Lines 7216 to 7228 enter the changes into the matrices. The core of the program is in the double double loop in lines 1000 to 1240. The outer double loop sets the element for which drawdown is to be calculated, and the inner one sums drawdowns at the current node due to all discharging nodes. Line 1060 tests each element in the inner double loop for a discharge value, if it has no discharge the next element is tested, and so on until a discharging node is found. Line 1070 uses Pythagoras's theorem to calculate the distance between the current element for which the drawdown is required, and the current discharge element (or more correctly, between the two nodes). As mentioned above, line 1080 tests for a distance of zero, and if found, alters it. Lines 1090 to 1130 use the polynomial approximations to the Theis equation to calculate drawdown due to the current discharge element, and then line 1140 sums that discharge with any calculated for the current element previously. Back in the outer double loop, line 1160 sums
8.6
Matrix model
the calculated stage.
total
drawdown with
that
entered by the user at the setup
2.3. Usage of variables in ANMODL used in the polynomial approximation of the Well CO - cg Constants Equation. Total of all calculated drawdowns for the current node. rn The storage coefficient. CS The drawdown calculated for the current node, due to the current DD discharge/recharge well. A string for numerical formatting. G1 H(x,y) The matrix of piezometric heads. The primary (integer) counter. I The second level primary counter. 10 The secondary (integer) counter. J The second level secondary counter. JO A flag which is set when the line printer is to be used. LP Lower x value. LX Lower y value. LY The number of columns in the matrices (and also the model). NC The number of rows in the matrices. NR Parameter currently being entered, or printed. PA Has the value 4 times Pi times transmissivity. PT Distance from the current discharge well to the current node being R calculated. Note that the R printed at the end of each row of output is an indicator only, and not a variable used in the program. A string used for handling yes/no questions. SY Transmissivity. T Duration of current discharge/recharge. T1 Time factor, used to convert times to days. TF TI(x,y) The matrix of durations of discharges. Q(x,y) The matrix of discharge rates. U The variable u, as used in the Theis Equation. U2 Has the value u squared. UX Upper x value. Upper y value. UY Value to be entered into current matrix (as indicated by PAl at the V nodes indicated by LX, LY, UX, and UY. The distance between nodes in the x direction. X1 The distance between nodes in the y direction. Y1 ZX, Z$, and ZZ$ are used in program flow control. REFERENCE Kinzelbach, W., 1986. Programs in Basic.
Groundwater Modelling, An Introduction with Sample Elsevier. Amsterdam-Oxford-New York-Tokyo. 333PP.
Matrix model 3. 3.1.
PROGRAM LISTING. An analytical matrix model; program ANMODL
1 REM ••••• ANMODL/BAS ••••• 2 REM • Last modified 18th. May, 1986 5 CLS: PRINT TAB( 10) i" ANMODL/BAS" 10 DEFINT I-L:DEFSTR G,S 20 PRINT"Transient state. Homogeneous, isotropic aquifer." 30 GOSUB 8500:REM U Load constants 50 GOSUB 7000:REM U First part interactive input 60 DIM H(NC,NR),Q(NC,NR),TI(NC,NR) 70 GOSUB 7064:REM U Second part interactive input 1000 REM === Calculation section === 1010 CLS 1020 PRINT"Calculated heads":IF LP=1 THEN LPRINT:LPRINT"Calculated heads" 1030 FOR J=NR TO 0 STEP-1:FOR 1=0 TO NC:REM # Element being calculated 1040 CD=O:DD=O 1050 FOR JO=O TO NR:FOR 10=0 TO NC:REM U Element causing head change 1060 IF Q(IO,JO)=O GOTO 1150 1070 R=SQR«IO-I).(IO-I).X1.X1+(JO-J)·(JO-J).Y1'Y1) 1080 IF R=O THEN R=X1/4 1090 U=R.R'CS/(4'T'TI(IO,JO)):IF U>80 THEN 1150 1100 U2=U'U:IF U>1 GOTO 1130 1110 DD=(Q(IO,JO)/PT)'(-LOG(U)+CO+C1'U+C2'U2+C3'U'U2+ C4'U2'U2+C5'U'U2'U2) 1120 GOTO 1140 1130 DD=(Q(IO,JO)/PT)'(1/(U'EXP(U)))'(C6+C7'U+U2)/(C8+C9'U+U2) 1140 CD=CD+DD 1150 NEXT IO:NEXT JO 1160 H(I,J)=H(I,J)-CD 1170 PRINT USING G1iH(I,J)i:IF LP=1 THEN LPRINT USING G1iH(I,J); 1180 NEXT I:PRINT" R"iJ:IF LP=1 THEN LPRINT" R"iJ 1190 NEXT J 1200 FOR 1=0 TO NC 1210 PRINT USING" CU# "iIi 1220 IF LP=1 THEN LPRINT USING" C## ";Ii 1230 NEXT I 1240 PRINT:GOTO 9999 7000 REM === Keyboard input === 7004 PRINT"Do you want to use the printer?" 7008 Z$=SY:GOSUB 9800:IF ZX<3 THEN LP=1 ELSE LP=O 7012 PRINT:PRINT"Size of array" 7016 INPUT"No. of nodes in x direction"iNC:NC=NC-1 7020 INPUT"No. of nodes in y direction";NR:NR=NR-1 7024 INPUT"Spacing of nodes in the x direction (m)";X1 7028 INPUT"Spacing of nodes in the y direction (m)"iY1
8.7
8.8
Matrix model
7032 7040 7044 7048 7052 7056 7060 7064 7068 7072 7076 7080 7084 7088 7092 7096 7100 7104 7108 7112 7116 7120 7124 7128 7132 7136 7140 7144 7148 7152 7156 7160 7164 7168 7172 7176 7180 7184 7188 7192 7196 7200 7204 7208 7212 7216 7220
INPUT"Transmissivity (m*m/Day)";T INPUT"Storage coefficient";CS PRINT"What time unit (for duration of discharge/recharge) ." PRINT"<M>inutes or ays." Z$="MmDd":GOSUB 9800 IF ZX<3 THEN TF=1440 ELSE TF=1 RETURN REM -- Second part of keyboard input CLS PRINT"Note that the first column and row are numbered zero." PRINT"== Setting up ==" PRINT" Menu 1" PRINT"To enter" PRINT"Initial head, press 1" PRINT"Discharge/Recharge, 2" PRINT"or i f finished; 3" Z$="123":GOSUB 9800:IF ZX=3 THEN RETURN PA=ZX PRINT:PRINT" Menu 2. Type of 'block'" PRINT"Single node, 1" PRINT" Single column, 2" PRINT"Single row, 3" PRINT"Block, 4" PRINT"Get print-out, 5" PRINT"or go to menu 1; 6" Z$="123456":GOSUB 9800 ON ZX GOTO 7144,7152,7164,7176,7250,7064 INPUT"X, Y co-ordinates, and value. ego '1,4,100"';LX,LY,V UX=LX:UY=LY:GOTO 7184 PRINT"X co-ordinate of column, Y co-ord of bottom and" INPUT"top, and value. ego '3,2,5,100"';LX,LY,UY,V UX=LX:GOTO 7184 PRINT"Y co-ordinate of row, X co-ord. of left & right" INPUT"end, and value. ego '3,2,5,100"';LY,LX,UX,V UY=LY:GOTO 7184 PRINT"Left X, right X, bottom Y, top Yeo-ordinates," INPUT"and value. ego '1,4,2,6, 100"'iLX,UX,LY,UY,V IF LXNC THEN PRINT"Upper column No. to greatl":GOTO 7108 IF UY>NR THEN PRINT"Upper row No. to greatl":GOTO 7108 IF PA=2 THEN INPUT"Duration of discharge/recharge"iT1 ON PA GOTO 7216,7220 FOR J=LY TO UY:FOR I=LX TO UX:H(I,J)=V:NEXT I:NEXT J:GOTO 7108 FOR J=LY TO UY:FOR I=LX TO UX
Matrix model 7224 7228 7250 7260 7270 7280 7290 7300 7310 7320 7330 7340 7350 7360 7370 7380 7390 7400 7410 7420 7430 7440 7450 7460 7470 8500 8510 8520 8530 8540 8550 8560 9800 9810 9820 9830 9840 9850 9999
Q(I,J)=V:TI(I,J)=T1/TF NEXT I:NEXT J:GOTO 7108 REM === Video and printer output CLS ON PA GOTO 7280,7340 PRINT"Heads":IF LP=1 THEN LPRINT:LPRINT"Heads" FOR J=NR TO 0 STEP-1:FOR I=O TO NC PRINT USING G1jH(I,J)j:IF LP=1 THEN LPRINT USING G1jH(I,J)j NEXT I PRINT" R"jJ:IF LP=1 THEN LPRINT" R"jJ NEXT J:GOTO 7470 PRINT"Discharge, (metres cubed/day)":IF LP=1 THEN LPRINT: LPRINT"Discharge, (m cubed/day)" FOR J=NR TO 0 STEP-1:FOR I=O TO NC PRINT USING G1jQ(I,J)j:IF LP=1 THEN LPRINT USING G1jQ(I,J)j NEXT I PRINT" R"jJ:IF LP=1 THEN LPRINT" R"jJ NEXT J PRINT SCj:Z$="Cc":GOSUB 9800 CLS:PRINT"Duration of operation of discharge/recharge"j:IF LP=1 THEN LPRINT:LPRINT"Duration of operation of discharge/recharge."j IF TF=1 THEN PRINT" (Days)":IF LP=1 THEN LPRINT" (Days)" IF TF=1440 THEN PRINT" (Minutes)":IF LP=1 THEN LPRINT" (Minutes)" FOR J=NR TO 0 STEP-1:FOR I=O TO NC:PRINT USING G1jTI(I,J)/TFj :IF LP=1 THEN LPRINT USING G1jTI(I,J)/TFj NEXT I:PRINT" R"jJ:IF LP=1 THEN LPRINT" R"jJ NEXT J:GOTO 7470 PRINT SCj:Z$="Cc":GOSUB 9800:PRINT:PRINT:GOTO 7076 REM === Input constants === PT=4*3.141593*T:SY="YyNn" G1="ifIIHIIiI. 1111": SC="Press C to continue " CO=-.57721566H:C1=.99999193H:C2=-.24991055H:C3=5.51996 8E- 02 C4=-9.76004E-03:C5=1.07857E-03:C6=.250621:C7=2.334733 C8=1.681534:C9=3.330657 RETURN REM === Await valid key --ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$="" THEN 9820 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END
8.9
Plotting
9.1
Chapter 9
The programs of chapter 4 produce disk data files including drawdowns vs. times. Program DTDHA of chapter 6 allows the user to enter discharge test data via the keyboard, and this may sUbsequently be saved to disk. Until recently the cost of good plotters has been high enough to discourage their purchase for use with microcomputer systems, but this situation has now changed. (I have in the past written several programs to produce graphs using dot addressable dot matrix printers. This is complicated, slow, and the results are inferior to graphs produced by plotters; also the code required to produce a graph on one printer will usually be very different to that required for another.) 1. COMPUTERISED PLOTTING OF DISCHARGE TEST DATA 1.1. Program DTPLOT (Discharge Test PLOT) This is a flexible graphing program for driving a plotter such as the Roland DXY-880 flat bed plotter, using a maximum paper size of A3 (420mm x 298mm). The program is set up to use the DXY set of commands, so it should be usable with any plotter accepting these commands. The graphs illustrating chapter 4 were produced using this program. The program assumes that the units for times are minutes, and for drawdowns, metres. The user may find that other units can be used; with caution. 1.2. A summary of the capabilities of the program Time-drawdown graphs may be produced on either A3 or A4 (298mm x 210mm) paper. Graph types; 11 Log-log at the standard 76.2mm (3 inch) per log cycle for curve matching; only on A3 paper. 21 Log linear, ie. log time against linear drawdown, on either A3 or A4 paper. 31 Drawdown vs. square root of time, for analysis of discharge tests in strip aquifers. The data from the water level recovery phase of a discharge test may be plotted on a log-linear graph as residual drawdown against time, true recovery against time, or as residual drawdown against t/t1. ie. Time since commencement of pumping over time since cessation of pumping. Alternatively, recovery data may be plotted on a root time graph as residual drawdown against root t minus root t1. Note that for these options, reading times must all be measured from the beginning of the recovery period, and not from the beginning of the discharge period. If your data are not in this form, they can easily be changed using option two of menu two of DTDHA. The time and drawdown limits of log-linear graphs may be either set by the user or automatically set to suit the paper size and the data. The scale of both log-linear and root time graphs will be set automatically to suit the
9.2
Plotting
paper and either the data or the limits set by the user. One or more sets of data may be plotted on one sheet. The colour and symbol used to plot a data set is under the full control of the user. Additional copies of a graph built up by using the above options may be produced on the pressing of one key in a time of 2 to 3 minutes per copy. This allows several copies of a multi-colour graph to be produced for a report. 1.3. Setting up the plotter The following instructions apply to an IBM PC computer or similar, connected to a Roland DXY-880 plotter using a Centronics type parallel port. Set the DIP (Dual In-line Package) switches as shown below; Switch bank NO.1; all switches off. Switch bank NO.2; switches 1-3 on, switches 4-6 off, switch 7 on, switches 8,9 off, and switch 10 on. Note that the DIP switch settings should be changed while the plotter is turned off, as any change made to them while it is on will probably be ignored. (It seems that devices such as plotters and printers check the settings on their DIP switches only at the time the power is first switched on. ) The plotter should be connected to the current primary parallel port. If your computer has two parallel ports, perhaps for a printer and a plotter, then instructions meant for the plotter will go to the printer i f that is the current port. Clip a piece of paper of A3 size (if you intend to run the program using the demonstration data) into the plotter. The black pen should be placed in position number 1, other pens may be placed in positions of your choice. They will be used on your instruction only. 1.4. Program verification Data from a real discharge test are written into the program (mainly as data statements, between lines 7750 and 7990). The primary purpose of this is to provide data for a test run of the program. After loading Basic, and the program, type RUN and press <ENTER>. The computer should respond with "Discharge test plotting program, for the Roland DG or compatibles." "Do you want to load a disk data file?" Press N. The message "Loading data from DATA statements" will now be printer on the screen, and after a short pause, "Do you want to view the data?" Pressing Y at this time will allow you to have the time-drawdowndischarge rate data printed on the screen. You may page through the data in exactly the same way as in program DTDHA. When you have finished looking at
Plotting
9.3
the data you will move on to the next step; as you would have done immediately had you pressed N rather than Y above. You will now be asked; "Which type of graph, <1> Log-linear, <2> Log-log, <3> Root time,
<4> Log-lin. t/t1 resid. drawdown, <5> Root t minus root t1, <6> Log-linear residual drawdown?"
Note that the options numbered 1 to 3 are for data from the drawdown phase of the test, and options 4 to 6 are for data from the recovery phase. I suggest selecting a log-linear graph by pressing the 1 key. The computer will now remove the first time-drawdown-discharge rate datum set (because the time is zero, and the log of zero is undefined), and print a message to that effect. Had you chosen a root time graph, this first datum set would not have been removed. The computer will now display "utomatic or <M>anual setting of scales?" Press A. You will be asked for a name for the graph. You may use any name that consists of 10 characters or less, and does not include commas. Examples of valid names are; "Trial graf", "Testrun", "3RD TEST", "No. 2%&*". This name will be printed in the left top corner of the graph. The computer will now commence setting out the reference lines for the graph. After a short time a beep will indicate that more input is expected. You will be asked for a colour number (ie. the number of the position of the pen which you want to use). Reply by pressing a number key from 1 to 8. Similarly, you will be asked for a symbol number. Reply with a number from 1 to 15, and press <ENTER>. (You may wish to check the plotter instruction book on these two points, especially if you are not using a Roland DXY-880 plotter.) The computer can now finish the graph. In the case of this trial graph, no option will be provided to plot more data files on the same sheet, nor will an opportunity be given to have a second copy produced. 1.5. Detailed program description It may be most useful to describe the various options in the order in which they will be encountered. 11 "Do you want to load a disk data file?" The normal response to this question will be to press the Y key. Pressing the N key will result in the computer reading the DATA statements built into the program. These data may, of course, be erased and replaced with your own data if so desired: see below for details. Pressing Y will cause entry of a file name to be requested.
9.4
Plotting
21 "What file name (without the extension)?" Here you must respond in the same way as you did when you created the data file in either one of the programs of chapter 4, or in DTDHA. (The extension ".WTD" will be suffixed to the file name that you enter.)
31 "Which type of graph, <1> Log-linear, <4> Log-lin. tlt1 resid. drawdown, <5> Root t minus root t1, <2> Log-log, <3> Root time, <6> Log-linear residual drawdown?" As the figures of chapter 4 were produced by this program they will serve to illustrate it. Figure 4.7a is an A4 size example of a log-linear graph of (simulated) drawdown data with tlt1 residual drawdown on the same sheet. Figure 4.7b is an A4 example of a root time graph of the same drawdown data with root t minus root t1 residual drawdown on the same sheet. Note that while distances along the axes of these graphs is proportional to the above given function of the time (or drawdown), the numbers printed along the axes are the time in minutes of the test, tlt1, or (root t minus root t1)~2.
41 Removal of times that are less than, or equal to zero As the calculation of the co-ordinates of the points to be plotted on the graphs involve taking either the logarithm (base 10), or the square root, of the time; negative times in both cases cannot be allowed. In the former case, zero times also cannot be allowed. On the other hand, the Sternberg analysis of chapter 7 requires that initial conditions (ie. the drawdown and discharge rate at zero time) be present in the data file. Therefore this program removes data relating to zero or negative times. Note that plots that would be outside of the graph boundaries are also suppressed, except in the case of small negative drawdowns. (Small negative drawdowns can be encountered in the latter stages of recovery, probably due to various forms of "noise", such as changes in atmospheric pressure. Such small negative drawdowns can be accommodated by plot5 slightly outside of the upper boundary of the graphs. Since the log-log graph is only used for drawdown data, negative drawdowns should not be involved; if however one was in the data, it would result in a function call error.) 51 Automatic or manual setting of scales This option is only available in the case of log-linear graphs, all other types are scaled automatically. (There may be a case for extending the ability of the user to set his own scales; the program will lend itself quite well to that type of change.) In manual scaling, the user is requested to enter a lower and upper time limit, and an upper drawdown limit. To choose a lower time limit, the computer takes the largest power of ten lower than, or equal to, the lower time limit entered by the user. Similarly, to choose an upper time limit, the computer selects the smallest power of ten that is equal to, or greater than, the upper time limit entered by the user. The upper drawdown limit is
Plotting
9.5
the smallest number that is at least as large as the upper drawdown entered by the user, and is a power of ten multiplied by one of 1, 2, 2.5, or 5. If it is found that some of the data in the current file is outside the range chosen, the user is warned before the graph is plotted. If all of the data in the current file is outside the chosen range, then the limits are rejected, and the user is asked to enter a new set of limits. In automatic scaling upper and lower time limits, and an upper drawdown limit, are chosen such that all the data are enclosed. The choice of the limits is along very similar lines to those above. In the case of log-linear graphs, and with both automatic and manual scaling, the horizontal distance allotted to each log cycle is inversely proportional to the number of log cycles required to enclose the data; bearing in mind the size of the chosen sheet of paper. So that every log-linear graph on A4 paper will be the same length, with the same rule applying for A3. In the case of the square root of time graph, the upper time limit is chosen such that it is the smallest square of the product of a power of ten and one of the integers from 1 to 9, while yet being at least as large as the greatest time in the data. ie. it is a member of the series 1, 4, 9, 16, 25, 36, 49, 64, ai , 100, 400, 900, 1600, . . . The length of paper allocated to each log cycle in a log-log graph is fixed, therefore it is only the number of log cycles that can be varied. A3 paper is long enough for four log cycles of 76.2mm each, and high enough for three. If five or even more log cycles are found to be required to enclose the data on the time scale, the lower time data will not be plotted. Similarly, if more than three log cycles are required along the drawdown scale, the lower drawdown data will not be plotted. 6/ Graph name You may use any name you choose here, 50 long as it does not exceed 10 characters, and contains no string delimiters such as commas and possibly semicolons. Perhaps the most likely type of name will be a figure number. This will be printed in black (so long as a black pen is in possition number one) in the top left corner of the paper. 7/ Specification of colour and symbol When you are asked to specify a colour, you should place a pen in the appropriate position before pressing the number key corresponding to that position. The computer will not display the number of your choice, nor will you have to press <ENTER>. The Roland DG plotter has 15 different symbols, any of which may be used to plot a set of data. Check your plotter manual and specify the desired symbol by entering it's number, then press <ENTER>. Either different symbols and/or different colours can be used to identify separate sets of data on the same graph.
9.6
Plotting
1.6. Units used All time data in data files should be in minutes, except when you convert your times to t/t1 in program DTDHA. In this case take care to not do the conversoin again in this program. Drawdown data may be in any units of length; even that ridiculous unit, the foot, is acceptable. 1.7. Writing your data into the program This method is not recommended as a convenient way of getting your data into the computer in this program. However, if you decide to try it, I suggest that you follow the format used for the example data. 1/ Use the section of code from line 7780 to 7860 to load the discharge rates into the vector Q(x). 2/ Use the section from line 7872 to 7990 to enter the timedrawdown data. These data are entered as pairs, with time (minutes suggested) first, then drawdown (metres suggested). Care must be taken to not miss or repeat any datum. Do not put a comma at the end of any line. A time value of -1 marks the end of the data. There must be a drawdown value after this time value, although what it is does not matter.
Line 1 200 440 800 860 1000 1100 3500 3600 3660 3700 3800 3900 4000 4150 4250 4350 4500 4600 4700 5000 5500 5600 5700 6000
1. 8. Major subroutines and program segments No's. Function Initialization - 199 Primary control section - 430 Control of plotting a second and subsequent file - 960 A subroutine to control getting and plotting an additional - 850 data file Print the name of the current file - 960 Control for printing of additional copies - 1080 Print the name of the graph - 1120 Convert times to root t minus root t1 - 3550 Convert times to t/t1 - 3650 Entry of graph name - 3690 Specification of graph type - 3795 Specification of colour and symbol - 3850 Remove zero times from the data - 3980 Plot and label log time reference lines - 4145 - 4240 Plot and label linear drawdown reference lines Plot and label log drawdown reference lines - 4330 Plot and label root t time reference lines - 4450 Plotting data on log-linear, and log-log scales - 4570 Plotting data on root time scale - 4670 Print names on the axes - 4790 Manual setting of scales - 5170 Automatic setting of scales - 5540 Set paper size - 5650 Drawdown scaling factor, log-log scale - 5790 Drawdown scaling factor, log-linear - 6060
Plotting 6100 6200 7250 7750 8000 8200 9500 9600 9800 9999
-
6180 6270 7390 7990 8180 8290 9590 9670 9850
1.9.
9.7
Time scaling factor, log scale Scaling factor, root time Display file details Load data from DATA statements Load disk file Get lower and upper limits of drawdowns and times Load strings and constants Entry of file name Single key program flow control End
Variable used in program DTGRAPH Use of variable A A general use variable. Al As above. BY The y co-ordinate at the bottom of the graph. C A general use constant. CD(x) The colour number for file number x. CE(x) The symbol number for file number x. CL A constant setting the length of the graph. ie. The length of the graph in tenths of millimetres. CF(i) A flag indicating the graph type. 1 for log-linear, 2 for log-log, 3 for square root of time, 4 for t/t1 residual drawdown, 5 for root t minus root t1, and 6 for residual drawdown against time. Least plottable drawdown. Dl D2 Greatest plottable drawdown. The greatest drawdown in the data. DG DL The lowest (numerically) drawdown in the data. Drawdown scaling factor. It's value will be one of the series, .1, DS 0.2, 0.25, 0.5, 1, 2, 2.5, depending on the amount of reduction required. The reduction is directly proportional to the value of DS. The x co-ordinate of the end of the graph. EG A flag for general, short term use. F A flag for general, short term use. F1 The copy flag. This flag is set to 1 on second and subsequent FC copies of the graph. 1 for A flag indicating the layout of the reference lines. FR log-linear, 2 for log-log, and 3 for square root of time. A flag, set to 1 for automatic scaling, 2 for manual scaling. FS The counter for files. ie. It has the ordinal number of the ID current data file. The number of log cycles required on the drawdown scale. W The number of log cycles required on the time scale. LC The log of 10 to the base e. MT A constant recording the total number of files plotted. NF The name of the current file. ~$ Paper type. PT=1 if A3 paper, PT=2 if A4 paper. PT Name
9.8
Plotting
SN(x) SY T1 T2 TD(x) TG TL TS TY VS(i)
A string vector. The name of file No. x. A string for handling yes/no answers. Least plottable time. Greatest plottable time. The total duration of pumping for file number x. The greatest time in the data. The smallest time in the data. The time scaling factor. The y co-ordinate at the top of the graph. A vector of legal increments on the drawdown scale. The vector containes the values, 1, 2, 2.5, and 5. DS is given a value of some power of 10 multiplied by one of the values in this vector. The x co-ordinate of the current plot. The time in minutes of the current plot, and also the x co-ordinate of the left hand end of the current drawdown reference line. The x co-ordinate of the right hand end of the current drawdown reference line. The x co-ordinate of the position for printing the name of the current data file. The current lower y co-ordinate for a time-drawdown reference line. The current higher y co-ordinate for a time-drawdown reference line. Returns the ordinal position from the single key input routine. A string containing the valid entries for the single key input routine. A string used to accept single key input.
X X1 X2 XN Y1 Y2
ZX Z$ ZZ$
2. PLOTTER COMMANDS The set of commands used in this program are known as the DXY commands. They are used by the Roland DXY-880, and may also be used by a number of other plotters. If your plotter cannot use the DXY commands you will need to alter the program to suit whatever set of commands it does use. The plotter commands used in this program are explained below to make the alteration of the program to suit different command sets easier. The coordinate system used by the plotter is in standard form, with x=O on the left, and y=O on the bottom. The units used are tenths of a millimetre. [ie. position (1200,1000) is 120mm from the left limit and 100mm from the bottom limit.] Commands are sent to the plotter as line print commands. The first character is used to tell the plotter what type of command is being given; this may then be followed by the data. [ego The command to move the pen to position (1200,1000) is; LPRINT"M1200,1000".]
Plotting
9.9
Command Function H Moves the pen to (0,0) with the pen up. eg. LPRINT"M". M Must be followed by a set of coordinates. It moves the pen to the given location. The pen will be up, off the paper. ego LPRINT"M300,0". Prints the message which follows the command. eg. LPRINT"PFigure P 1." will cause the message 'Figure 1.' to be printed starting at the current pen position. Q This tells the plotter the direction in which it is to write messages or marks. The command Q must be followed by a numeral from 0 to 3 inclusive. 0 will cause writing to be upright, 1 will cause it to be from bottom towards top (ie. rotated 90 degrees anticlockwise), 2 will cause it to be printed upside down and from right to left, and 3 will cause it to be from top to bottom (ie. rotated 90 degrees clockwise). ego LPRINT"Q1". This must be followed by an integer from 1 to 15. It will draw the N symbol, indicated by the number, centred on the current pen position. ego LPRINT"N12" will cause an eight armed asterisk to be printed. J This command must be followed by an integer from 1 to 8 (in the case of an eight pen plotter). It will cause the plotter to select the pen corresponding to the specified number. ie. LPRINT"J3" will cause the plotter to select the pen in pen holder number 3, and then move back to the position it was in when it received the command. There are a number of other commands which may be given, but the above list covers those that were used in program DTPLOT. 3. PROGRAM LISTING 3.1. Discharge test data plotting, program DTPLOT REM ••••• DTPLOT.BAS ••••• 2 REM # Last modified 27th. Apr. 1986. 30 DEFINT F,I-L:DEFSTR G,S 40 DIM DD(200),TI(200) ,TL(200) ,Q(200) 50 GOSUB 9500:REM # Load strings & constants 60 CLS 70 PRINT"Discharge test plotting program, for the Roland DG or compatibles." 200 REM === Control section === 210 PRINT 220 PR'INT"Do you want to load a disk data file?":Z$=SY:GOSUB 9800 230 IF ZX<3 THEN GOSUB 9600:GOSUB 8000:REM # Get name and load file 235 IF ZX<3 THEN ID=ID+1:SN(ID)=NM$:GOTO 250 240 PRINT"Loading data from DATA statements":GOSUB 7750 250 PRINT"Do you want to view the data?":Z$=SY:GOSUB 9800 260 IF ZX<3 THEN GOSUB 7250 270 PRINT:PRINT"Which type of graph, <1> Log-linear, <4> Log-lin t/t1 resid. drawdown, " <2> Log-log, <5> Root t minus root t1," 280 PRINT"
9.10
Plotting
290 PRINT"
<3> Root time, (6) Log-lin residual drawdown?" 300 Z$="123456":GOSUB 9800:CF(ID)=ZX 302 PRINT 305 IF (CF(ID)(>3 AND TL=O) OR TL(O THEN GOSUB 3900:REM Remove 0 308 IF CF(ID)=4 THEN GOSUB 3600:REM # Convert to t/t1 309 IF CF(ID)=5 THEN GOSUB 3500:REM H Convert to root t minus root t1 310 IF CF(ID)(>1 AND CF(ID)<>4 THEN FS=1:GOTO 330 315 PRINT:PRINT"utomatic or <M>anual setting of scales?" 320 Z$="AaMm":GOSUB 9800:IF ZX<3 THEN FS=1 ELSE FS=2 330 IF FS=1 THEN GOSUB 5500 ELSE GOSUB 5000 340 GOSUB 3660:REM H Enter graph name 370 IF CF(ID)<>3 AND CF(ID)(>5 THEN GOSUB 4000:REM H Plot ref. lines. 377 IF CF(ID)=3 OR CF(ID)=5 THEN GOSUB 4350:REM H Ref. lines root t. 380 GOSUB 1100:REM H Plot name of graph 385 GOSUB 4700:REM H Name axes 390 GOSUB 3800:REM H Specify colour and symbol 400 GOSUB 4500:REM H Plot data 405 GOSUB 860: LPRINT"h": REM iF Print name of first file 410 IF ID=O THEN 9999:REM H No more data sets 420 CLS:PRINT"Do you want any more sets of data plotted on the same sheet?" 430 Z$=SY:GOSUB 9800:IF ZX>2 THEN 1000:REM H Any more copies 440 REM === Another file to plot === 450 ID=ID+1:GOSUB 3700:REM H Specify graph type 460 GOSUB 3800:REM H Colour and symbol 470 GOSUB 9600:REM H File name 475 SN(ID)=NM$ 480 GOSUB 800:REM H Plot new data 490 GOTO 420 800 REM === Get, and plot new data --805 NM$=SN(ID) 810 GOSUB 8000:REM H Load file 820 IF (CF(ID)<>3 AND CF(ID)(>5 AND TL=O) OR TL2100 THEN XN=XN-2000:F=1 ELSE F=O 880 IF F=O THEN LPRINT"m"XN","TY+100:LPRINT"n"CE(ID): LPRINT"m"XN+25","TY+100:LPRINT"p"NM$ 890 IF F=1 AND XN<2000 THEN LPRINT"m"XN" ,"TY+50:LPRINT"n"CE(ID): LPRINT"m"XN+25","TY+50:LPRINT"p"NM$ 895 GOTO 950 900 REM -- A3 paper --
Plotting
9.11
910 XN=450·ID:IF XN>3400 THEN 950 920 LPRINT"m"XN","TY+50:LPRINT"n"CE(ID):LPRINT"m"XN+25","TY+50: LPRINT"p"NM$ 950 LPRINT"h" 960 RETURN 1000 REM === Another copy === 1010 CLS:FC=1 1020 PRINT"Do you want another copy?":Z$=SY:GOSUB 9800:IF ZX>2 THEN 9999 1030 NF=ID:ID=l 1040 ON FR GOSUB 4000,4000,4250:REM # Plot reference lines 1045 GOSUB 1100:REM # Print name of graph 1047 GOSUB 4700:REM # Label axes 1050 FOR ID=1 TO NF 1060 GOSUB 800 1070 NEXT ID 1080 GOTO 1010 1100 REM === Print name of graph === 1110 IF PT=1 THEN LPRINT"m100,"TY+50:LPRINT"P"N$ ELSE LPRINT"M100,"TY+100: LPRINT"P"N$ 1120 RETURN 3500 REM === Convert to root t - root tl _ 3510 IF FC=O THEN INPUT "Enter the total duration of pumping";TD(ID) 3520 FOR 1=1 TO DP 3530 TI(I)=SQR(TD(ID)+TI(I»-SQR(TI(I» 3535 TI(I)=TI(I)·TI(I) 3540 NEXT I 3550 RETURN 3600 REM === Convert to t/t1 === 3610 IF FC=O THEN INPUT "Enter the total duration of pumping";TD(ID) 3620 FOR 1=1 TO DP 3630 TI(I)=(TD(ID)+TI(I»/TI(I) 3640 NEXT I 3650 RETURN 3660 REM === Enter graph name === 3670 INPUT"Enter t he name of the graph. (Max. 10 characters)"iN$ 3675 IF LEN(N$»10 THEN PRINTtlName too long, please re-enter.":GOTO 3670 3680 IF N$='"' THEN N$="No name" 3690 RETURN 3700 REM === Specify graph type 3710 IF CF(ID-1)=2 THEN CF(ID)=2:GOTO 3795:REM # No other type on same sheet 3720 PRINTtlWhich type of plot?" 3730 IF CF(ID-1)=3 OR CF(ID-1)=5 THEN 3780 <1>" 3740 PRINT"Log-linear drawdown 3750 PRINT"Log-lin. t/t1 resid. drawdown <4>" 3760 PRINT"Log-lin. residual drawdown <6>" 3770 Z$="146":GOSUB 9800:IF ZX=1 THEN CF(ID)=1 ELSE IF ZX=2 THEN CF(ID)=4 ELSE CF(ID)=6
9.12 3775 3780 3785 3790 3795 3800 3805 3810 3820 3830 3840 3850 3900 3920 3930 3940 3950 3960 3965 3980 4000 4005 4010 4020 4030 4040 4050 4060 4070 4080 4090 4100 4110 4120 4130 4140 4145 4150 4160 4170 4180 4190 4200
Plotting GOTO 3795 PRINT"Root time <3>" PRINT"Root t minus root t1 <5>" Z$="35":GOSUB 9800:IF ZX=1 THEN CF(ID)=3 ELSE CF(ID)=5 RETURN REM === Specify colour and symbol === PRINT:PRINT:BEEP PRINT"What colour number? (1 to 8)" Z$="12345678":GOSUB 9800:CD(ID)=ZX INPUT"What symbol number? (1 to 15)"jCE(ID) IF CE(ID)<1 OR CE(ID»15 OR INT(CE(ID»<>CE(ID) THEN PRINT"Invalid": GOTO 3830 RETURN REM === Remove zero times for log time scale === FOR 1=1 TO DP IF TI(I)<=O THEN FOR J=I TO DP-1:DD(J)=DD(J+1):TI(J)=TI(J+1): Q(J)=Q(J+1):NEXT J:K=K+1 NEXT I PRINT"A time of <= zero has been detected in data. It has been removed." DP=DP-K GOSUB 8200:REM # Get lowest and highest values RETURN REM === Plot & lable log time ref. lines === LPRINT"j1" Y1=BY:Y2=TY:X1=T1:FT=0 X=LOG(X1)/MT.TS+EG-CL+LOG(1/T1)/MT.TS IF FT=O THEN LPRINT"m"jXj","jY1 ELSE LPRINT"m";Xj",";Y2 IF FT=O THEN LPRINT"d"jX;","jY2 ELSE LPRINT"d"jXj","jY1 IF FT=O THEN FT=1 ELSE FT=O X1=X1+EXP(INT(LOG(X1.1.05)/MT+1).MT)/10 IF X1
Plotting 4210 4220 4230 4240 4250 4260 4270 4280 4285 4290 4292 4295 4300 4305 4310 4315 4320
IF FT=O THEN LPRINT"m"jEG-CLj","jI:LPRINT"d"jEGj","iI IF FT=1 THEN FT=O ELSE FT=1 NEXT I RETURN REM === Plot and lable drawdown ref. lines for log-log --X1=EG-CL:X2=LC*TS+X1:Yl=D1:FT=0 Y=LOG(Y1)/MT*DS+BY+LOG(1/D1)/MT*DS IF FT=O THEN LPRINT"m"X1" ,"Y:LPRINT"d"X2" ,"Y IF FT=1 THEN LPRINT"m"X2","Y:LPRINT"d"X1","Y Y1=Y1+EXP(INT(LOG(Y1*1.05)/MT+1)*MT)/10 IF FT=O THEN FT=1 ELSE FT=O IF Y1.5 THEN LPRINT USING G2jDl*10~I ELSE LPRINT USING G3jDl*10~I 4325 NEXT I 4330 RETURN 4350 REM === Plot and label ref. lines for root t & root t minus root t1 4360 LPRINT"j1" 4370 Y1=BY:Y2=TY:X1=EG-CL:FT=0 4390 FOR 1=0 TO 10 4400 X=X1+CL/10*I 4405 IF FT=O THEN LPRINT"m"X-30","BY-50:LPRINT"p"(I*CL/(TS*10))~2 4410 IF FT=O THEN LPRINT"m"X","Y1 ELSE LPRINT"m"X","Y2 4420 IF FT=O THEN LPRINT"d"X","Y2 ELSE LPRINT"d"X","Yl 4425 IF FT=1 THEN LPRINT"m"X-30","BY-50:LPRINT"p"(I*CL/(TS*10))~2 4430 IF FT=O THEN FT=1 ELSE FT=O 4440 NEXT I 4445 GOSUB 4150:REM # Plot and lable linear drawdown ref. lines 4450 RETURN 4500 REM === Plotting data section, log-log, and log-linear === 4505 LPRINT"j"CD(ID) 4507 IF FR=3 THEN GOSUB 4600:GOTO 4570:REM # Root time, or root t minus root t1 4510 FOR 1=1 TO DP 4520 X=TS*LOG(TI(I)/T1)/MT+EG-CL 4525 IF FR=1 THEN Y=TY-DD(I)*10000/DS ELSE Y=BY+LOG(DD(I)/D1)/MT*DS 4530 IF X<EG-CL OR X>EG THEN 4560 4535 IF Y
9.13
9.14
Plotting
4620 X=TS*SQR(TI(I))+EG-CL 4625 Y=TY-DD(I)*10000/DS 4630 IF X<EG-CL OR X>EG THEN 4660 4635 IF Y3 THEN GOTO 5000 ELSE 5170 5160 IF F1=1 THEN PRINT"Some of the data is outside the defined space." 5170 RETURN 5500 REM === Automatic scaling === 5510 GOSUB 5600:REM # Set paper size, ref. line layout flag 5520 IF FR=2 THEN GOSUB 5700 ELSE GOSUB 6000:REM # drawdown limits & scaling 5530 ON FR GOSUB 6100,6100,6200:REM # Time limits and scaling 5540 RETURN 5600' REM -- Set paper size -5610 IF CF(ID)=2 THEN PRINT"A3 paper":PT=1:CL=3240:EG=3600:TY=2600:BY=100: FR=2:GOTO 5650 5615 IF CF(ID)=3 OR CF(ID)=5 THEN FR=3 ELSE FR=1 5620 PRINT"A3 (x=420mm, y=298mm) or A4 (x=298mm, y=210mm). Press 3 or 4." 5630 Z$="34":GOSUB 9800:PT=ZX
Plotting 5640 IF PT=l THEN CL=3240:EG=3600:TY=2600:BY=100 ELSE CL=2100:EG=2340: TY=2220:BY=970 5650 RETURN 5700 REM --- Drawdown scaling factor, log-log scale --5710 1=9 5720 IF 10"I>DL THEN I=I-l:GOTO 5720 5730 Dl=10 5740 1=-9 5750 IF 10 THEN I=I+l:GOTO 5750 5760 D2=10 5770 IF D2/Dl>1000 THEN Dl=D2/1000 5780 DS=762:TY=BY+LOG(D2/D1)/MT*DS:LD=LOG(D2/Dl)/MT 5790 RETURN 6000 REM --- Drawdown scaling factor, log-lin. --6020I=1:C=.1 6030 IF DG/(VS(I)*C»(TY-BY)/10000 THEN I=I+l:IF 1>4 THEN C=C*10:I=1: GOTO 6030 ELSE GOTO 6030 6040 DS=VS(I)*C 6060 RETURN 6100 REM --- Time scaling factor, log scale --6110 1=9 6120 IF 10 THEN I=I-l:GOTO 6120 6125 T1=10 6130 1=-9 6140 IF 10"I4 AND CF(ID)=2 THEN LC=LC-l:T1=Tl*10:GOTO 6155 6160 IF CF(ID)=l OR CF(ID)=4 OR CF(ID)=6 THEN TS=CL/LC 6165 IF CF(ID)=2 AND T2/T1>10000 THEN Tl=T2/10000 6170 IF CF(ID)=2 THEN TS=762:CL=TS*LC 6180 RETURN 6200 REM --- Scaling factor, root time --6210 REM H Find greatest plotable time 6220I=1:J=1:A=1 6230 IF I*I>TG THEN 6260 6240 IF I<10"J THEN I=I+A ELSE J=J+l:A=A*10:I=I*2 6245 GOTO 6230 6250 REM # I is square root of greatest plotable time 6260 TS=CL/I 6270 RETURN 7250 REM === Display file details --7260 CLS:ZX=O 7270 PRINT"Number of datum sets is "iDP 7290 PRINT SR 7300 FOR 1=1 TO DP 7310 PRINT I,TI(I),:PRINT USING GliDD(I),:PRINT Q(I) 7320 IF INT(I/20)=I/20 THEN GOSUB 7370:PRINT SR AI
AI
AI
AI>TL
AI
9 . 15
9.16
Plotting
7330 IF ZX>2 THEN 7360 7340 NEXT I 7350 GOSUB 7370 7360 RETURN 7370 REM -- Continue or exit -7380 PRINT"Press C to continue, E to eXit":Z$="CcEe":GOSUB 9800 7390 RETURN 7750 REM === Load data from data statements === 7760 TP=1:TW=1:R=.1:I=1 7770 READ TI(I),DD(I):IF TI(I)<>-1 THEN I=I+1:GOTO 7770 7780 DP=I-1:0(1)=0 7790 FOR 1=2 TO DP 7800 IF TI(I)<101 THEN O(I)=173:GOTO 7860 7810 IF TI(I)<201 THEN O(I)=242:GOTO 7860 7820 IF TI(I)<266 THEN O(I)=300:GOTO 7860 7830 IF TI(I)<305 THEN O(I)=343:GOTO 7860 7840 IF TI(I)<376 THEN Q(I)=386:GOTO 7860 7850 0(1)=444 7860 NEXT I 7865 GOSUB 8200:REM # Get lowest and highest values 7870 RETURN 7872 DATA 0,0,1,2.6,3,2.33,4,2.33,5,2.35 7874 DATA 6,2.37,7,2.37,8,2.38,9,2.4,10,2.42 7876 DATA 12,2.46,14,2.47,16,2.48,18,2.48,20,2.48 7878 DATA 22,2.5,24,2.5,26,2.51,28,2.51,30,2.52 7880 DATA 35,2.55,40,2.58,45,2.6,50,2.62,60,2.65 7882 DATA 70,2.68,80,2.7,90,2.72,100,2.75,105,3.95 7884 DATA 110,4.01,120,4.1,130,4.15,140,4.2,150,4.22 7886 DATA 160,4.23,170,4.24,180,4.28,190,4.3,200,4.31 7888 DATA 210,5.4,220,5.5,230,5.54,240,5.6,250,5.66 7890 DATA 265,5.65,270,6.6,280,6.7,290,6.62,304,6.65 7892 DATA 310,7.64,320,7.76,335,7.79,340,7.86,350,7.92 7894 DATA 362,7.97,375,8,380,9.48,390,9.64,402,9.72 7896 DATA 410,9.8,420,9.86,430,9.95,440,10,460,10.08 7898 DATA 470,10.13,490,10.2,510,10.28,525,10.36,545,10.4 7900 DATA 560,10.48,590,10.53,650,10.66,700,10.74,740,10.85 7902 DATA 800,10.92,850,11.04,900,11.13,940,11.25,1000,11.3 7904 DATA 1100,11.4,1200,11.54,1300,11.61,1500,11.82,1600,11.89 7906 DATA 1700,11.94,1800,12.01,1900,12.1 7990 DATA -1,-1,-1 8000 REM === Load Disk File === 80800PEN"I",#1,NM$ 8090INPUT#1,TP,TW,R,DP 8100 FOR 1=1 TO DP:INPUT#1,TI(I),DD(I),O(I):NEXT I 8110 CLOSE 8120 GOSUB 8200:REM # Get lowest and highest values 8180 RETURN
Plotting 8200 8210 8220 8230 8250 8270 8280 8285 8290 9500 9510 9520 9530 9540 9590 9600 9610 9612 9615 9620 9630 9635 9640 9645 9650 9660 9670 9800 9810 9820 9830 9840 9850 9999
9.17
REM === Get lower and upper drawdowns and times of data TL=1E+10:TG=1E-10:DL=1E+10:DG=1E-10 FOR 1=1 TO DP IF TI(I)122 OR (A>90 AND A<97) THEN PRINT: PRINT"First character unacceptable":PRINT:GOTO 9610 IF LEN(NM$)=1 THEN 9670 FOR A1=2 TO LEN(NM$) A=ASC(MID$(NM$,A1,1» IF A<48 OR A>122 OR (A>57 AND A<65) OR (A>90 AND A<97) THEN PRINT:PRINT"No."jA1i" character unacceptable.":PRINT:GOTO 9610 NEXT A1 NM$=NM$+".WTD":RETURN REM -- Await valid key -ZZ$=INKEY$ ZZ$=INKEY$:IF ZZ$="" THEN 9820 FOR ZX=1 TO LEN(Z$):IF MID$(Z$,ZX,1)=ZZ$ THEN RETURN NEXT ZX GOTO 9820 END
Partial boundary
10.1
Chapter 10
This chapter differs from the others in that it deals with an unproven model that is new, as far as I know. 1. HYPOTHESIS A boundary between differing transmissivity zones within an aquifer can be simulated by an image well having a smaller discharge rate than that of a real discharging well. Further, the required rate of the discharge/recharge from the image well is given by a function of the ratio of the two transmissivities, multiplied by the rate of the discharge from the real well. 1.1. Preamble Use has long been made of image wells to simulate the additional drawdown caused by aquifer boundaries. An image well having a discharge rate, Q, equal to a real well is used to simulate a discharge (water-tight) boundary, and an image well with a discharge rate the negative of that of the real well can be used to simulate a recharge boundary (constant head boundary). This model is explained in greater depth in Freeze and Cherry, (1979, pp 330-332); and in Bouwer, (1978, pp 205-206). Figure 10.1 shows a plan view of a portion of an infinite confined aquifer of constant storage coefficient. The aquifer is divided into two sections by a straight line boundary, and the transmissivity on the left of the boundary is not necessarily the same as that on the right. Figure 10.1
dis charge well o,
~ tronsmiss ivity =1 ple20meter
----r
~
image
~ll
0
transmissivity =12
An aquifer with two distinct zones of differing transmissivity.
10.2
Partial boundary
Using the existing image well models, what can be said about the relationship between the boundary characteristics and the type of image well used to simulate it? If the boundary is a discharge boundary, the situation can be simulated as far as drawdown at the piezometer is concerned by an image well of discharge rate equal to the discharge rate of the real well. In other words; 1/ If T2=0 then Qi=Q, where T2 is the transmissivity on the far side of the boundary from the discharge well, Q is the discharge rate of the image well, i and Q is the discharge rate of the real well. In the case of the boundary being a recharge boundary, then Q =-Q, or we could have T2=infinity. ie. In either case, there would be zero arawdown at the boundary. So it could be stated that; 2/ If T2=infinity then Qi=-Q. In the case where the transmissivity is the same on both sides of the boundary (which is itself therefore imaginary), then there is no image well (or there is an image well with zero discharge rate), so; 3/ If T2=T then Qi=O, where T is the transmissivity of the aquifer on the discharge well side of the boundary. It seems likely therefore, that a model could be produced using an image well to simulate a boundary between an aquifer of two or more different transmissivities, using image wells, where; 1/ If T>T2>0 then Q>Q.>O, and ~
2/ If T
(Note that just as in the case of the generally accepted image well models, it must be stressed that this model has no validity at all for calculating or projecting drawdowns on the image well side of the boundary.) 1.2. Difficulties There are two; 1/ Proving that the model is valid. 2/ Quantifying the relationship between T2/T and Q./Q. I have no proof that the model is valid, but some eViaence in favour of
Partial boundary it's validity is also given below.
presented below.
10.3
A set of relative values of T2/T:Q /Q is i
1.3. Evidence in favour of the model A similar model could be used for a situation where an aquifer of high T is bounded on both sides by an aquifer of low T. (A model of this type would be useful for many real hard rock strip aquifers which have relatively high transmissivities while there is leakage from the surrounding country rocks which form an aquifer with lower transmissivity.) Consider a strip aquifer (confined, for simplicity) with width W, and transmissivity T, bordered on both sides by an infinite confined aquifer with transmissivity T2=T/5. The aquifers are in good hydraulic contact. There is a discharging well in the strip aquifer, and a piezometer nearby. See figure 10.2. Figure 10.2
TransmissIvity =T/5
TronsmlSSivity =T/5
A partially bounded strip aquifer. For some short time after the commencement of pumping, before the cone of drawdown has effectively reached either boundary of the strip, the drawdown in the piezometer will be identical to that in an infinite, unbounded aquifer. As soon as the area of influence of the discharging well contacts a boundary, the rate of drawdown in the piezometer (as measured by the slope of the time-drawdown line on a semilogarithmic graph) will increase. The slope will go on increasing for some time because of both the nature of the well function, (while u is greater than 0.01, the straight
10.4
Partial boundary
line part of the function has not yet been reached) and the effect of multiple reflections from the strip boundaries. At some long time however, the area of influence in the outer aquifer will become so great that the effect of the strip (which is now in relation, very narrow) on the drawdown pattern in the piezometer will become negligible. From this time onward, the drawdown pattern in the piezometer will be that which would be expected of a well in a confined aquifer with transmissivity T/5. If, then, the above model of a boundary between two aquifers of differing transmissivities is valid, it should be capable of reproducing this three part drawdown curve. (On semilog scale, a straight line segment corresponding to T, a curving segment due to the multiple reflections of the boundaries, and another straight line corresponding to T/5.) Program SIM5B (a modified version of SIM5, for an aquifer with 2 differing transmissivities) based on this model did produce this form of output. The values used to produce the output of table 10.1 and figure 10.3 were; Q = 300 cubic metres per day, Duration of discharge was 69 days. T = 100 metres squared per day, T2 = 20 metres squared per day, S = 0.001 Distance between discharging well and piezometer = 0.1m, Distance from discharging well to boundary = 50m, Distance from piezometer to boundary = 50m, Width of strip aquifer = 100m.
Analysing this data using DTDHA, the calculated for the specified time segments. Time (minutes) 1 - 10 10 - 100 100 - 1000 1000 - 10 000 10 000 - 100 000
following transmissivities are
Calculated transmissivity 99.4 cubic metres per day per metre 65.5 31.7 21.9 20.2
The first transmissivity might be a little below 100 because of the high value of u at a time of one minute. The last value for transmissivity is probably still a little above 20 because at a time of 100 000 minutes the radius of influence is not sufficiently great to make the width of the strip negligible. Appart from these two minor points, the data shows the expected transition from a Delta s slope corresponding to T = 100 through a smooth curve to a delta s corresponding to T = 20.
Partial boundary
10.5
Table 10.1
No. 1 2
3 4
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Time (days) 0.0007 0.0017 0.0031 0.0050 0.0078 0.0117 0.0173 0.0251 0.0363 0.0520 0.0742 0.1056 0.1501 0.2129 0.3018 0.4275 0.6053 0.8567 1.2123 1.7151 2.4262 3.4319 4.8541 6.8654 9.7099 13·7325 19.4214 27.4668 38.8445 54.9352 69.0000
Drawdown 2·305 2.515 2.659 2.778 2.886 2.993 3.107 3.233 3.374 3.533 3.710 3.908 4.127 4.368 4.631 4.916 5.222 5.546 5.888 6.245 6.614 6.995 7.383 7.777 8.177 8.581 8.987 9.395 9.805 10.216 10.487
Pumps 1
1 1 1 1
1 1
1 1 1
1 1 1 1
1 1 1 1 1 1 1 1
1 1
1 1 1
1 1
1 1
Discharge 3.000E+02 3·000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3·000E+02 3.000E+02 3.000E+02 3.000E+02 3.000E+02 3·000E+02 3·000E+02 3·000E+02 3·000E+02 3.000E+02
From this trial, it seems that program SIM5B is producing the output that would be expected if the model described above is valid. How was the discharge rate for the image well calculated from the transmissivity of the second part of the aquifer? It seems that there is a simple equation relating the ratio between T and T to the ratio between Q and Q for the first reflection. 2 i 1.4. The relationship between the ratios T2:T and Qi:Q On the assumption that an image well of some rate other than that of the discharging well can give results which form a valid model of a two (or more) part aquifer, a program (not given here) was written to quantify the relationship between the above ratios. This program differs from one simulating a fUlly confined strip aquifer in that instead of using a value for 0 =0; 0 started with a value equal to 0, but then it was modified i i for each new image well by multiplication with a constant, TC. For each chosen value for TC, an effective transmissivity outside of the strip could be calculated (using the Delta s slope produced), thus giving a value for T2/T. Equation 10.1 is from Cooper and Jacob, 1946.
10.6
Partial boundary Figure 10.3
-~
....
-
-
JIi
X
-
- - f-.
-
-
-
I
-
--
Ie X
'-
--
JI
_- .
.
•.
_.
..
-
II
-
II I
--
1--1-.
I--- I -
--
..
1-
-
8....
..
.
f- -
-
X
~
I -
I
I
)
ix
~- 1---
JI
1-.
X
-
'.1-
, -
. -.- -
..
-
..
I--~-
-
-
I
-- --
--
-
OJ LL
o
N
U)
CD
en
....o ........
N
.....
Drawdown. RealdJaJ d.
Simulated drawdown in a partially bounded strip aquifer.
Partial boundary
2.3
10.7
Q
T
(10.1) 4 Pi Delta s
where Delta s was measured from the slope calculated for the latter part of the data from the particular simulation concerned.) Since Q./Q=TC, this ~ could be used to relate the two ratios. The resulting values for T2/T are given in column 2 of table 10.2, while the values of Qi/Q are in column 1. Later it was discovered that, to a good degree of agreement, the values of Q /Q on table 10.2 could be calculated from the values of T2/T using the equation;
(10.2)
Values for Q/Q calculated in column 3 of table 10.2.
from the T2/T values of column 2 are given
Table 10.2 1 Q.lQ
2 T2/T
-1 -0.8 -0.7 -0.6 -0.5 -0.4 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1
infinity 8.988 5.658 3.996 2.997 2.330 1 0.8172 0.6659 0.5380 0.4280 0.3332 0.2497 0.1766 0.1113 0
~
This earlier;
3 Q.lQ ~
-1 -0.7998 -0.6996 -0.5997 -0.4996 -0.3994 0 0.1006 0.2006 0.3004 0.4006 0.5002 0.6004 0.6998 0.7997 1
equation is also capable of producing the three relationships given
when T2/T=0 (discharge boundary), then equation 10.2 reduces to;
10.8
Partial boundary
Q.
Q
~
1
*
(10.3)
Q, + 1
when T2/T=1 (no boundary), then 0 Q
( 10.4)
0,
tI
2
and when T2/T=infinity (recharge boundary), then infinity Q
* - ------
(10.5)
- Q,
infinity + 1 For the second and subsequent reflections in a strip aquifer simulation, equation 2 is @odified to;
Q
tI
t
T/T T IT + 1 2
]
~
=
Q
tit
T/T - : ] 3
,
...
(10.6)
T IT + 2
1.5. Using the simulation As a simple example of a problem that might be soluble using this model, suppose we have an infinite confined aquifer with storage coefficient 0.0001 over the whole of it, and in the vicinity of a single discharging well the transmissivity is 100 metres squared per day. Close to the discharge well is a piezometer, and at some greater distance is an approximately straight line contact with a segment of the aquifer having a transmissivity of 30 metres squared per day. The distance from the discharge well to the piezometer is 11m, the distance from the discharge well to the boundary is 35m, (and so the image well is also 35m from the boundary). The piezometer is 67m from the image well. See fig. 10.4. The discharge rate is 1000 cubic metres per day, and the well has been pumped for three full days. Drawdown in the piezometer can be calculated using the Theis equation; (Bouwer, 1978) r u
2
S
=---
(10.7a)
4 Tt Q W(u) s
=--4 Pi T
(10.7b)
Partial boundary where; r is S is T is t is Q is W(u)
10.9
the distance from the point of discharge to the piezometer, the storage coefficient, transmissivity, the duration of the discharge, the discharge rate, is the well function of u.
Figure 10.4
5=0·0001 T=30
discharge well
~~r .
o ~ rezometer
~
--------___..
~r
image
~
5=0·0001 T=100
The value of u for the discharging well is about 0.00001, giving a value for W(u)=10.9, and then the drawdown due to the discharging well is s=8.7m. The value of u for the image well is 0.00037, giving W(u)= 7.34, and Q. is ~ calculated using equation 10.2; (30/100)-1
1000 • - - - - - (30/100)+1
= 538 cubic metres per day. The drawdown due to the image well is therefore 3.1m. (Note that T=100 applies in all occurrences of T in the Theis equation, T=30 is used only in the image well discharge rate equation). The total calculated drawdown at the piezometer is the sum of these two drawdowns, ie. approximately 11.8m.
1.6. Summary This model has practical application, quite probably more so than those confined to full discharge or recharge boundaries, because leaky boundaries are in reality much more common than water tight ones, and non-zero
10.10
Partial boundary
transmissivities likewise are much more common than absolutely water tight formations. While the theory has not been proven by the above exercises, some evidence has been shown in favour of it, and it seems to be intuitively satisfying. 2. DRAWDOWN IN A TWO PART AQUIFER, PROGRAM CONFDDB Note again that the model, and hence all the programs that rely on the model, are valid (if the· model is valid at all) only for piezometers on the same side of the partial boundary as the discharging well. This program is very similar to use to the program CONFBOUN of chapter 2, except that the transmissivity on the far side of the boundary must be specified. In operation it is also very similar to CONFBOUN. The main differences occur in lines 223 and 226, where the coefficient MS is calculated, and then in line 325 where the value for the discharge rate of the image well is calculated as the product of MS and Q. The sum effect of these three steps is to apply equation 10.2 to Q in the calculation of Qi' In program CONFBOUN the type of boundary, either discharge or recharge must be specified, this is not done (as such) in CONFDDB. In fact, if a higher value is given for T2 than for T, the boundary is a recharge boundary. 3. DRAWDOWN IN A SEMI-STRIP AQUIFER, PROGRAM CSTRIPB This program is derived from CONFSTRP of chapter 2. The effective discharge rates of the multiple image wells are calculated using a form of equation 10.6 above. 4. DISCHARGE FROM A SEMI-BOUNDED AQUIFER, PROGRAM SIM3B SIM3B is produced by modifying program SIM3 of chapter 4 in a very similar way to that in which CONFDDB is produced from CONFBOUN. It is probably worth commenting here that according to this model the effective long term transmissivity is equal to the arithmetic mean of T and T2. This can be tested bY producing a data file for a sufficiently long time to allow the log-time drawdown line to settle down to a straight line. 5. DISCHARGE FROM A SEMI-STRIP AQUIFER, PROGRAM SIM5B Derived from SIM5 of chapter 4, as the name suggests. a combination of features of CSTRIPB, and SIM3B.
It is effectively
6. REFERENCES. Bouwer, H., 1978. Groundwater Hydrology. McGraw-Hill Kogakusha Ltd. 80pp. Cooper and Jacob, 1946. A generalised graphical method for evaluating formation constants and summarizing well field history. Trans. Am. Geoph. Union 27: pp. 526-534. Freeze, R.A., and Cherry, J.A., 1979. Groundwater. Prentice-Hall Inc., New Jersey, USA. pp604.
Partial boundary
10.11
7. PROGRAM LISTINGS. Only the lines that are different to those in the corresponding programs of chapters 2 and 4 are listed. 7.1. Drawdown in a part. bounded conf. aq.. program CONFDDB Only the lines that are different to those in CONFBOUN are listed here. REM ••••• CONFDDB.BAS ••••• 2 REM • Last modified 20th. May, 1986 10 REM === Initialization === 20 DEFINT F,I-L:DEFSTR G,S 40 CLS 50 PRINT" Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a confined aquifer." 80 PRINT"One discharge/recharge boundary is present." 90 PRINT" Loading variables, please wait." 223 MX=T2/T 226 MS=-(MX-1)/(MX+1):REM # Discharge rate of image well 325 Q=Q'MS 410 DD=DD+DE 7070 INPUT" First transmissivitY";T 7075 INPUT"Second transmissivitY"jT2 Omit lines 7170 to 7190 of CONFBOUN. 7285 IF F1=1 THEN PRINT"Discharge rate of image well is ";Q 7.2. Drawdown in a part. confined strip aquifer, program CSTRIPB Similarly to the listing above, only the parts of this program that differ to CONFSTRP are given here. 1 REM ••••• CSTRIPB.BAS ••••• 2 REM # Last modified 20th. May, 1986 50 PRINT"
Calculation of drawdown in a piezometer at a given distance" 60 PRINT"from a discharging well in a confined strip aquifer with" 70 PRINT"significant transmissivity outside of strip." 223 MX=T2/T 226 MS=-(MX-1)/(MX+1):REM # Discharge rate of image well
10.12 Partial boundary 3385 Q=Q'MS 7070 INPUT" First transmissivitY"jT 7075 INPUT"Second transmissivitY"jT2 7285 IF F1=1 THEN PRINT"Discharge rate of image well is "jQ 7.3.
Discharge from a part. bounded aquifer. program SIM3B Only the parts of this program that differ from SIM3 are listed.
1 REM ••••• SIM3B.BAS ••••• 2 REM • Last modified 20th. May, 1986 50 PRINT" Simulation of a multi-stage discharge test in a confined" 80 PRINT"aquifer. One discharge/recharge boundary is present." 85 PRINT"There is significant transmissivity beyond the boundary." 223 MX=T2/T 226 MS=-(MX-1)/(MX+1) 590 R5=R:Q5=Q:R=R4:REM # Save R, Q, send R4 to subroutine 620 Q=Q'MS:GOSUB 2500:GOSUB 3030:REM # Solve for W(u), calc. dd. 630 R=R5:Q=Q5:REM # Restore R 7050 INPUT" First transmissivitY"jT 7055 INPUT"Second transmissivitY"jT2 Delete lines 7170 to 7190.
7.4. Discharge from a conf. semistrip aquifer, program SIM5B Only those lines that differ from SIM5 are given. 1 REM ••••• SIM5B.BAS ••••• 2 REM' Last modified 20th. May, 1986 50 PRINT" Simulation of a mUlti-stage discharge test in a confined" 60 PRINT"strip aquifer with significant transmissivity outside of strip." 223 MX=T2/T 226 MS=-(MX-1)/(MX+1) 590 R5=R:Q5=Q:REM # Save R & Q 600 GOSUB 3340:REM # Distance of image well, and reduce Q
Partial boundary 680 IF (ABS(DD)
10.13
Basic
A.1
Appendix A
This appendix details some differences between various computers, and especially between various implementations of the Basic language. VARIATIONS IN THE BASIC LANGUAGE. The Basic language as implemented on most modern computers is fairly well standardised. These programs are written using Microsoft Basic, which is as close to being a standard as there seems to be. (Never the less, there are variations even within different versions of Microsoft Basic.) Spaces between key words Most versions of Basic expect to find a space between a key word and a variable (or a numeric constant, or another key word) following or coming before it, other versions treat these spaces as optional. ego This line of code would be acceptable to most computers; FOR 1=1 TO 7:PRINT I,S(I):NEXT I This line of code would be acceptable to some; FORI=1T07:PRINTI,S(I):NEXTI Note that spaces are not required within functions, ego A=INT(Z/3.2)*LOG(X+1) is quite legal syntax. AlSO, most, if not all, computers seem to accept a quote immediately following a key word, where appropriate. ego PRINT"This statement" and OPEN"O" seem to be generally acceptable. Optional Semicolons Semicolons are used as diViders in a similar way to spaces, and also are often optional. ego something like; PRINT"I =";1;", A =";A would be demanded by some machines, while; PRINT"I ="1", A ="A would be acceptable, and produce identical results with others.
A.2
Basic
Clear the screen The key word CLS is used in most Basics as the instruction to clear the screen. In some others, the key word HOME is used instead. Exponentiation The TRS80 Models I and III computers use the left square bracket [ as the exponentiation symbol, while most computers use ~ instead. (The programs in this book were originally written on a TRS80 Model I compatible, and then converted to run on an IBM PC compatible.) The case of alphabetical characters So far as I know, all computers will accept key words, variable names, and "built in" functions to be typed in either lower or upper case, and then will, if necessary, convert them to upper case automatically. ego if the program line; 100 if i=1 then goto 200 else a=log(abs(r)) is typed in, it will be accepted, and converted to; 100 IF I=1 THEN GOTO 200 ELSE A=LOG(ABS(R) However, this does not apply to file names on some computers. ego The file name "testfile.bas" Will, in some cases, be treated as quite distinct from the file name "TESTFILE.BAS". The key word ELSE Some simpler computers do not recognise the key word ELSE. In this case modifications to the code in this book will need to be made as in the example below. A line such as; 100 IF A>B THEN C=1 ELSE C=O will have to be replaced by something like; 100 IF A>B THEN C=1 102 IF A(=B THEN C=O
Basic
A.3
DIFFERENCES BETWEEN COMPUTERS OUTSIDE OF THE BASIC LANGUAGE The Enter key All computers have one key set aside to indicate to the computer that the user has finished the current input operation, and that he wants the computer to act on the information that he has given it. In various computers that I have worked with, I have seen this key labelled, RETURN, NEW LINE, ENTER, and END LINE, as well as with a bent arrow. It's fortunate that all the other keys on the computer keyboard do not have as many alternative names.
Speed and accuracy
B.l
Appendix B
Practices programs.
adopted
to
improve
speed
and
accuracy
of
Basic language
1. COMPUTER ERROR Before dealing with improving accuracy it will be useful to look at some of the sources of computer error. Computer errors are usually in software (programs in RAM). Most errors are made by the programmer and are errors of logic. These errors can be minimised by careful, well organised, programming; and by thorough checking of the finished work. It is usually not possible to be quite sure that a program is totally free of errors of logic. Many programs have failed when the data fed in was unforeseen by the writer. Thankfully, most such errors lead either to the computer displaying an error message and termination of the program; or to some obviously false result. The next most common cause of error is probably the accumulated errors due to the limitations of the programming language being used. People use decimal numbers and computers use binary, and most decimal fractions can't be exactly represented in binary. For example, the number 0.1 (base 10) is equal to the binary number 0.000110011... This can lead to truncation errors as microcomputers normally represent the 'mantissa' by 24 binary digits. Other truncation errors can result from arithmetical operations. A particularly bad example of this can be the result of addition or subtraction. The accuracy represented by 24 binary digits (BITS) is approximately the same as that represented by 7 decimal digits (2 to the power 24 is equal to 16 777 216 which is close to 10 to the power 7.22), so the usual accuracy of a microcomputer is about seven significant figures until errors start to accumulate. An example of truncation error is given in the short program listed below. Type it into Basic, and run it on your computer. 10 A=100 000 20 B=0.123456789 30 C=A+B 40 D=C-A 50 PRINT D Clearly, the correct answer is 0.123456789, what does your computer give? The problem arises like this In line ten the variable A is given the value 100 000. This will probably be handled with complete accuracy. In line 20 the variable B will be given an approximation of 0.123456789, this will be accurate to only about 7 significant (decimal) figures. Line 30 gives C the calculated sum of the stored values of A and B, truncated to the normal accuracy of the particular computer. So at this stage we have something like;
B.2
Speed and accuracy
A = 100 000 B = 0.1234567 (truncated) C = 100 000.1 (again truncated) Now in line 40 A is subtracted from C to give Di 100 000.1 -100 000 D = 0.1 (A very significant error.) Some examples of the value given for D by various computers. For the Dick Smith System 80 (a compatible of the TRS 80 Model 1), D=0.125; for the Sanyo MBC 1000 (a CP/M machine using binary coded decimal arithmetic), D=Oj for an IBM PC compatible running GWBasic, D=0.125. In most cases this type of error will not cause any great problems, but in some cases it can cause large errors in the results. (Some microcomputers use a hybrid form of number called 'binary coded decimal' which, as usually implemented, gives only six significant figuresj see below and appendix D.) 2. IMPROVING SPEED OF EXECUTION Basic is an interpreted language. ie. Each program statement is converted from the intelligible (to humans) written code to machine language (intelligible to computers) as it is executed, and therefore if a statement is to be executed 50 times in the running of a program, it will be converted 50 times. It is up to the programmer to so arrange his program as to reduce the amount of interpretation to a minimum and to make the interpretation process as quick as possible. 2.1. Handling of numbers within a microcomputer A number is used in a computer in several different forms. The first form is a 'numeric constant'. For example, 1, 9.8765, and 1.23456E-4 are all numeric constants. When, during the execution of a program, a numeric constant is encountered, it will be converted (unless otherwise specified by the programmer) into what is called a single precision form. The 'standard' single precision number is stored in a microcomputer as a one byte exponential part, and a three byte 'mantissa'i both, of course, being in binary. A few micros represent a decimal number in 'binary coded decimal' (BCD) form, where four bits are used to represent each decimal numeral. This has the advantage of being able to handle larger and smaller (in the absolute sense) numbers, at the cost of a loss of precision. A pure binary representation inA single 1 precision has approximately 7.2 significant (decimal) figures, and ranges from about 10 to the power 38 to 10 to the power -38, while decimal coded binary has exactly 6 significant digits, but ranges from about 10 to the power 62 down to 10 to the power -65. The loss of precision is due to the fact that four bits can represent numbers from 0 to 15, but are used in BCD to represent numbers from 0 to only 9, thus the
Speed and accuracy
B.3
binary four digit numbers 1010, 1011, 1100, 1101, and 1111 are never used in BCD. It is highly desirable then, to use numbers in such a way that they are converted into binary once only. It has been adopted as a standard in this work to read a number (numeric constant) into a variable before using it in any functions. 2.2. The exponentiation operation The Basic language has the ability to rase a number to a specified power. This is a slow operation, taking something like thirty times as long as a multiplication operation, it may also be slightly less accurate. Where possible, it is well worth while to replace exponentiation with multiplication. If the exponentiation is a simple square, the replacement is very simple, but with a little thought it can be efficiently done in many other cases. Some functions described in this book use a number raised to various (integral) powers in a number of terms. For example the program WELLFUNC in chapter 1 uses the number U raised to the powers 2, 3, 4, and 5 in one function. This is done by first defining U2 as equal to U.U, and U3 as U2.U, then using U, U2, and U3 to produce the required powers with a maximum of one more multiplication operation. 2.3. Double precision Most micros have the ability to represent a number in double precision format. Instead of the single precision 4 bytes to represent a number, this uses 8 bytes; a 7 byte mantissa, and a one byte exponent. The precision is about 16.9 significant figures. There are disadvantages and limitations. Generally only the basic arithmetical operations function at double precision. Operations such as Sin, Cos, natural exponent, and natural log will put a value into a double precision variable, but only the first six or seven figures will have any significance. Speed also is considerably reduced. It is worth noting that the method described above for exponentiation is workable at double precision, at the cost of loss of speed. There are double precision subroutines available for all the standard microcomputer operations, but the accuracy of primary groundwater data seldom justifies their use.
Style and technique
C.1
Appendix C
Some comments on programming style and technique have been made in various parts of this book. This appendix is an effort to summarize those systems and methods which help to make a program both efficient and clear. This depends largely on ones organisation (or lack of it), state of mind, and approach, to programming. The comments in this appendix apply mainly to programs of a problem solving nature; a program dealing with data handling will have a rather different structure. Mathematical groundwater procedures, analytical, and numerical models may all use the type of structure described here. 1. PROGRAM STRUCTURE AND LAYOUT 1.1. Efficiency It is possible for a program to be efficient, and yet be chaotic; and then there are different forms of efficiency. A program may be called efficient if it comes to it's solution in the shortest possible time, or if it occupies the smallest possible amount of computer memory. While both of these things can be very important, efficiency, in the fullest sense is more than that. 1.2. Clarity Clarity in a program may not be a prime requirement if a program is small, is to remain small, and it is not necessary that the operation of the program is to be understood after the time of it's writing; but how can any programmer say when these conditions are to be met. In any but a very small program clarity is a great aid in writing; the programmer can follow the logic of his or her program if it's parts are well defined in both function and location within the Whole, and the parts themselves are well laid out. If the program, or any part of it, is to be used or modified (and what program has been written so perfectly that no modification will ever be desirable?) by either the original writer or anyone else, then maximum clarity is essential. Clarity in programming definitely becomes easier with experience, because a writer develops a state-of-mind compatible with the job, and usually, even before the first rough draft begins, there is some picture of the final form of the program in the programmers mind. Clarity in a program is facilitated by good program structure. There are two essentials of program structure. The first is that each part of the program must have a well defined function, and must carry out that function fUlly. The second is that each part must be well defined in it's location, and must be easily locatable within the whole program. While different programmers no doubt have different ideas of the best form of program structure, some suggestions on program structure may be of use. As a point of overall design philosophy, the program execution should start at the beginning and, in general, move toward higher line numbers. The
C.2
Style and technique
end statement should be last. Subroutines, especially those that are to do with housekeeping jobs, should be kept out of the way toward the higher line numbers. As an example, a program might be composed as follows. 1.3. when.
A sugested, generalised, layout 1/ A few comments showing what the program is, who wrote it, and These all will be in REMark statements.
(1) The program name, on line 1. This allows a user to check that he has the correct program, both to use for his purposes, and to avoid inadvertently overwriting some other program when and if he saves it to disk. (2) The date of the last modification on line 2 permits a quick check to be made that the present program is the latest version. (3) The writers name and address on line 3 for the sake of credit, as well as giving users a contact if queries arise. (4) Perhaps a very short description of the programs function could be put on lines 4 to 9. 2/ An initialization section (1) Definition of variables Define all variables that are to be of the one type throughout the program (eg. integer, string). Some poorer computers do not have this very useful facility. It is standard practice to use the 'I' as the primary counter variable for loops, with 'J', 'K' and 'L' used in that order as necessary. Arithmetic operations involving integers are quicker than those involving non integers, and since a counter has no need of a fractional part and very rarely goes above 32 000 (approximately the maximum for an integer variable) variables starting with these letters may be defined as integers for greater speed. It is often useful to record such things as yes/no decisions and on/off status of various forms of output. A variable used for that type of job is called a flag, and it is logical that it's naDle should start with the letter 'F'. Again there is no need for fractional values (in fact one bit is sufficient, rather than the two bytes of an integer variable), so 'F' can usefUlly be defined as an integer, and flags named F1, F2, etc. can be used. String variables have limited use in groundwater applications, but it can be worthwhile to have a string of characters in a variable for use in video or printer output, and to define R="YyNn" to be used for single key yes/no responses. The letters P to S can be defined as strings for these jobs. If the letter F is used for flags then it is probably better to not use it also for numerical output formats. Since several of these will probably be used in any reasonably large program, it can be of use to define 0 as a string variable also. Various numerical formats will then be named 01, 02, etc.
Style and technique
C.3
(2) Preliminary print statement instruction (CLS) followed by a printed message giving some information about the program can be useful here to show the operator that something is happening. Dimensioning arrays, and loading variables can take a fair amount of time, and it can be disconcerting to stare at a blank screen for ten or twenty seconds when one is expecting some action from the computer.
A clear screen
(3) Dimension all arrays At least some computers object to the redimensioning of an array variable that has previously been dimensioned. If all arrays are dimensioned shortly after the variable definition, this problem cannot arise. (Dimensioning can't be done before definition, because the amount of memory reserved during the dimensioning is dependent upon the variable type). (4) Load numerical constants into variables This is conveniently done from this point, and best done by a subroutine call so that the beginning of the program is not cluttered up by a lot of data.
3/ Program control Here is the part of the program which orchestrates the execution of the main functions of the program. This part should not do the actual work of solVing equations, or handling input or output, but rather should call subroutines as required. It is especially important that this section be easy to follow. A good practice is to follow all subroutine calls with a REMark shOWing What it is that the subroutine call does. This can be on the same line as the call. Execution of the various subroutines may be controlled from here by the reference to the values of flags, most of which will have been set in the input section. For each optional subroutine call there will be a flag; if the flag has the value one, then the call will be made, otherwise it will be skipped. In some programs it may be desirable to have program execution pass several times through this section (and it's subordinate sUbroutines), giving the operator opportunity to change the input before each pass. In other programs it may be necessary for execution to cycle through at least a part of this section several times, until an acceptable result is obtained, or until it it apparent that an acceptable result will not be obtained. When the program has served it's purpose, execution is passed from here to the end section (see below). From this point in the program, subroutines are used, so there is no longer such a plain need for ordering of the parts. Standard practice seems to be to put the more frequently used subroutines closer to the beginning of the program than those used less.
C.4
Style and technique
4/ The problem solving part of the program This is the part that has the job of coming up with the answer. All other parts exist to serve this. By keeping the work of this section strictly to the solution of the main equations, it can be kept reasonably short and clear, in most cases. It is quite normal, and probably desirable, that this part be fairly small compared to the rest. 5/ SUbroutines to solve subordinate functions etc The solution of the Well function, the Bessel function, or interpolation of tables, and integration etc. can be placed here.
One
6/ Keyboard input section or several subroutines to request and receive information from the
user. 7/ Disk file input and output sections Many groundwater programs of a problem solving nature will not require these, they will be used mainly when large volumes of data are handled, as in ground water models, or data base managers. There may be a need for several input and output subroutines. 8/ A section to load the values into variables By making this a subroutine to be called from the initialization section, one ensures that it is done only once. Only those variables that have a constant value need be loaded here. Functions may also be defined here. This can be a great aid in clarifying the problem solving part of the program. 9/ Minor subroutines All subroutines connected placed here.
with
program flow and other odd jobs can be
10/ The end It is useful to have a single point at which normal program termination occurs. If necessary tidying up jobs such as resetting the printer can be done before the end statement. 1.4. Functions There are several ways of handling these. The simplest can be solved by programming them in full, with any required constants, right where the function value is needed; so long as they will not be too frequently used. As a general rule it's better to use variables in functions, rather than constants. Program clarity (and perhaps, brevity) may be improved by defining one or several functions in a part of the program set aside for the purpose, then referring to the function definition in the main body of the program.
Style and technique
C.5
If a function is too large or complex to define in a single line, then a subroutine can be used. Here a value will be placed in a variable (or a set of values will be placed in an array), the subroutine will be called, and the result will be placed in another variable or array. 2. LOCATIONS OF SUBROUTINES IN THIS BOOK As far as possible, the programs in this book have been written so as to have particular groups of line numbers devoted to particular jobs. A table showing the line numbers used for various operations is given below. In a number of cases there has been considerable overlap between these line numbers, and it has not always been found desirable to hold strictly with the plan below; ego It is sometimes useful to have short messages printed from the place where the need for them arises rather than always having video output reserved for lines 7250 to 7499. Line No's. 1 2
3
10 -
199
200 - 1499
1500 - 1699 1800 - 1899 2000 - 2099 2100 - 2170 2500 - 2550 2600 - 2640 2700 - 2800 3000 - 3190 3000 - 3020 3030 - 3050 3100 - 3280 33CO - 3330
Operation Program name. Date of last update. Name of author. variable types, Initialization. Definition of dimensioning of arrays. Program control. This is the part of the program that is unique to the particular application. This section does the delegation required to get the job done. Some form of this is in all the programs. Pick out, and optionally delete, spurious data. Program DTDHA only. Search for inflection points in the drawdown data. In program DTDHA only. Alter discharge test descriptive data. In program DTDHA only. Convert t to t/t1 for residual drawdown. In program DTDHA only. Evaluation of the well function. A standardised subroutine used in many programs. Stirling's approximation to the factorial function. Program FACT only. Successive bisection. Program CB2 only. Convert residual drawdown to recovery. In program DTDHA only. Calculation of u given R, CS, T, and TI. For solution of the well function, in many programs. Calculation of drawdown given Q, W, and T. In many programs. The Gausian Error Function. Program COMPERF only. Calculation of the distance from a piezometer to an image well. In programs dealing with a single boundary.
c.6 3300 - 3390 w~ll.
3400 3600 3600 4000
-
3540 3999 3650 4150
Style and technique Calculation of the distance from a piezometer to an image In programs dealing with strip aquifers. Newtons Method, with derivative at a point. Modifying data files. In program DTDHA only. Convert time to t/t1. Program DTPLOT only. Calculation of average discharge rate. In program DTDHA
only. 4200 - 4360 4400 - 4499 4800 - 4999 5000 - 5180 5000 - 5180 5200 - 5330 5400 - 5520 5400 - 5510 5530 - 5630 5650 - 5730 5740 - 5770 6000 - 6260
6500 - 7160 7000 - 7249 7250 - 7499 7500 - 7749
7750 - 7999
8000 - 8120 8250 - 8310 8500 - 8590
Linear regression of drawdown vs. log (base e) time. In program DTDHA only. Evaluation of the well equation by the s/Q vs. Q method. In program DTDHA only. Convert step test data to simulate full recovery between stages. Rorabaugh's procedure. In program DTDHA only. Secondary control section for the Leaky Well Function. In all programs solving that function. Subroutine Leaky 01. Used in the solution of the Leaky Well Function. The Bessel Function of the second kind. Used in BESSEL, and all programs solving the Leaky Well Function. Linear regression of s/Q vs. Q in program DTDHA only. The Bessel Function of the first kind. Used in BESSEL, and all programs solving the Leaky Well Function. Subroutine Leaky 02. Used in the solution of the Leaky Well Function. Subroutine Leaky #3. Used in the solution of the Leaky Well Function. Lagrangian interpolation. Used in programs LAGRANGE, INTERP1, and INTERP2. This subroutine has been altered slightly to suit the individual applications. Evaluation of the Well Equation by Sternberg's method. Keyboard entry section. This section is varied to suit the application. Video output section. This section is also varied to suit the application. Printer output. Minor printer output may be inserted in the program as required, but it is useful to have the main printer output section in one place. Input from data statements. All READ - DATA structures are located between these line numbers. This subroutine is usually called during the program initialization. Disk input. Data is read from a disk file, and then, in some cases, displayed if required. Output of data to a disk file. Loading constants, and defining functions. This section is similar to 7750 above, but here individual variables rather than vectors and matrices are given values.
Style and technique
8600 - 8999 9000 - 9020 9030 - 9050 9060 - 9080 9100 - 9150 9600 - 9670 9800 - 9840
C.7
Loading constants for the solution of the Well Equation and the Leaky Well Equation. A message for invalid input. A message for the case when the value of u is too great to allow calculation of the Well Function of u. A message indicating that the well locations as entered are not geometrically possible. Entry of the numbers of the first and last records to be dealt with in the following operation. Entry, and checking, of the data file name. The single key input subroutine.
Glossary
D.1
Appendix D
It is impossible to write a book on computer programs without resorting to some use of jargon. I have tried to keep it to a minimum. Where a word has several meanings, the glossary gives the meaning that is used in relation to computers and computer programming. Alphanumeric Any character that is either a numeral or a letter of the alphabet, upper or lower case. Array A group of numbers of unspecified dimension. (Strictly speaking, an array may also consist of 'characters'.) A single dimensioned array is alternatively called a vector, a two dimensioned array may be called a matrix. An array may have more than two dimensions, but arrays of greater than three dimensions seem to be very rarely used. "American Standard Code for Information Interchange". This is ASCII almost universally used for the representation of alphanumeric and other characters in microcomputer memories. Binary A numbering system based on the number 2; as compared to our more familiar numbering system based on 10. (There is nothing special about the number 10, we probably have it as a basis for our numbering system only because we happen to have 10 fingers; 12 would be a better number to use.) Binary Coded Decimal. A method of representing decimal numbers in BCD binary, using one nibble to represent one decimal digit. It has the advantage that a decimal number can be represented exactly, but at the cost of some loss in precision. (A nibble can be used to represent any number from 0 to 15; so if it is used only to represent a numeral from 0 to 9 there is some loss of efficiency.) BCD can also be used as an abbreviation for Device Control Block. An abbreviation of Binary Digit. Bit Relating to the values 'true' and 'false'. Computers assign a Boolean value of zero to a false statement, and non zero (usually -1, sometimes 1) to a true statement. ego If the statement X=(2=1+1) appeared in a program, most computers would give the variable X the value -1, 'true'. To boot up a device is to cause that device to go through it's Boot programmed initialization sequence. ego A computer needs to read at least a part of it's operating system program into RAM when it is first turned on. It is said to "pull itself up by it's own boot straps". Alphanumerical characters are usually Byte A group of eight bits. represented in a computers memory by one byte of code. Character Any mark or special symbol that has been given a value in the code used by a particular computer (almost certainly ASCII code in the case of microcomputers). Any of the following;
D.2
Glossary
A numeral. A letter of the alphabet. A punctuation mark. An arithmetic operator. ego +, -, *. A special symbol. ego n, $, @, etc. Unprintable codes that have special meaning to computers, printers, VDU's etc. An example of such a code is ASCII character No. 27, which is used to prepare a printer to receive a special instruction. DIP is an abbreviation of Dual In-line Package. A DIP switch is DIP set to fix the status of a device on boot-up. ego A DIP switch on a printer may be set to cause the default character spacing at 2.54mm. Note that changing the setting of a DIP switch after the device is turned on will probably have no effect until that device is turned off and back on. Double precision A number held in a computers memory to approximately 16 decimal digits of precision. Exponentiation The multiplication of a number by itself a stated number of times. Usually symbolized in Basic by ~ ego 4~3 means 4 cubed. Firmware The permanent programs and data stored in ROM. Hard copy. A copy on paper of computer output. Hardware Computers, disks, silicon chips, etc. Generally things that you can touch. Hexadecimal A numbering system based on the number 16. It is used in computer programming because four binary digits can be represented by one hex digit. Initialization The early preparatory stage of a program, where arrays are defined, values are given to permanent variables, etc. Iteration A process that is repeated until a specified condition is met. Input Any data entered into a computer, by whatever means. Mantissa In a computers memory a number is usually represented in two parts; an exponential part, and a part to be raised to the power represented by the exponential part. The latter is called the mantissa. Matrix A two dime?sional array of numbers. The matrix of computing is very similar to the matrix of mathematics. Memory Primary. The solid state memory in the computer. Memory in RAM or ROM. Memory Secondary. Memory on magnetic disks, diskettes, tape, etc. The cost per byte of secondary memory is usually lower than that of primary memory, but the time taken for the computer to access it is greater. Secondary memory is not lost when the power is turned off. Numerical constant. A number; such as 1, or 563, or 23.45E+13. To distinguish it from a numerical variable represented by a 'variable name'.
Glossary Output
D.3
Any data produced by a computer and made available to either the user of the computer, or to some outside device, such as a telecommunications link, or a memory storage unit. Pointer A variable that is used to keep track of a particular value in an array. The variable can be thought of as 'pointing at' the element of interest. Portable code. Computer data in a form that can be used by a variety of computers. ASCII code is an example. RAM Random Access Memory. This is the memory, in the silicon chips in your computer, that is used for transient storage of programs and data. The moment the power is turned off, this memory is lost. Record All the data to be saved on, or read off, a disk file as one unit of the whole. ego In this book a record consists of a set of one time, one 'drawdown', and one discharge rate. ROM Read Only Memory. This is also on silicon chips, but it retains it's contents even when the power is off. (It is just as much randomly accessible as RAM.) Single prec~s~on A number held in a computers memory to approximately 6 decimal digits of precision. Software Programs, data, etc. Generally, things that you cannot touch; contrast with hardware. Terminate To end the execution of a program, and return to the Basic Ready state. Variable Similarly to algebra, in computer programs numbers are represented by letters. Programming goes a little further than algebra, and numbers or strings of characters can be represented by names made up of one or more letters followed by one or more numerals. The number represented by such a name may be changed at will, and so is called a variable. VDU Video Display Unit. Vector A single dimensioned group of numbers. A row or column matrix.
Relationships
E.I
Appendix E
Relationships between programs I. DATA FLOW BETWEEN PROGRAMS SIMI
Coefficients of the Well Equation and di schar-ge rates
SIM2 SIM3 SIM4 SIM5 Various results of analyses
SIM6 SH13B SIM5B
Coeff ic ients of the Well Equation
~~------": - - - - - - - -
E
KEY
E.2
Relationships 2.
MINOR PROGRAMS USED AS PARTS OF MAJOR PROGRAMS
1\
--------
.-:.--------
~ ~ ~
KEY
Program PROGI is used as a component of program PROG2.