Maths doesn’t really change, at least the stuff we need for the Applied Environ- mental Course, at the University of Edinburgh. The following notes were prepared during my early postgraduate days for Masters students en- tering hydrogeology, with a desire to refresh their knowledge, catch up where necessary and fill in the blanks. Particularly this course has proved a constant source of reliable rapid relevant look up and training for me. With the permis- sion of the authors, Professor Rudolf Liedl and Professor Peter Dietrich, we can provide the same course material to yourselves to help you get up to speed where you need to. Enjoy. Professor Chris McDermott, Program Director, Applied Environmental Hydrogeology, University of Edinburgh 17.06.2021

Rudolf Liedl Peter Dietrich

Mathematical Methods

Lecture Notes

4th ed., October 2004

Liedl / Dietrich Mathematical Methods Table of Contents List of Figures ...... 4 List of Tables ...... 5

1 Introduction ...... 8

2 Statistics ...... 9 2.1 Descriptive Statistics of One Property ...... 9 2.1.1 Description Based on a Sorted Data Set ...... 9 2.1.2 Means, Variances and Deviations ...... 10 2.1.3 Frequency Distributions ...... 11 2.1.4 Comparing Frequency Distributions ...... 13 2.2 Descriptive Statistics of Several Properties ...... 14 2.2.1 Pictorial Representations ...... 14 2.2.2 Statistical Measures ...... 15 2.3 Regression Analysis ...... 15

3 Differentiation ...... 17 3.1 Definitions ...... 17 3.2 Rules of Differentiation ...... 19 3.3 Higher-order ...... 20 3.4 Taylor Series ...... 21

4 Integration ...... 24 4.1 Definitions ...... 24 4.2 Rules of Integration ...... 25 4.3 Improper Integrals ...... 28 4.4 Applications ...... 31

5 Ordinary Differential Equations ...... 36 5.1 Definitions and Geometrical Interpretation ...... 36 5.2 Variation of Constants ...... 38 5.3 Separation of Variables ...... 40 5.4 Deriving and Solving an ODE Model for Contaminant Transport in Soil ...... 42 5.5 Modelling 1D Groundwater Flow in a Heterogeneous Aquifer ...... 47

6 Vectors and Geometry ...... 52 6.1 Scalars and Vectors ...... 52 6.1.1 Vector Function of a Scalar Variable ...... 53 6.1.2 Comparison of Vectors ...... 53 6.2 Basic Laws of Vector Calculus ...... 53 6.2.1 Addition and Subtraction ...... 53 6.2.2 Multiplication of a Vector by a Scalar ...... 54 6.2.3 Linear Combination of Vectors and Decomposition ...... 54 6.3 Multiplication of Vectors ...... 55 6.3.1 Scalar Product (Dot Product) ...... 55 6.3.2 Vector Product (Cross Product) ...... 56 6.3.3 Multiple Products of Vectors ...... 57 6.4 Applications of Vectors in Geometry ...... 58 6.4.1 Applications of Vectors for Geometrical Calculations ...... 58 6.4.2 Equations of a Straight Line ...... 59 6.4.3 Equations of a Plane ...... 62

2

Liedl / Dietrich Mathematical Methods

7 Matrices and Determinants ...... 64 7.1 Definition of a Matrix ...... 64 7.2 Matrix Algebra ...... 65 7.3 Determinants ...... 66 7.3.1 Calculation for 2x2- and 3x3-Matrices ...... 67 7.3.2 Calculation Using Cofactors ...... 67 7.3.3 Calculation Rules for Determinants ...... 68 7.3.4 Use of Determinants in Vector Algebra and Geometry ...... 68 7.4 Special Types of Matrices ...... 69

8 Solving Linear Equation Systems ...... 71 8.1 Definition of Linear Equation Systems ...... 71 8.2 Existence of Solutions ...... 72 8.3 Use of Matrix Calculus ...... 72 8.3.1 With the Inverse ...... 72 8.3.2 Cramer's Rule ...... 73 8.3.3 With Transformation Matrices ...... 74 8.4 Gaussian Algorithm ...... 75 8.5 Homogeneous and Inhomogeneous Systems ...... 77

9 Coordinate Transformations ...... 80 9.1 Definition and Types of Coordinate Systems ...... 80 9.2 Polar and Cylindrical Coordinates ...... 80 9.3 Spherical Coordinates ...... 81 9.4 Transformation of Parallel Coordinate Systems ...... 82 9.4.1 2D Transformations ...... 82 9.4.2 Homogeneous Coordinates and Matrix Representation of 2DTransformations ...... 83 9.4.3 Homogeneous Coordinates and Matrix Representation of 3D Transformations ...... 84 9.4.4 Composition of Transformations ...... 85 9.4.5 Inverse Transformation ...... 87 9.4.6 Transformation as a Change in Coordinate System ...... 87

10 Solution of Non-linear Equation Systems ...... 89 10.1 Determination of Initial Approximate Values ...... 89 10.1.1 Graphical Method ...... 89 10.1.2 Algebraic Method ...... 90 10.2 Methods of Nest of Interval ...... 90 10.3 Iterative Methods ...... 91 10.3.1 General Behaviour of Iteration ...... 91 10.3.2 Newton Method ...... 92 10.3.3 Solving by Separation into Two Functions ...... 93

11 Partial Derivatives ...... 94

12 Fields and Differential Operators ...... 96 12.1 Definitions ...... 96 12.2 Scalar Fields ...... 97 12.3 Vector Fields ...... 100 12.4 Differential Operators for Cartesian Coordinates ...... 106

3

Liedl / Dietrich Mathematical Methods

13 Partial Differential Equations ...... 109 13.1 Definitions and Classification ...... 109 13.2 Formulation of Mathematical Models ...... 110 13.3 A PDE Model for Groundwater Abstraction ...... 113 13.4 Solution of a PDE via ...... 116

14 Inverse Problems ...... 120 14.1 General Conceptions ...... 120 14.2 Ill-Posedness of an Inverse Problem ...... 121 14.2.1 Existence ...... 121 14.2.2 Uniqueness ...... 122 14.2.3 Stability ...... 123 14.3 Solution Methods ...... 124 14.3.1 Trial and Error Method ...... 124 14.3.2 Direct Solving ...... 124 14.3.3 Indirect Solving ...... 125

15 References ...... 127

Appendix 1: Some Special Functions...... 128

Appendix 2: Exercises ...... 134

4

Liedl / Dietrich Mathematical Methods

List of Figures

Fig. 2.1: Histogram of the data set Fig. 2.2: Frequency polygon of the data set ... 13 Fig. 2.3: Relative cumulative frequency distribution of data set from Tab. 2.1 ...... 13 Fig. 2.4: Examples for different types of statistical distributions ...... 14 Fig. 2.5: Different types of pictorial representation ...... 14 Fig. 2.6: Results of regression analysis ...... 16 Fig. 3.1: Geometrical interpretation of the first ...... 18 Fig. 3.2: Examples of points where derivatives do not exist ...... 18 Fig. 3.3: Interpretation of first and second derivative ...... 21 Fig. 3.4: Taylor series expansion of sinx ...... 23 Fig. 4.1: Geometrical interpretation of definite integrals ...... 24 Fig. 4.2: Improper integral of the first kind ...... 28 Fig. 4.3: Improper integral of the second kind ...... 29 Fig. 4.4: Improper integrals for f(x) = 1/x² ...... 30 Fig. 4.5: Improper integrals for f(x) = 1/x...... 31 Fig. 4.6: Soil column and moisture profile ...... 32 Fig. 4.7: Fracture-matrix system and concentration profiles ...... 34 Fig. 5.1: Directional field of a first-order ODE (from Collatz, 1973) ...... 37 Fig. 5.2: Conceptual setting ...... 42 Fig. 5.3: Mass fluxes ...... 44 Fig. 5.4: 1D steady-state groundwater flow in an unconfined aquifer ...... 47 Fig. 5.5: Hydraulic heads in an unconfined aquifer with linearly varying conductivity ...... 50 Fig. 5.6: Hydraulic heads in an unconfined aquifer with two conductivity zones of equal size ...... 51 Fig. 6.1: Addition and subtraction of vectors ...... 54 Fig. 6.2: Illustration for the calculus of scalar product...... 56 Fig. 6.3: Illustration for the calculus of vector product...... 57 Fig. 6.4: Representation of a straight line by vectors...... 59 Fig. 6.5: Representation of a line using the normal vector...... 61 Fig. 6.6: Representation of a plane by vectors...... 62 Fig. 9.1: Basic types of transformation in parallel coordinate systems ...... 82 Fig. 9.2: Rotation of a house about the point P1 by an angle θ...... 86 Fig. 9.3: A house and two coordinate systems. The coordinates of points on the house can be represented in either system...... 87 Fig. 10.1: Two graphical approaches for the estimation of the root of the function f (x) = ln x + x ...... 89 Fig. 10.2: Basic types of iteration behaviour...... 92 Fig. 11.1:Differentiation of a function depending on two variables (from Zachmann, 1981) . 94 Fig. 12.1: Isolines and gradient for a 2D scalar field ...... 97 Fig. 12.2: Motion in isotropic and anisotropic media ...... 99 Fig. 12.3: Groundwater flow through a dam (from Freeze and Cherry, 1979) ...... 99 Fig. 12.4: Isolines and stream lines for ratios of anisotropy equal to (a) 1:4, (b) 1:1, and (c) 4:1 (from Freeze and Cherry, 1979) ...... 100 Fig. 12.5: Vector field with vector lines ...... 100 Fig. 12.6: Source and sink of a vector field ...... 101 Fig. 12.7: Vector field of an electric dipole (Dransfeld and Kienle, 1980) ...... 101 Fig. 12.8: Vortices in a vector field ...... 103 Fig. 12.9: Closed vector lines of a magnetic field (from Dransfeld and Kienle, 1980) ...... 103 Fig. 12.10: Scalar fields and vector fields ...... 105

5

Liedl / Dietrich Mathematical Methods

Fig. 13.1: Boundary conditions of first and second kind ...... 111 Fig. 13.2: Example for model formulation (2D diffusion problem) ...... 112 Fig. 13.3: Drawdown of hydraulic heads due to pumping (from Freeze and Cherry, 1979) . 113 Fig. 13.4: Cartesian and polar co-ordinates ...... 114 Fig. 13.5: General scheme for solving a linear PDE by employing an .... 117 Fig. 13.6: Table of Laplace transforms (from Abramowitz and Stegun, 1968) ...... 118 Fig. 14.1: General graphical representation of mathematical system...... 120 Fig. 14.2: Example for the influence of ray coverage on the solution of the inverse problem of seismic tomography (from Jackson & Tweeton, 1994)...... 123

6

Liedl / Dietrich Mathematical Methods List of Tables

Tab. 2.1: Basic list of the concentration of a selected solute in the groundwater [mg/l] ...... 9 Tab. 2.2: List of the concentration of a select solute in the groundwater [mg/l] in order of increasing magnitude ...... 9 Tab. 2.3: Definition of means ...... 10 Tab. 2.4: Definition of variances and deviations ...... 11 Tab. 2.5: Frequency table of the example data set (Tab. 2.1) ...... 12 Tab. 2.6: Some parameters of a frequency distribution ...... 12 Tab. 3.1: Rules of differentiation ...... 19 Tab. 6.1: Examples for the application of vectors for geometrical calculations ...... 59 Tab. 12.1: Laws of motion ...... 98

7

Liedl / Dietrich Mathematical Methods

1 Introduction

Mathematical techniques are essential prerequisites for quantifying physical, chemical or bio- logical processes to be studied in the environmental sciences. The course “Mathematical Methods” is intended to cover the following fundamental topics: • Statistics • Vectors and matrices • Differentiation and integration • Ordinary differential equations • Systems of linear equations • Iterative Solution of non-linear equations • Partial differential equations • Inverse problems

Each of these teaching units is accompanied by exercises, which will be evaluated and dis- cussed in tutorial lessons.

8

Liedl / Dietrich Mathematical Methods 2 Statistics

In geosciences it is sometimes necessary to draw conclusions about a subsurface parameter or on a relation between different parameters on the basis of the knowledge of some (few) data. Mathematical statistics delivers suitable tools for this purpose. Following is an introduction to descriptive statistics and regression analysis. The starting point for statistical analysis is the so-called basic list. This list contains the considered data in an unsorted sequence.

2.1 Descriptive Statistics of One Property

For the statistical characterisation of one single property, there exist different possibilities. The data of the following basic list are used for an illustration.

Tab. 2.1: Basic list of the concentration of a selected solute in the groundwater [mg/l]

183 181 183 180 182 182 185 182 184 179 182 184 180 181 179 180 182 180 181 183

2.1.1 Description Based on a Sorted Data Set

An approach for the statistical characterisation of a data set is based on the arrangement of the data set in order of increasing magnitude. In the case of the example (see Tab. 2.1) this pro- cess leads to the ordered sample.

Tab. 2.2: List of the concentration of a select solute in the groundwater [mg/l] in order of in- creasing magnitude

179 179 180 180 180 180 181 181 181 182 182 182 182 182 183 183 183 184 184 185

From this rearranged data list the following parameters of the distribution can be determined:

• the minimum of the distribution - the smallest value (179), • the maximum of the distribution - the largest value (185), • the range - the difference between the maximum and minimum (6), • the mode - the most frequently occurring value (182), • the median (M) - the value of the variable which divides the distribution into two parts with equal frequency (182), • the quartiles (Q1, Q2, Q3) - the values which divide the distribution into four equal parts (180, 182, 183), • the deciles (D1, D2, ..., D9) - the values which divide the distribution into ten parts, • the percentiles (P1, P2, ..., P99) - the values which divide the distribution into one hundred parts, • the semi-interquartile range - half of the difference between the first and third quartiles.

9

Liedl / Dietrich Mathematical Methods

The median, quartiles, deciles and percentiles are the quantiles. The values of the quantiles can also easily be taken from the plot of the empirical distribution function. An example is the use of values of the sieve curve for the calculation of different geotechnical and hydrogeolog- ical parameters.

2.1.2 Means, Variances and Deviations

For the characterisation of a data set, different types of means can be used. A mean should be a measure of the centre of the distribution. There also exists the possibility to calculate weighted means, i.e. if the items are representative for a given region, like the extension of a lithofacies. For this calculation, a weighting factor wi for every item is necessary. The defini- tion of the types of means for a data set with n items (x1, x2, ..., xn) can be taken from Table 2.3.

Tab. 2.3: Definition of means type definition example value

n x arithmetic mean ∑ i 181,65 x = i=1 a n

n

∑ wi xi = i=1 weighted arithmetic mean xaw n

∑ wi i=1 n = xh n harmonic mean ∑ 1 181,635 i=1 xi

n

∑ wi = weighted harmonic mean x = i 1 hw n w ∑ i i=1 xi

n n geometric mean xg = ∏ xn 181,6425 i=1

In addition to the centre (mean), the dispersion is also an important feature of a distribution. As measures of the dispersion of a distribution, different types of deviations and variances can be used (see Tab. 2.4).

10

Liedl / Dietrich Mathematical Methods

Tab. 2.4: Definition of variances and deviations type definition example value

n x − x mean deviation ∑ i 1,35 m.d.= i=1 n

2 n n  n  variance of the (x − x) 2 n x 2 − x  ∑ i ∑ i ∑ i  2.7275 parent population σ 2 = i=1 = i=1 i=1 n n n2

2 n n n 2 2   variance of the (x − x) n xi − xi  ∑ i ∑ ∑  2.871 concrete sample σ 2 = i=1 = i=1 i=1 n−1 n − 1 n(n − 1) standard deviation of the parent population σ n 1.652 standard deviation of σ − 1.694 the concrete sample n 1

A further measure for the characterisation of a statistical distribution is the skewness. The skewness refers to the symmetry or lack of symmetry in the shape of a frequency distribution, i.e. it describes the centrality of a distribution. A distribution is symmetrical if the portion to the left and to the right of the centre of the distribution is equal. If the distribution has a tail for higher values (i.e. the distribution includes values to the right side extending further from the centre than the values extending to the left of the centre), it has a positive (right) skew. In the case of a left tail, the distribution has a negative (left) skew.

The quartiles can be used for the characterisation of the skewness. If the difference between the first and second (median) quartiles is greater (lower) than the difference between the sec- ond and the third quartiles, the distribution has a left (right) skew. If the two differences are equal, the distribution is symmetrical. The following formula can be used for the calculation of skewness µ:

n 3 ∑(xi − x) i=1 µ = 3 (Eq. 2.1) nσn

2.1.3 Frequency Distributions

To get a preliminary idea about the distribution of a given data set of one property, the histo- gram can be used to graphically display the data. For the construction of the histogram, the possible range of the property is split into a finite number of adjacent intervals. These inter- vals are called classes. The number of data points in each class must be determined. For this purpose, a frequency table is useful.

11

Liedl / Dietrich Mathematical Methods

Tab. 2.5: Frequency table of the example data set (Tab. 2.1)

relative cumulative rela- concentration absolute frequency frequency tive frequency class i M [%] number [mg/l] count list mi Mi [%] ∑ j j=1 1 0 -179.5 I I 2 10 10 2 179.5-180.5 I I I I 4 20 30 3 180.5-181.5 I I I 3 15 45 4 181.5-182.5 I I I I I 5 25 70 5 182.5-183.5 I I I 3 15 85 6 183.5-184.5 I I 2 10 95 7 184.5- I 1 5 100 Σ n=20 100

Related to the frequency distribution there exists some different measures, which are defined in Table 2.6.

Tab. 2.6: Some parameters of a frequency distribution statistical parameter definition lower class limit (l.c.l.) smallest item value in a class upper class limit (u.c.l.) largest item value in a class lower class boundary (l.c.b.) theoretical possible smallest item value in a class upper class boundary (u.c.b.) theoretical possible largest item value in a class class width/class interval (c.w.) the difference between the upper and lower class bound- ary (u.c.b.-l.c.b.) class midpoint/mid-value (c.m.) half-way between the two class boundaries 0.5*(u.c.b.-l.c.b.) class frequency (c.f.) number of items in a class relative class frequency (r.c.f.) class frequency normalized by the total number of items cumulative class frequency (c.c.f) number of items which lie beneath the upper class boundary relative cumulative class frequency cumulative class frequency normalized by the total (r.c.c.f) number of items modal class class with the greatest frequency

It is worth mentioning that the class widths of the different classes do not need to be equal.

The frequency distribution can be illustrated by a histogram. The histogram consists of rec- tangles drawn on a continuous base (see Fig. 2.1). The absolute or relative class frequency values can be used as ordinate values for the histogram. If the class widths are not equal, a

12

Liedl / Dietrich Mathematical Methods normalisation of the ordinate value by the class width is recommended. In this manner, the ar- ea of each rectangle is proportional to the frequency of the class it represents. Another form of illustration is the frequency polygon (see Fig. 2.2). This polygon is a line graph which may be drawn using the class midpoints and the related class frequencies. On the ends, the polygon is extended to the next lower and higher classes, those having zero frequency. If the number of classes is large, a smooth frequency curve may be drawn in the same manner.

The graphical representation of the relative cumulative class frequency is another possibility for the characterisation of a statistical distribution (see Fig. 2.3). The equivalent function is called the empirical distribution function. A widespread application of this function in the ap- plied geosciences is the illustration of the results from a sieve analysis.

6 6 ] ] - - [ [

y 4

y 4 c c n n e e u u q q e 2 e 2 r r f f

0 0 178 180 182 184 186 178 180 182 184 186 concentration [mg/l] concentration [mg/l] Fig.2.1(data set from Tab. 2.1) Fig.2.2 ( data set from Tab. 2.1) Fig. 2.1: Histogram of the data set Fig. 2.2: Frequency polygon of the data set ] - [

y

c 1.0 n e u q e r f

e v i t 0.5 a l u m u c

e v i t

a 0.0 l e r 178 180 182 184 186 concentration [mg/l] Fig. 2.3: Relative cumulative frequency distribution of data set from Tab. 2.1

2.1.4 Comparing Frequency Distributions

If there are existing data sets of one property from different origins, then it is of interest to know how similar they are. For the comparison of the different distributions, the characteris- tics of the shape of the curves and the above introduced characteristic values can be used. Some of the main types of statistical distributions are the Normal (Gaussian) distribution, the χ2-distribution and the Weibull distribution (see Fig. 2.4).

13

Liedl / Dietrich Mathematical Methods

1 0.9 4

0.9 0.8 3.5

0.8 0.7 3 0.7 0.6 2.5 0.6 0.5 0.5 2 0.4 0.4 1.5 0.3 0.3 1 0.2 0.2

0.5 0.1 0.1

0 0 0 0 1 2 3 0 1 2 3 0 1 2 3 (a) (b) (c) (a) Normal (Gaussian) distribution, (b) Weibull distribution, (c) χ2-distribution. Fig. 2.4: Examples for different types of statistical distributions

2.2 Descriptive Statistics of Several Properties

The data sets which are available from an investigation can contain more than one property. In such a case, not only the statistical characterisations of the single parameters of interest. A common analysis of the different properties is also necessary for a complete characterisation of the investigated objects, e.g. concentration of different ions.

2.2.1 Pictorial Representations

If the data are gained from different points of an investigated area, the use of pictorial repre- sentation is recommended. Such representations are bar charts, pie charts and isotype dia- grams (see Fig. 2.5).

. =... P1 ... P2 ...... P3 ...

(a) (b) (c)

(a) bar chart, (b) pie chart, (c) isotype diagram (or pictogram)

Fig. 2.5: Different types of pictorial representation

A bar chart can have horizontally or vertically oriented bars. All bars must start from the same base line. The diagram with vertical bars is often called a column graph.

In the pie chart, each property is represented by a circle sector which has an area equivalent to the portion of the property (p.p.) from the sum of all properties (s.p.). The sector angle (s.a.) can be calculated by the following formula:

p. p. s.a.= *360° (Eq. 2.2) s. p.

14

Liedl / Dietrich Mathematical Methods

2.2.2 Statistical Measures

If the examined data set contains data for multiple properties, then further statistical measures can be used for the characterisation. Two measures for the properties X and Y with n items are the empirical covariance σXY and the correlation coefficient rXY. The formulas for these measures are  n n  n  n ∑ xi ∑ yi  1 1  i=1 i=1  σ XY = ∑(xi − x)(yi − y) = ∑ xi yi − (Eq. 2.3) n − 1 i=1 n − 1  i=1 n     

σ XY rXY = (Eq. 2.4) σ X ,n−1σ Y ,n−1

It is worth mentioning that σ XY = σ YX and rXY = rYX .

2.3 Regression Analysis

It is often of interest to determine the relation between two properties as a functional expres- sion. An example for such a task is the search for empirical petrophysical relations. These empirical relations form the basis of the geophysical methods applied to the exploration of geological/geotechnical parameter distributions in the subsurface.

The determination of sought functional relationships is carried out by a regression analysis, which is based on the Gaussian method of least squares. That means the following functional must be minimised:

n 2 J = ∑(yi − y(xi)) → min. (Eq. 2.5) i=1

Whereby y(x) represents the function which must be determined. For the minimisation of the functional J, the type of the function y(x) must be declared. Determining the parameters of this function carries out the minimisation.

In general, the regression is based on the determination of a linear function y=a+b*x. If an- other function type, e.g. an exponential function, is sought, then the data should be trans- formed in a first step so that a linear regression is then possible. For a useful result of the line- ar regression, the transformed properties should be uniformly distributed.

The sought coefficients a and b for the linear regression curve can be calculated using the fol- lowing formulas:

15

Liedl / Dietrich Mathematical Methods

n n n n (x − x)(y − y) n x y − x y σ σ ∑ i i ∑ i i ∑ i ∑ i = XY = Y ,n−1 = i=1 = i=1 i=1 i=1 b rXY n (Eq. 2.6) 2 n n 2 σ − σ x,n−1 2 X ,n 1 2   (xi − x)   ∑ n xi − xi i=1 ∑ ∑  i=1  i=1 

 n n  a = y − b * x = ∑ yi − b∑ xi  / n (Eq. 2.7)  i=1 i=1  These formulas show that the result depends on the selection of the properties of X and Y. This means that the linear regression analysis for the changed assignment of properties leads to a linear function which is not necessarily equivalent to the linear function for the unchanged as- signment (see Fig. 2.6). The correlation coefficient would be the same for both assignments. The reason for the possible deviation of the two linear functions consists therein: it was as- sumed that the property Y depends on the property X. In terms of the functional J, that means X is assumed to be error-free.

Fig. 2.6: Results of regression analysis

16

Liedl / Dietrich Mathematical Methods

3 Differentiation

3.1 Definitions

The first derivative of a function y = f(x) relates changes in the function's value y to changes in the function's argument x. In particular, derivatives allow for quantifying these relative changes "locally", i.e. the ratio of infinitesimally small changes dy = df(x) and dx are consid- ered. As a result, first derivatives indicate how rapidly f(x) increases or decreases compared to changes in x. This is expressed by the formula

df (x) f (x + h) − f (x) f '(x) = = lim (Eq. 3.1) dx h→0 h where the first derivative of f is denoted by f'(x) or, equivalently, by the differential quotient df(x)/dx. Frequently, this differential quotient is also denoted by dy/dx in order to emphasise that the first derivative is a measure of changes in the dependent variable y relative to changes in the independent variable x. Of course, cancellation of “d” in dy/dx is impossible as dx and dy do not represent products of “d” and x or “d” and y. Rather, dx and dy indicate infinitesi- mally small increments in the variables x and y, i.e. those increments are abbreviated by a sin- gle mathematical symbol consisting of two letters. For instance, dy and dx may represent in- finitesimal changes in location and time, respectively, and the resulting differential quotient dy/dx is equivalent to velocity.

A geometrical interpretation of eq. (3.1) is provided by Fig. 3.1. Here it is shown that the ratio (f(x+h) - f(x))/h represents the slope of a secant of f through the points (x,f(x)) and (x+h,f(x+h)). When the increment h tends to zero, the secant finally coincides with the tan- gent of f at the point (x,f(x)). Therefore, the first derivative f'(x) may be viewed as the slope of the tangent of f.

In particular, a positive first derivative indicates that f is strictly increasing and a negative first derivative indicates that f is strictly decreasing. This is also shown in Fig. 3.3 (see Section 3.3 below).

It is also important to note that derivatives only exist at points where the function f has no ver- tical tangent and where f is "smooth". The exact definition of "smooth" is not discussed here. Instead, Fig. 3.2 provides four typical examples of non-existing derivatives. This is to illus- trate that the technical term "smooth" basically coincides with what is commonly understood by "smooth".

17

Liedl / Dietrich Mathematical Methods

y=f(x) secant f(x+h)

tangent

f'(x)=tan(α )

f(x) α

0 x x+h

Fig. 3.1: Geometrical interpretation of the first derivative

vertical tt jump

oscillation cusp

Fig. 3.2: Examples of points where derivatives do not exist

18

Liedl / Dietrich Mathematical Methods

3.2 Rules of Differentiation

Basically, first derivatives can be computed by applying five rules, which are summarised in Tab. 3.1 below, i.e. differentiation of any function can be performed by a more or less tricky combination of these five rules.

Tab. 3.1: Rules of differentiation

f(x) = f’(x) = constant factor cg(x) cg’(x) sum g(x) + h(x) g’(x) + h’(x) g(x) h(x) g’(x) h(x) + g(x) h’(x) quotient rule g(x)/h(x) (h(x) g’(x) – h’(x) g(x))/h(x)² chain rule g(h(x)) g’(u) h’(x) with u = h(x)

With respect to the product rule and the quotient rule, it is important to keep in mind that the derivative of a product is a sum of two terms (“+” in the formula), while the derivative of a quotient involves a difference (“-” in the formula).

Example (product rule): Let us consider the function f(x) = x⋅lnx which consists of two factors, i.e. g(x) = x and h(x) = lnx. Therefore, we have g’(x) = 1, h’(x) = 1/x and the first derivative of f is obtained by apply- ing the product rule yielding

1 f '(x) =1⋅ln x + x ⋅ = ln x +1 x

Example (quotient rule): The quotient rule may be applied to differentiate the function

x f (x) = ln x such that g and h are defined as in the previous example. The first derivative of f is now given by

1 1⋅ln x − x ⋅ x ln x −1 f '(x) = = 2 (ln x)2 (ln x)

19

Liedl / Dietrich Mathematical Methods

Example (chain rule): The function

f (x) = e sin x may be differentiated by applying the chain rule. Here we have u = h(x) = sinx, h’(x) = cosx and g(u) = eu, g’(u) = eu so that

f '(x) = eu ⋅cos x = e sin x ⋅cos x

3.3 Higher-order Derivatives

Higher-order derivatives are obtained by iteratively differentiating a function f(x) according to the rules summarised in Tab. 3.1. Therefore, we have

d 2 f ( x) f '(x + h) − f '(x) f ''(x) = 2 = lim (Eq. 3.2) dx h→0 h for the second-order derivative and

d 3f ( x) f ''(x + h) − f ''(x) f '''(x) = 3 = lim (Eq. 3.3) dx h→0 h for the third-order derivative. Accordingly, the derivative of order n may be defined by

n (n − 1) (n − 1) (n) d f ( x) f (x + h) − f (x) f (x) = n = lim (Eq. 3.4) dx h→0 h

Higher-order derivatives may be interpreted as measures of changes of changes etc. In par- ticular, the second derivative of f provides information about the curvature of the graph of f. This is illustrated by Fig. 3.3. This figure also shows that f’(x) = 0 indicates that a relative ex- treme may be present at x. Similarly, f’’(x) = 0 indicates that there might be an inflection point at x. If f’(x) = f’’(x) = 0 a saddle point may be encountered.

20

Liedl / Dietrich Mathematical Methods

3.00 f'(x)>0 f'(x)<0 f'(x)<0 f'(x)>0

y=f(x)

2.00

1.00

f"(x)<0 f"(x)>0 f"(x)<0 f"(x)>0 0.00 -2.00 0.00 2.00 4.00 6.00

relative maximum / minimum

inflection point

saddle point

Fig. 3.3: Interpretation of first and second derivative

3.4 Taylor Series

Sometimes it is convenient to approximate a given function f by a somewhat simpler function in the vicinity of a certain value of the function’s argument x. Frequently, this “simpler” func- tion is selected to be a polynomial with a degree of 1 or 2 (linear approximation, quadratic ap- proximation). If this is to be done the best approximation is achieved by expanding f into a Taylor series. The Taylor series expansion of a function f(x) around x = a is given by

21

Liedl / Dietrich Mathematical Methods

1 f (x) = f (a) + f '(a)(x − a) + f ''(a)(x − a)2 ++ 2

1 (n) n + f (a)(x − a) += (Eq. 3.5) n! ∞ 1 = ∑ f (n)(a)(x − a)n n=0 n! where a is termed point of expansion or centre of expansion.

Remarks: 1) Taylor series are infinite series. 2) In order to obtain a Taylor series infinitely many derivatives of f have to exist at x = a. 3) In practice, only a few terms of the Taylor series are used. So one obtains a polynomial (fi- nite series) approximating f. In this case, the approximation is exact at x = a. Differences between f(x) and its approximating polynomial decrease (i) if x is approaching a, (ii) if the degree of the approximating polynomial is increased. This may be understood as a “rule of thumb”. 4) If a = 0 the Taylor series is also termed MacLaurin series. 5) n! is called factorial (of n). For positive integers n! is defined by

n n!= Π =1⋅2⋅3⋅⋅(n −1)⋅n (Eq. 3.6) i=1

Please note that 0! = 1 by definition.

Example: The Taylor expansion of f(x) = sinx is to be found for a = 0 (MacLaurin series of sinx) keep- ing all terms up to fifth order. The derivatives of f and their values at x = 0 are given by

f(x) = sinx f(0) = 0 f’(x) = cosx f’(0) = 1 f”(x) = -sinx f”(0) = 0 f”’ (x) = -cosx f”’(0) = -1 f (4)(x) = sinx f (4)(0) = 0 f (5)(x) = cosx f (5)(0) = 1

Therefore, one obtains

1 1 1 x 3 x 5 f (x) ≈ ⋅ x + ⋅(−1) ⋅ x3 + ⋅1⋅ x5 = x − + 1! 3! 5! 6 120

This example is also illustrated by Fig. 3.4 below.

22

Liedl / Dietrich Mathematical Methods

1 1.00

5

y=sin(x)

0.00

7

-1.00 3

-2.00 0.00 2.00 1, 3, 5, 7 = expansion up to 1st, 3rd, 5th, 7th order

Fig. 3.4: Taylor series expansion of sinx

Example: The second-order Taylor expansion of f(x) = lnx is to be found for a = 1. The derivatives of f and their values at x = 1 are given by

f(x) = lnx f(1) = 0 f’(x) = 1/x f’(1) = 1 f”(x) = -1/x² f”(1) = -1

From this we get

1 1 2 1 2 1 f (x) ≈ ⋅ (x −1)+ ⋅ (−1)⋅ (x −1) = x −1− (x −1) = (x −1)(3 − x) 1! 2! 2 2

23

Liedl / Dietrich Mathematical Methods 4 Integration

4.1 Definitions

Integration basically is equivalent to computing a sum consisting of infinitely many terms which are infinitesimally small, i.e. close to 0. This is illustrated by Fig. 4.1. From a geomet- rical point of view integrating a (non-negative) function f(x) means to determine the area be- tween the graph of f and the x-axis. More accurately, the definite integral of f from a to b is defined by

b n−1 f ( x ) + f ( x + ) b − a f (x)dx = lim ∑ i i 1 (Eq. 4.1) ∫ n→+∞ a i=1 2 n −1 a and b are termed lower and upper limit of integration, respectively. f is called integrand. Note that b > a is not required.

Fig. 4.1: Geometrical interpretation of definite integrals

24

Liedl / Dietrich Mathematical Methods

The right-hand side of eq. (4.1) indicates that the area between the graph of f and the x-axis may be approximated as follows:

(i) The interval a ≤ x ≤ b is subdivided by n equidistant points a = x1 < x2 < ... < xn-1 < xn = b, i.e. the difference xi+1 – xi equals (b-a)/(n-1). (ii) The area to be calculated is approximated by adding the areas of trapezoids with corners (xi,0), (xi+1,0), (xi+1,f(xi+1)) and (xi,f(xi)). (iii) By letting n → +∞ one obtains the value of the definite integral. This means that the number of trapezoids is increased towards infinity but at the same time the individual are- as tend to 0 (Fig. 4.1).

Of course, the definition given by eq. (4.1) also applies to more general functions, i.e. f is not required to be non-negative. Actually, the interval a ≤ x ≤ b has to be part of the domain of f and f may exhibit a finite number of jumps in that interval.

4.2 Rules of Integration

Definite integrals are computed by employing a two-step procedure: (1) An indefinite integral (general integral, original function) of f(x) has to be determined, i.e. it is necessary to find a function F(x) for which F’(x) = f(x). (This formula explains why integration may be viewed as an inversion of differentiation.) (2) The definite integral is now given by

b b f (x)dx =[F(x)] = F(b) − F(a) (Eq. 4.2) ∫ a a

While the second step can be carried out straightforwardly, the first step often has proven to be rather tedious or even impracticable. Fortunately, many indefinite integrals are found in ta- bles (e.g. Bronshteyn and Semendyayev, 1997) or may be obtained by using computer algebra software. However, in many cases mathematicians have not yet been able to provide explicit expressions for indefinite integrals although they are known to exist. This is true, for instance, for f(x) = exp(-x²) (see Appendix A1.4) or f(x) = exp(-x)/x (see Appendix A1.3).

There are four fundamental rules holding for integrals:

(I) constant factor:

b b ∫ c f (x)dx = c ∫ f (x)dx (Eq. 4.3) a a

(II) sum:

b b b ∫[ f (x) + g(x)]dx = ∫ f (x)dx + ∫ g(x)dx (Eq. 4.4) a a a

25

Liedl / Dietrich Mathematical Methods

(III) integration by parts (partial integration):

b b b ∫ = − ∫ f (x) g'(x) dx [ f (x)g(x)]a f '(x) g(x) dx (Eq. 4.5) a a

(IV) substitution:

−1 b g (b) ∫ f (x) dx = ∫ f (g(u)) g'(u)du (Eq. 4.6) a g −1(a)

with x = g(u) for a function g which is strictly monotonic in the interval g-1(a) ≤ u ≤ g-1(b) or g-1(b) ≤ u ≤ g-1(a), respectively. Here, g-1 is the inverse function of g.

Another frequently used formula, which can be directly derived from eq. (4.2), is given by

a b ∫ f (x)dx = −∫ f (x)dx (Eq. 4.7) b a

i.e. a definite integral changes its sign if the limits of integration are exchanged.

For indefinite integrals it is quite common to use the abbreviation

F(x) = ∫ f (x)dx (Eq. 4.8)

i.e. the limits of integration are not specified. In eq. (4.8) it is understood that the upper limit of integration corresponds to the argument of F and the lower limit is equal to some constant. Using this convention, eqs. (4.3) – (4.6) are still valid when the limits of integration are omit- ted. We have

∫ c f (x)dx = c ∫ f (x)dx (Eq. 4.9)

∫[ f (x) + g(x)]dx = ∫ f (x)dx + ∫ g(x)dx (Eq. 4.10)

∫ f (x) g'(x) dx = f (x)g(x) − ∫ f '(x) g(x) dx (Eq. 4.11)

∫ f (x) dx = ∫ f (g(u)) g'(u)du (Eq. 4.12)

26

Liedl / Dietrich Mathematical Methods

Example: (integration by parts) The indefinite integral of x⋅e2x may be determined by setting f(x) = x, g’(x) = e2x and applying eq. (4.11). In this example we have f’(x) = 1 and g(x) = 1/2⋅e2x so that

1 1 1 1  1  1  1 ∫ x e2 x dx = x ⋅ e2 x − ∫1⋅ e2 x dx = x e2 x−  e2 x =  x − e2 x 2 2 2 2  2  2  2

Example: (substitution) The indefinite integral of xcos(x²) for x > 0 can be found by substituting x = g(u) = √u or u = x². This implies du/dx = 2x so that dx = du/(2x). Therefore, one obtains

du 1 1 1 ∫ x cos( x²) dx = ∫ x ⋅cosu⋅ = cosudu = sinu = sin( x²) 2x 2 ∫ 2 2

Remarks: 1) From eq. (4.11) and from the above example it may be seen that integration by parts is re- lated to the product rule of differentiation. Both operations may be regarded as being in- verse with respect to each other. 2) From eq. (4.12) and from the above example it may be seen that integration by substitu- tion is related to the chain rule of differentiation. Both operations may be regarded as be- ing inverse with respect to each other.

There are rational functions for which it is very simple to determine their indefinite integrals. These rational functions are characterised by the fact that the numerator equals the derivative of the denominator. In this case, we have

f '(x) dx = ln f (x) (Eq. 4.13) ∫ f (x)

Examples:

x³ 1 4x³ 1 dx = dx = ln(1+ x 4) ∫ 1+ x4 4 ∫ 1+ x4 4

eax 1 aeax 1 dx = dx = ln b + eax ∫ b + eax a ∫ b + eax a

27

Liedl / Dietrich Mathematical Methods

4.3 Improper Integrals

Sometimes the region between the graph of the integrand and the horizontal axis extends to infinity, i.e. the area to be determined corresponds to an unbounded region. These unbounded regions, however, may have a finite area which may be determined by so-called improper in- tegrals. Two types of improper integrals exist depending on whether the unbounded region ex- tends to infinity in parallel to the x-axis or in parallel to the y-axis.

Improper integrals of the first kind are definite integrals where either a = ±∞ or b = ±∞. The value of improper integrals of the first kind may be obtained according to the two-step proce- dure presented in Section 4.1. Of course, one has to verify whether it makes sense to employ +∞ or -∞ as an argument of the indefinite integral F(x), i.e. F(+∞) or F(-∞), respectively, has to be finite. In this case the improper integral of the first kind is said to be convergent. If F(+∞) or F(-∞), respectively, is infinite the improper integral of the first kind is divergent.

Example: The area between the graph of f(x) = e-x and the positive x-axis has to be determined (Fig. 4.2). This is achieved by

+∞ − x − x +∞ ∫ e dx =[− e ]0 = 0 − (−1) = 1 0

1.00

0.50

f(x)=e-x

0.00

0.00 1.00 2.00 3.00 4.00 5.00 Fig. 4.2: Improper integral of the first kind

28

Liedl / Dietrich Mathematical Methods

Improper integrals of the second kind are characterised by the fact that f(x) tends to ±∞ when x approaches the lower or the upper limit of integration. Again, the value of improper integrals of the second kind may be obtained by applying the two-step procedure presented in Section 4.1 provided F(x) is finite when x approaches the lower or upper limit of integration. In this case the improper integral of the second kind is said to be convergent. Otherwise the improper integral of the second kind is divergent.

Example: The area between the graph of f(x) = 1/√x and the x-axis is to be determined for 0 ≤ x ≤ 1 (Fig. 4.3). This results in an improper integral of the second kind as f(x) has a pole at x = 0. One ob- tains

1 dx 1 = 2 x = 2 − 0 = 2 ∫ [ ]0 0 x

4.00

-1/2 f(x)=x

0.00

0.00 0.40 0.80 1.20 Fig. 4.3: Improper integral of the second kind

Remarks: • The method described above may fail when f(x) has a pole in the interior of the interval of integration (see examples below). In this case the integral should be split into two parts corresponding to the left and to the right of the pole co-ordinate. • Integrals should be split in a similar manner when the integrand exhibits jumps or cusps in the interior of the interval of integration.

29

Liedl / Dietrich Mathematical Methods

Examples: The function f(x) = 1/x² has a pole at x = 0 (Fig. 4.4). This explains why

1 1 dx  1 = − = −1+ (−1) = −2 ∫ 2   −1 x  x − 1 is wrong!!! There cannot be a negative value of the integral as the integrand is positive and the lower limit of integration is smaller than the upper one. Splitting the integral we get

0 1 0 dx  1 1 dx  1 = − = −(− ∞)−1 = +∞ and = − = −1− (− ∞) = +∞ ∫ 2   ∫ 2   −1 x  x − 1 0 x  x 0 i.e. when the pole co-ordinate is a limit of integration, both improper integrals are divergent.

9 8 7 f(x) = 1/x² 6 5 4 3 2 1 0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5

Fig. 4.4: Improper integrals for f(x) = 1/x²

Next, two more divergent improper integrals are given for the integrand f(x) = 1/x (Fig. 4.5). Here we get

0 1 dx 0 dx 1 =[ln x ] = −∞ − 0 = −∞ and =[ln x ] = 0 − (− ∞) = +∞ ∫ − 1 ∫ 0 −1 x 0 x

From this, however, it cannot be concluded that

1 dx ∫ = 0 −1 x

30

Liedl / Dietrich Mathematical Methods as the “rule” +∞+(-∞) = 0 does not hold in general. Rather, the integral on the left-hand side of the previous equation is divergent. This can be generalised for any integrand with a pole: If at least one of the integrals with a pole co-ordinate as upper or lower limit is divergent, then any integral containing the pole co-ordinate in the domain of integration is also divergent.

9 8 7 6 5 4 f(x) = 1/x 3 2 1 0 -1 -1.5 -1.0 -0.5 -20.0 0.5 1.0 1.5 -3 -4 -5 -6 -7 -8 -9

Fig. 4.5: Improper integrals for f(x) = 1/x

4.4 Applications

The two applications presented in this section refer to the use of integrals for computing the water volume in a soil column under unsaturated conditions and the tracer mass, which has entered the porous rock matrix due to diffusion, respectively.

With regard to the first application, Fig. 4.6 presents a soil column with unit cross-sectional area and a corresponding steady-state moisture profile illustrating water saturation θ(z) of pores in the soil between the soil surface and the groundwater table (interval 0 ≤ z ≤ L). In some cases, e.g. for loamy soils, the steady-state soil moisture distribution is approximately given by the relationship

− 2 ( L−z ) q  q  a θ(z) = θr + (θs − θr ) + 1− e (Eq. 4.14) Ks  Ks  with θr = residual moisture content [-], θs = moisture content at water saturation [-], q = volu- metric flux or discharge per unit area [L/T], Ks = hydraulic conductivity at saturation [L/T] and a = empirical parameter related to soil texture [1/L].

31

Liedl / Dietrich Mathematical Methods steady-state unit cross- flux q sectional area

soil surface θ θ (z = 0) r s 0 θ θ (z)

soil water volume V groundwater table L (z = L) z

Fig. 4.6: Soil column and moisture profile

The water volume per unit area stored above the groundwater table can be calculated from

L V = ∫θ(z)dz (Eq. 4.15) 0

The definite integral on the right-hand side is represented by the hatched area in Fig. 4.6. By inserting eq. (4.14) in eq. (4.15) and applying the rules (I), (II) from Section 4.2 we get

L L − 2 ( L−z ) q  q  a V = θr ∫ dz + (θs − θr )∫ + 1− e dz (Eq. 4.16) 0 0 Ks  Ks 

Here, the first integral can be directly evaluated yielding

L L dz = [z] = L − 0 = L (Eq. 4.17) ∫ 0 0

The second integral in eq. (4.16) can be solved by substituting

2 q 2 u − q  q  − ( L−z ) a au u = + 1− e a z = L + ln Ks dz = du (Eq. 4.18) K K 2 q 2 q s  s  1− u − Ks Ks according to rule (IV) in Section 4.2. From this, we obtain

32

Liedl / Dietrich Mathematical Methods

L 1 2 q  q  − 2 ( L−z ) u ∫ + 1− e a dz = a∫ du (Eq. 4.19) Ks  Ks  2 q 0 u 0 u − Ks with

− 2 L q  q  a u 0 = + 1− e (Eq. 4.20) Ks  Ks  as the new lower limit of integration.

Next, the integral on the right-hand side of eq. (4.19) is evaluated. It is equivalent to

2 q q 1 u − + 1 1 q du ∫ Ks Ks du = ∫ du + ∫ = 2 q Ks 2 q u 0 u − u 0 u 0 u − Ks Ks 1  q   u −  1 q 1 K = [ ] +  s Ks  = u u 0 ln (Eq. 4.21) Ks 2 q q   u +   Ks  u 0  q q   1− u −  1 q 0 = − +  Ks − Ks  1 u0 ln ln  2 Ks q q  1+ u0 +   Ks Ks 

The indefinite integral of the rational function occurring in eq. (4.21) can be found in corre- sponding tables, e.g. Bronshteyn and Semendyayev (1997). The same result can also be ob- tained by a partial fraction composition of the integrand employing u²-q/Ks = [u-√(q/Ks)]⋅ [u+√(q/Ks)].

As a final step, eqs. (4.17), (4.19) and (4.21) are inserted in eq. (4.16), resulting in

 q q   1− u 0 −  a q  Ks Ks  V = θrL + a(θs − θr )(1− u0)+ (θs − θr ) ln − ln = 2 Ks  q q   1+ u0 +   Ks Ks  (Eq. 4.22)     q  q  1− u0 +  a q  Ks  Ks  = θrL + a(θs − θr )(1− u0)+ (θs − θr )ln 2 Ks  q  q   +  −  1 u 0   Ks  Ks 

33

Liedl / Dietrich Mathematical Methods

The second application is illustrated by Fig. 4.7. Tracer in fractured rock may undergo matrix diffusion, i.e. the chemical diffuses from a fracture into the porous rock matrix. Time- dependent concentration in the rock matrix is given by the improper integral of the first kind

+∞ 2c − s 2 c(x,t) = 0 ∫ e ds (Eq. 4.23) π x 4Dt with c0 = tracer concentration in the fracture (assumed to be constant) [M/L³], D = diffusion coefficient [L²/T], x = space co-ordinate perpendicular to the fracture [L], t = time [T] and s = variable of integration [-].

c fracture rock matrix c0 (constant (porosity n, tracer zero initial concen- concentration) tration c0) time t

diffusion c(x,t) (diffusion coefficient D) 0 x x

Fig. 4.7: Fracture-matrix system and concentration profiles

Although the integral in eq. (4.23) cannot be evaluated explicitly (cf. Appendix A1.4), it is possible to get an explicit expression for the tracer mass per unit surface area in the rock ma- trix as a function of time. In general, this quantity is defined by

+∞ m(t) = ∫ nc(x,t)dx (Eq. 4.24) 0 involving another improper integral of the first kind. In eq. (4.24), n denotes rock matrix po- rosity [-]. m(t) can be derived by inserting eq. (4.23) in eq. (4.24), which results in a double integral:

+∞ +∞ 2nc − s 2 m(t) = ∫ 0 ∫ e dsdx (Eq. 4.25) 0 π x 4Dt

34

Liedl / Dietrich Mathematical Methods

Integration by parts (rule (III) in Section 4.2) can be applied here by setting

+∞ 2nc − s 2 g'(x) = 0 f (x) = ∫ e ds (Eq. 4.26) π x 4Dt

Integrating g’ and differentiating f according to the chain rule (Tab. 3.1) results in

2 2nc − x 1 g(x) = 0 x f '(x) = −e 4Dt ⋅ (Eq. 4.27) π 4Dt

Now it is possible to perform the integration by parts in eq. (4.25), yielding

= +∞   x +∞ +∞ x 2 2nc0 x − s 2  2nc0 x − m(t) =  e ds + e 4Dt dx (Eq. 4.28) π ∫ ∫ π  x  0 4 Dt  4Dt  x = 0

The term in square brackets equals 0 because the integral vanishes for x = +∞ and the factor in front of it vanishes for x = 0. Therefore, we have

+∞ 2 +∞ 2 nc − x nc  x  − x m(t) = 0 ∫xe 4Dt dx = 0 (− 2Dt) ∫− e 4Dt dx (Eq. 4.29) πDt 0 πDt 0  2Dt 

In eq. (4.29) the factor -2Dt has been introduced to obtain an integrand which is equivalent to the first-order derivative of the exponential function with respect to x. Accordingly,

+∞ 2 2 − x − x x = +∞ Dt d 4Dt Dt 4Dt m(t) = −2nc0 (e )dx = −2nc0 [e ] = π ∫ dx π x = 0 0 (Eq. 4.30) Dt Dt = −2nc (0 −1) = 2nc 0 π 0 π

This result indicates that the tracer mass in the rock matrix increases with the square root of time if the tracer concentration in the fracture is time-invariant.

35

Liedl / Dietrich Mathematical Methods 5 Ordinary Differential Equations

5.1 Definitions and Geometrical Interpretation

Differential equations are used for formulating mathematical models of a variety of processes in the natural sciences. In general, a may be viewed as an equation con- taining an unknown function and derivatives of this function. In addition, the function's argu- ment(s) may explicitly occur in differential equations. It should be noted here that differential equations have to be solved for an unknown function rather than for numbers or variables rep- resenting unknown quantities in algebraic equations.

Differential equations may be grouped as ordinary differential equations and partial differen- tial equations. In an ordinary differential equation (ODE) the unknown function, which is termed y(x) here, depends on a single variable x. Frequently, x and y are called the independ- ent variable and the dependent variable, respectively. If y depends on two or more variables, a partial differential equation is encountered (Chapter 13).

ODEs may be characterised with respect to their order. The order of an ODE is given by the highest derivative of y(x) occurring in the ODE. Therefore, a (rather) general version of a first-order ODE is given by

y'(x) = f (x, y(x)) (Eq. 5.1)

Here, the function f is known and represents the structure of the ODE, i.e. f provides a rela- tionship between y'(x), y(x) and x. Second-order ODEs may be written as

y"(x) = f (x, y(x), y'(x)) (Eq. 5.2) and, similarly, an ODE of order n is given by

y(n)(x) = f (x, y(x), y'(x),, y(n − 1)(x)) (Eq. 5.3) i.e. f now depends on x, y(x) and derivatives of y(x) up to order n-1.

The solutions y(x) of first-order ODEs may be visualised by a directional field (Fig. 5.1). The directional field of a first-order ODE is obtained by observing that via eq. (5.1) each point in the xy-plane can be associated with a number y'(x) representing the slope of the solution y(x). This is indicated by small line segments in Fig. 5.1. These line segments coincide with the tangents of the solution y(x). Therefore, y(x) may be obtained graphically by plotting (i) the line segments of the ODE's directional field and (ii) curves touching the line segments.

As can be seen from Fig. 5.1 the solution y(x) of a first-order ODE is not unique. In fact, there are infinitely many curves touching the line segments of the ODE's directional field. In order to select a specific solution, which corresponds to the specific scenario to be modelled, addi- tional requirements have to be formulated. These requirements, which usually reflect some additional information about the scenario to be studied, are called initial conditions or bounda- ry conditions, i.e. the "additional information" may define starting conditions of the process (independent variable = time) or conditions holding at the boundary of the model domain (in- dependent variable = spatial co-ordinate). It is important to note that the number of initial or boundary conditions required to identify a unique solution y(x) of an ODE equals the order of the ODE.

36

Liedl / Dietrich Mathematical Methods

Fig. 5.1: Directional field of a first-order ODE (from Collatz, 1973)

Of course, there are some more criteria for classifying ODEs. An ODE of order n is called lin- ear if it may be written in the form

(n) (n − 1) y (x) = a0(x)y(x) + a1(x)y'(x) ++ an − 1(x)y (x) + g(x) (Eq. 5.4) with known functions g(x), a0(x), a1(x), …, an-1(x). Otherwise, the ODE is non-linear. If the coefficients a0, a1, …, an-1 do not depend on x, eq. (5.4) represents a linear ODE with constant coefficients. If g(x) = 0 for all x, then the ODE is homogeneous, otherwise it is inhomogene- ous.

In most applications the order of the corresponding ODE is not larger than 2. To the best knowledge of the authors, this is always true as far as flow and transport problems or physico- chemical reactions in the Applied Geosciences are concerned.

Unfortunately, there is no general method for obtaining the solution of a given ODE. In other words, there are many ODEs which cannot be solved by any known solution technique. In the rest of this chapter some basic techniques are presented which may be applied to special types of ODEs.

37

Liedl / Dietrich Mathematical Methods

Example: In this example the ODE

dc = −kc (Eq. 5.5) dt is considered where the unknown function c = c(t) represents the concentration [ML-3] of a chemical being subjected to microbial degradation or radioactive decay and k is a rate con- stant [T-1] providing a measure for the "speed" of the decay process. Eq. (5.5) states that the temporal change in concentration is proportional to the actual value c(t). This suggests that the solution of eq. (5.5) may be written as

c(t) = αeβ t (Eq. 5.6) with coefficients α, β which still have to be determined. Next, one has to verify that eq. (5.6) really represents a solution of the ODE (5.5). This, of course, is achieved by inserting eq. (5.6) in eq. (5.5) and fixing α and β such that both sides of the resulting relationship coincide. It is found that β = -k and α = c0 where c0 stands for an initial concentration, i.e. the initial condi- tion associated with the process to be modelled is c(0) = c0.

Remarks: • Eq. (5.5) is a linear, first-order, homogeneous ODE with constant coefficients. ODEs of this kind always have a solution, which is given by an exponential function. • Eq. (5.6) is an example of an ansatz. This is an educated guess for the general structure of the solution of an ODE. It is quite common that an ansatz includes some coefficients which remain to be determined. In most cases the ansatz is motivated by some knowledge about the process modelled by the ODE and the corresponding initial or boundary condition(s). In any case, it has to be verified that the ansatz really provides a solution of the ODE and is compatible with the initial or boundary condition(s).

5.2 Variation of Constants

A special technique, called variation of constants or , has been devel- oped for solving linear inhomogeneous ODEs (g(x) ≠ 0 in eq. (5.4)) provided that the solution of the corresponding homogeneous ODE (g(x) = 0) is known. For simplicity, this technique is demonstrated here for the first-order equation

y' (x)= ay(x)+ g(x) (Eq. 5.7) where the coefficient a does not depend on x. In addition, the initial or boundary condition y(0) = y0 is assumed to hold.

From the example in the preceding section it is known that the solution for the corresponding homogeneous problem (g(x) = 0 in eq. (5.7)) is given by

ax yhom(x)= y0e (Eq. 5.8)

Obviously, this solution also accounts for the initial or boundary condition introduced above.

38

Liedl / Dietrich Mathematical Methods

Now the variation-of-constants method is employed in order to obtain the solution of the in- homogeneous ODE (5.7). The crucial step is to start with an ansatz where the constant y0 is replaced by a function of x. This function is termed b(x) here so that the ansatz is given by

y(x)=b(x)eax (Eq. 5.9)

Next, the unknown function b(x) is determined by inserting the ansatz (5.9) in eq. (5.7). Com- paring both sides of eq. (5.7) it is found that b(x) has to satisfy the relationship

b'(x) = g(x)e − ax (Eq. 5.10)

Please note that due to the ansatz (5.9) only b'(x) is contained in eq. (5.10), but b(x) does not appear explicitly. Therefore, b(x) can be obtained directly by integrating the right-hand side of eq. (5.10) yielding

x ~ − ax~ ~ b(x) =b0 + ∫ g(x )e dx (Eq. 5.11) 0 where b0 is a . Eq. (5.11) now is inserted in eq. (5.9). Accounting for the initial or boundary condition, this results in

x ~ ax ~ a(x − x ) ~ y(x) = y0e + ∫ g(x )e dx (Eq. 5.12) 0

Remarks: • It can be verified that eq. (5.12) is a solution of the inhomogeneous ODE (5.7) and that the condition y(0) = y0 is satisfied. • From eq. (5.12), it can be seen that the solution of the inhomogeneous ODE (5.7) consists of two terms. The first term coincides with the solution (5.8) of the homogeneous ODE and contains the initial or boundary value. The second term is a solution of the inhomogeneous equation with the special property that it vanishes at x = 0, i.e. at the "location" where the initial or boundary condition holds. Of course, only this second term depends on the func- tion g quantifying the inhomogeneity of the ODE. • More general versions of this technique exist (i) for higher-order linear inhomogeneous ODEs and (ii) when the coefficients depend on x.

39

Liedl / Dietrich Mathematical Methods

5.3 Separation of Variables

This solution technique applies to first-order ODEs where the right-hand side of eq. (5.1) may be written as a product of two functions, each of which only depends on x or y, respectively, i.e. the problem is to solve the ODE

dy = f (x) f (y) (Eq. 5.13) dx 1 2 subject to the initial or boundary condition y(x0) = y0.

First-order ODEs of this type can be solved by separation of variables. This technique requires two cases to be distinguished depending on the value of f2 at y = y0.

Case I: f2(y0) = 0 In this case the solution of eq. (5.13), accounting for the initial or boundary condition, is y(x) = y0. A constant function y(x) is obtained because the derivative dy/dx equals zero when the right-hand side of eq. (5.13) vanishes.

Case II: f2(y0) ≠ 0 In this case the solution of eq. (5.13) is obtained in three steps. (i) First, the variables are separated, i.e. eq. (5.13) is rewritten such that each side only de- pends on x or y, respectively. This results in

dy = f1 (x)dx (Eq. 5.14) f2 (y)

(ii) Next, eq. (5.14) is integrated accounting for the initial or boundary condition y(x0) = y0, i.e.

y d~y x ∫ = ∫ f (~x ) d~x (Eq. 5.15) f (~y) 1 y0 2 x0

Note that f2 has to be different from zero and f1 must not have a pole in the respective domain of integration. (iii) Finally, the integrals in eq. (5.15) are calculated and the resulting relationship is solved for y, thus providing an explicit solution y = y(x) of eq. (5.13).

40

Liedl / Dietrich Mathematical Methods

Example: Some chemical reactions can be modelled by the non-linear first-order ODE

dc = −kc2 (Eq. 5.16) dt

-1 -1 and the initial condition c(0) = c0. Please note that k has dimensions M L³T in this model- ling approach. Eq. (5.16) may be solved by separation of variables. To this end, we set f1(t) = -k and f2(c) = c².

Case I requires f2(c0) = c0² = 0. This is only possible if c0 = 0 indicating that no chemical is present at t = 0. Consequently, c(t) = 0 in this case.

For treating case II (c0 > 0), the variables in eq. (5.16) are separated yielding

dc = −kdt (Eq. 5.17) c 2

This equation is now integrated with c0 and 0 as lower limits of integration in order to account for the initial condition given above. The indefinite integrals are -1/c and -kt for the left-hand side and for the right-hand side, respectively, resulting in

1 1 − + = −kt (Eq. 5.18) c c0

Solving eq. (5.18) for c we obtain

c c(t) = 0 (Eq. 5.19) c0kt +1

It should be added here that the term "order" may lead to some confusion as far as eq. (5.16) is concerned. As mentioned above, this equation is a first-order ODE because only the first de- rivative of c appears. However, eq. (5.16) provides a model for a chemical reaction which has been classified as second-order kinetics by chemists. This is indicated by the exponent 2 oc- curring on the right-hand side of eq. (5.16). Of course, this exponent does not affect the order of the differential equation from a mathematician's point of view.

41

Liedl / Dietrich Mathematical Methods

Remarks: • While case II includes all "standard" situations associated with the system to be modelled, case I usually represents some "special" property. In the above example, it covers the (very boring) special situation that there is no mass at t = 0, so that the reaction simply cannot start. • As mentioned already in Chapter 4, it is not always possible to find the indefinite integrals for the integrands occurring in eq. (5.15). If this is true, one cannot further simplify eq. (5.15), which provides what is called an integral representation of the solution, i.e. one could get rid of the first derivative y'(x) but would introduce one or two nasty integrals. • Sometimes, the expression on the left-hand side obtained after integration of eq. (5.15) is too complicated to be solved for y. In this case, at least a so-called implicit representation of the solution has been achieved, i.e. a relationship between x and y involving neither de- rivatives nor integrals. Sometimes one may succeed in solving this implicit representation for x arriving at the inverse function y-1 of the solution.

5.4 Deriving and Solving an ODE Model for Contaminant Transport in Soil

This section is intended to demonstrate how a mathematical model is derived from a concep- tual setting of an environmental problem and how the resulting ODE is solved while account- ing for appropriate boundary conditions.

The conceptual setting to be investigated is shown schematically in Fig. 5.2, which depicts a vertical cross-section of the unsaturated zone, i.e. the soil region between the ground surface and the groundwater table. In this region the subsurface may be viewed as a porous medium with pores partly filled with air and partly filled with water. For the scenario discussed here, it is further assumed that there is a coherent gas phase as well as a coherent water phase in the pores of the soil.

mass flux into atmosphere = ?

z=0 ground surface

diffusive advective unsatu- transport transport rated (gas (water zone phase) phase)

ground- z=L water fuel table

z Fig. 5.2: Conceptual setting

42

Liedl / Dietrich Mathematical Methods

Fig. 5.2 shows that an environmental problem is caused by the presence of some fuel or diesel or another contaminant which is lighter than water. In this scenario, the contaminant is emit- ted into the gas phase and is transported upward to the ground surface by diffusion. However, there is also partitioning of the contaminant between the gas phase and the water phase in the pores of the unsaturated zone. Contaminant molecules entering the water phase are transport- ed back down to the groundwater table by advection due to infiltrating rainwater. For sim- plicity, a homogeneous porous medium and steady-state contaminant transport are assumed here. This latter assumption seems to be justified if one is interested in the long-term behav- iour and disregards temporary fluctuations in air or water flow. Furthermore, as this example is focusing on the average contaminant mass flux into the atmosphere at z = 0, the above as- sumption may be regarded appropriate.

In the simplified scenario depicted in Fig. 5.2, a steady-state, one-dimensional problem is to be studied where the space co-ordinate z [L] is oriented vertically downward such that z = 0 and z = L correspond to the location of the ground surface and the groundwater table, respec- tively.

In order to develop a mathematical model for this conceptual setting, contaminant transport in the gas phase, which is governed by diffusion, is quantified first. According to Fick’s first law, -1 -2 the diffusive contaminant mass flux per unit area, Fg [MT L ], is given by

dcg F = − De (Eq. 5.20) g dz

-1 with De = effective diffusion coefficient [L²T ], cg = contaminant concentration in the gas phase [ML-3]. The effective diffusion coefficient accounts for the porosity of the medium and for the tortuosity of the transport paths in the soil. Thus, effective diffusion coefficients are smaller than diffusion coefficients which quantify a diffusive contaminant spreading in pure air. The negative sign in eq. (5.20) indicates that mass flux is oriented in direction of decreas- ing concentration.

Contaminant transport in the water phase is assumed to be controlled by advection so that the -1 -2 mass flux per unit area, Fw [MT L ], can be written as

Fw = vcw (Eq. 5.21)

-1 where v = advective velocity or seepage velocity [LT ] and cw = contaminant concentration in the aqueous phase [ML-3].

Partitioning of the contaminant between the air phase and the water phase is modelled by the linear relationship

cg = Hcw (Eq. 5.22) with a parameter H [-] also known as Henry’s constant. Inserting eq. (5.22) in eq. (5.21) pro- vides the mass flux in the water phase in terms of cg, i.e.

v F = cg (Eq. 5.23) w H

Eqs. (5.20) – (5.23) show that the model depends on four parameters: De, v, H and L.

43

Liedl / Dietrich Mathematical Methods

Next, a model equation for cg is derived. This is done by recalling that mass fluxes are subject to the physical principle of mass conservation, i.e. inflow and outflow of contaminant mass have to coincide for any portion of the model domain. In order to express the conservation of mass by a mathematical formula, a small interval ∆z is considered (Fig. 5.3). From Fig. 5.3 it is evident that the statement “inflow = outflow” is quantified by the mass flux equation

− Fg (z + ∆z) + Fw (z) = − Fg(z) + Fw (z + ∆z) (Eq. 5.24)

In eq. (5.24) negative signs have to be chosen whenever fluxes are directed towards decreas- ing values of the spatial co-ordinate.

dcg Fg = -D e dz st (Fick's 1 law with De = Fw = vcw effective diffusion coefficient) (v = advective velocity)

z

c g cw

z + ∆ z

advective transport diffusive transport (water phase) (gas phase)

partitioning: cg = Hcw

Fig. 5.3: Mass fluxes

As ∆z is assumed to be small, Fg(z+∆z) and Fw(z+∆z) may be well approximated by a Taylor series with z as point of expansion, i.e.

dFg Fg (z + ∆z) = Fg (z) + (z) ∆z (Eq. 5.25) dz and

dF F (z + ∆z) = F (z) + w (z) ∆z (Eq. 5.26) w w dz

44

Liedl / Dietrich Mathematical Methods

Eqs. (5.25) and (5.26) are now inserted in eq. (5.24) which results in

d [Fg (z) + Fw (z)]= 0 (Eq. 5.27) dz

Of course, this equation confirms that the total contaminant flux does not change in space in accordance with the principle of mass conservation, i.e. the contaminant may only be trans- ferred from the water phase to the gas phase and vice versa.

The model equation for cg mentioned above can now be derived by simply inserting eqs. (5.20) and (5.23) in eq. (5.27). This results in

d  dcg v  − D + cg = 0 (Eq. 5.28) dz  e dz H 

Eq. (5.28) is a linear homogeneous ODE. It is a second-order equation so that two boundary conditions are required. Here it is assumed that the concentration at the ground surface is equal to zero indicating that the contaminant is highly diluted in the atmosphere, i.e.

cg(0) = 0 (Eq. 5.29)

The second boundary condition is specified at the groundwater table where it is assumed that -3 cw equals the equilibrium concentration, ceq [ML ]. ceq is a species-dependent maximum con- centration of a chemical dissolved in water. With eq. (5.22) the boundary condition at z = L for the contaminant concentration in the gas phase reads

cg(L) = Hceq (Eq. 5.30)

Eqs. (5.28) – (5.30) constitute the complete mathematical model to be solved. To this end, it is helpful to note that eq. (5.28) says that the term in parentheses does not depend on z and, therefore, may be set equal to a constant which is termed -α here. (For completeness, it may be noted that -α equals the total mass flux [MT-1].) As a result we have

dcg v − D + cg = − α (Eq. 5.31) e dz H which may be rewritten as

dcg v α = cg + (Eq. 5.32) dz HDe De

Eq. (5.32) is a special case of eq. (5.7) with a = v/(HDe) and g = α/De. Therefore, the solution of eq. (5.32) can be obtained by inserting these expressions for a and g in eq. (5.12). Consid- ering boundary condition (5.29), which is tantamount to setting y0 = 0 in eq. (5.12), and eval- uating the integral, yields

αH vz HD cg(z) = (e e −1) (Eq. 5.33) v

45

Liedl / Dietrich Mathematical Methods

This equation contains a single unknown coefficient, α, which is determined by involving the boundary condition at the water table given by eq. (5.30). If we set z = L in eq. (5.33) and re- place cg(L) by ceq we obtain

αH Hceq = vL (Eq. 5.34) v e HDe −1 which can be inserted in eq. (5.33) yielding the final result for the contaminant concentration in the gas phase

vz e HDe −1 cg(z) = Hceq vL (Eq. 5.35) e HDe −1

By combining eqs. (5.35) and (5.22) the contaminant concentration in the water phase is found to be

vz e HDe −1 cw(z) = ceq vL (Eq. 5.36) e HDe −1

From eqs. (5.35) and (5.36) the contaminant mass fluxes can be computed. To this end, these relationships are inserted in eqs. (5.20) and (5.21), respectively, yielding

vz e HDe Fg (z) = − vceq vL (Eq. 5.37) e HDe −1 and

vz e HDe −1 Fw (z) = vceq vL (Eq. 5.38) e HDe −1

The contaminant mass flux into the atmosphere is now easily obtained by evaluating eq. (5.37) at z = 0. This yields the solution of the problem:

vceq Fg (0) =− vL (Eq. 5.39) e HDe −1

The negative sign indicates that the mass flux is directed towards decreasing values of z, i.e. the contaminant mass is leaving the subsurface. From eq. (5.38) it is easy to check that Fw(0) = 0, implying that in this scenario there is no contaminant entering or leaving the subsurface via the aqueous phase.

46

Liedl / Dietrich Mathematical Methods

5.5 Modelling 1D Groundwater Flow in a Heterogeneous Aquifer

This section deals with the solution of an ODE describing 1D steady-state groundwater flow in an unconfined aquifer without recharge (Fig. 5.4). Boundary values are given by hydraulic heads and hydraulic conductivity K may vary in space, i.e. some function K = K(x) is assumed to be known.

hydraulic head h lake ground surface groundwater table h(x) = ?

lake h0 heterogeneous aquifer, conductivity K(x) hL

0 L x impermeable layer

Fig. 5.4: 1D steady-state groundwater flow in an unconfined aquifer

The corresponding model equation is given by

d  dh K(x)h  = 0 (Eq. 5.40) dx  dx  with h = h(x) = hydraulic head [L], which is the unknown function in this problem. Eq. (5.40) represents a non-linear second-order ODE describing groundwater flow in an inhomogeneous (heterogeneous) aquifer as K may be space-dependent. From a mathematical point of view, however, eq. (5.40) cannot be classified as “inhomogeneous” or “homogeneous” as these terms only apply to linear ODEs. For linear ODEs the different meanings of the term “(in)homogeneous” in and hydrogeology have to be considered.

For a second-order ODE two boundary conditions are required to complete the mathematical model. In this example, the lakes are assumed to represent so-called fixed-head boundaries, i.e. the conditions h(0) = h0 and h(L) = hL with prescribed head values h0 and hL are given at x = 0 and at x = L, respectively.

47

Liedl / Dietrich Mathematical Methods

A solution of eq. (5.40) may be achieved by first reducing the order of the given ODE. As the derivative of the term in brackets equals zero, this term cannot depend on x. Therefore, we write

dh K(x)h = α (Eq. 5.41) dx where α denotes a constant of integration which has to be determined later. (There is a physi- cal meaning for -α which equals the discharge per unit width [L²T-1].) Eq. (5.41) is a first- order non-linear equation. Separation of variables results in

α hdh = dx (Eq. 5.42) K(x)

Integration of eq. (5.42) can be performed taking the lower limits of the integrals from the boundary condition at x = 0:

h ~ ~ x α hdh = d~x (Eq. 5.43) ∫ ∫ K(~x ) h0 0

From this we get

h x ~ 1 ~ 2 1 2 2 dx  h  = (h − h0 ) = α ∫ ~ (Eq. 5.44) 2  h0 2 0 K(x )

Solving eq. (5.44) for h is possible but it is more convenient to determine the constant of inte- gration first. To this end, we set x = L in eq. (5.44) and invoke the second boundary condition:

L ~ 1 2 2 dx (hL − h0 ) = α ∫ ~ (Eq. 5.45) 2 0 K(x )

This relationship can be solved for α yielding

2 2 hL − h0 α = (Eq. 5.46) L d~x 2∫ ~ 0 K(x )

In the next step, α is replaced in eq. (5.44) obtaining

x d~x ∫ ~ 1 2 2 1 2 2 0 K(x ) (h − h0 ) = (hL − h0 ) (Eq. 5.47) 2 2 L d~x ∫ ~ 0 K(x )

48

Liedl / Dietrich Mathematical Methods

Finally, the factor ½ is cancelled on both sides of eq. (5.47) which is then solved for h:

x d~x ∫ ~ 2 2 2 0 K(x ) h(x) = h0 + (hL − h0 ) (Eq. 5.48) L d~x ∫ ~ 0 K(x )

This relationship provides a general solution of the 1D groundwater flow equation in uncon- fined aquifers with fixed-head boundaries. Some special cases may be derived for specific conductivity distributions K(x).

As a first special case, a homogeneous aquifer is considered. Therefore, K(x) = K = const. The integral in the numerator of eq. (5.48) now equals

x ~ x ~ x dx dx 1 1 x 1 x = = ~ = ~ = − = ∫ ~ ∫ ∫ dx [x]0 (x 0) (Eq. 5.49) 0 K(x ) 0 K K 0 K K K

As an immediate consequence, the integral in the denominator is equal to L/K and eq. (5.48) simplifies to

2 2 2 x / K 2 2 2 x h(x) = h0 + (h − h0 ) = h0 + (h − h0 ) (Eq. 5.50) L L / K L L

From this, it can be concluded that h(x) does not depend on the hydraulic conductivity value if the aquifer is homogeneous without recharge and boundary conditions are fixed heads.

In the second example it is assumed that K(x) varies linearly in the model domain, i.e.

x K(x) = K 0 + (KL − K0 ) (Eq. 5.51) L with different conductivities K0 and KL given at x = 0 and x = L, respectively. In this case, the integral in the numerator of eq. (5.48) is given by

x ~ x ~ x dx dx L (KL − K 0 )L ~ ∫ ~ = ∫ ~ = ∫ ~ dx = 0 K(x ) 0 K0 + (KL − K 0 )x / L KL − K 0 0 K0 + (KL − K 0 )x / L L ~ x = [ln(K0 + (KL − K 0 )x / L)]0 = KL − K 0 (Eq. 5.52) L = [ln(K0 + (KL − K 0 )x / L)− ln K 0] = KL − K 0 L K + (K − K )x / L = ln 0 L 0 KL − K 0 K 0

49

Liedl / Dietrich Mathematical Methods

This result can be inserted in eq. (5.48) yielding

L K0 + (KL − K0 )x / L ln 2 2 2 KL − K0 K0 h(x) = h0 + (hL − h0 ) = L KL ln KL − K0 K0 (Eq. 5.53)   KL  x  ln1+  −1  2 2 2   K0  L = h0 + (hL − h0 ) KL ln K0

From eq. (5.53) it can be seen that h(x) in this case only depends on the conductivity ratio but not on the conductivity values themselves. Some typical solutions for different KL/K0 ratios are depicted in Fig. 5.5. The central solid curve represents hydraulic heads for a homogeneous aquifer. The dashed curve indicates that there is a small range of KL/K0 ratios producing close- to-linear head distributions with an inflection point denoted by the dot.

h KL KL = 1 h < 1 0 K0 K0

KL > 1 K0

hL

K = K0 K = KL

0 L x

Fig. 5.5: Hydraulic heads in an unconfined aquifer with linearly varying conductivity

Finally, hydraulic conductivity is assumed to have a discontinuity at x = L/2 but is constant in each half of the model domain, i.e. we have

K 0 if 0 < x < L / 2 K(x) =  (Eq. 5.54)  KL if L/2 < x < L

Based on eq. (5.54), the integral in the numerator of eq. (5.48) has to be evaluated by distin- guishing whether x is in the left or in the right half of the model domain. For 0 < x < L/2 we can make use of eq. (5.49), which covers the homogeneous case, and obtain

x d~x x ∫ ~ = (Eq. 5.55) 0 K(x ) K0

50

Liedl / Dietrich Mathematical Methods

For L/2 < x < L it is necessary to split the integral as follows:

x ~ L / 2 ~ x ~ dx dx dx L / 2 x − L / 2 L  KL 2x  ∫ ~ = ∫ + ∫ = + =  + −1 (Eq. 5.56) 0 K(x ) 0 K0 L / 2 KL K0 KL 2KL  K0 L 

For x = L this reduces to

L ~ dx L  KL  ∫ ~ =  +1 (Eq. 5.57) 0 K(x ) 2KL  K0  providing an expression for the integral in the denominator of eq. (5.48).

Eqs. (5.55) – (5.57) can now be used to derive the hydraulic head distribution. First, the inter- val 0 ≤ x ≤ L/2 is considered. Heads in this part of the model domain are given by

x KL 2x ⋅ 2 2 2 K0 2 2 2 K0 L h(x) = h0 + (hL − h0 ) = h0 + (hL − h0 ) (Eq. 5.58) L  KL  KL  +1 +1 2KL  K0  K0

For L/2 ≤ x ≤ L the solution is given by

L  KL 2x  KL 2x  + −1 + −1 2 2 2 2KL  K0 L  2 2 2 K0 L h(x) = h0 + (hL − h0 ) = h0 + (hL − h0 ) (Eq. 5.59) L  KL  KL  +1 +1 2KL  K0  K0

As in the previous example, h(x) is affected by the conductivity ratio KL/K0 but not by conduc- tivity values themselves. Fig. 5.6 illustrates the solution of this problem for three different conductivity ratios. The central curve representing the homogeneous case is smooth. The dis- continuity in K at x = L/2 appears to be associated with a kink in the hydraulic head distribu- tion, i.e. h is continuous but the derivative dh/dx is not.

h KL KL < 1 = 1 K0 K h0 0

KL > 1 K0

hL

K = K0 K = KL 0 L/2 L x

Fig. 5.6: Hydraulic heads in an unconfined aquifer with two conductivity zones of equal size

51

Liedl / Dietrich Mathematical Methods 6 Vectors and Geometry 6.1 Scalars and Vectors

Many quantities in natural sciences and other fields can be expressed by a real number with a unit. These quantities are called scalars. Temperature, time, energy and mass are examples of scalars. Other quantities are not fully described by a real number and a unit, e.g. acceleration. The direction and orientation in a given system are additionally necessary for the complete characterisation of the acceleration. Such quantities, which are characterised by a number, a direction and an orientation are called vectors. They are often represented by bold letters or by using an arrow over or under the letter. Vectors are valid in any n-dimensional system; they are not limited to 2- or 3-dimensional systems.

In the intuitive sense, a vector is a directed segment in space. The real number, which charac-   terises the vector, x is called the magnitude. The magnitude is denoted by x and can be un- derstood as the length of the direct segment. A vector with a magnitude of 0 is called a null  vector o . The direction of a null vector is indeterminate. Vectors with the length of one unit are unit vectors. For each vector, except the null vector, there exists a unit vector with the same direction and orientation. A unit vector may be determined by a vector and its magni- tude through the following relationship:

  x x° =  (Eq. 6.1) x The unit vectors in the direction and orientation of the axes of the coordinate system are the  basis vectors of this system. They are often denoted ei . The subscript expresses the related ax- is. The subscripts x, y, z or 1, 2, 3 are used for the three-dimensional Cartesian coordinate sys- tem. The projection results in vectors along each axis. They are called vectorial components of the  vector x . The length of the projection on the coordinate i can be written as xi. If the projection  of the vector x has the same orientation as the coordinate axis then the length gets a positive sign. Otherwise, the length gets a negative sign. Therefore, a vectorial component can be rep-    resented by x or xiei . The complete vector x can be described using the vectorial compo- nents:        x = x1 + x2 + x3 = x1e1 + x2 e2 + x3 e3 (3D)  n  x = ∑ xi ei (nD) i=1 or the scalar components:

 x1      x = (x1 ,x2 ,x3 ) , x =  x2  (Eq. 6.2)    x3  and the magnitude of a vector can be calculated using the scalar components

 2 2 2 x = x = x1 + x2 + x3 (3D)

n  2 x = x = ∑ xi (nD) i=1

52

Liedl / Dietrich Mathematical Methods

6.1.1 Vector Function of a Scalar Variable

 If the components of a vector x depend on one scalar variable t,

x=x(t), y=y(t), z=z(t),

 then x(t) is called a vector function. If this vector function is applied at a fixed point O, it is  then a radius vector and the end points of the vector x(t) lie on a space curve. An example for an application of such a vector function in geosciences is the description of the path curve of a  particle in groundwater. In this case t represents the travel-time of the particle and x(t) is the position of the particle at this time.

6.1.2 Comparison of Vectors

Magnitude, direction and orientation can be used to compare vectors; two vectors are equal if they are equal in magnitude, direction and orientation. Thereby the starting points of the two vectors need not be equal. The set of all those vectors that can be obtained from a given vector   x by parallel translation is called the free vector corresponding to x . In the mathematical lit- erature the whole set is called a vector and the single elements of the set are then called repre- sentatives of the vector.

If a vector is also defined by the starting point, e.g. for physical reasons, then it is a bound vector. The vector, which assigns a point in a coordinate system is the radius vector. The start- ing point of the radius vector is the origin of the coordinate system. If a vector can be only moved on a straight line with constant direction and magnitude, then it is a sliding vector. An example of such a vector is the representation of a force.

If two vectors have the same direction they are called collinear vectors. In the case of an iden- tical orientation they are parallel vectors. If they have the opposite orientation they are anti- parallel vectors.

6.2 Basic Laws of Vector Calculus

6.2.1 Addition and Subtraction

It is possible to add and subtract vectors. The prerequisite is that they are based on the same coordinate system. The addition (subtraction) of two vectors is carried out by the addition (subtraction) of each component

     a ± b = (a1 ± b1 ,a2 ± b2 ,a3 ± b3 ) = (a1 ± b1 )e1 + (a2 ± b2 )e2 + (a3 ± b3 )e3 (Eq. 6.3)

Geometrically, the addition can be understood as a joining of two vectors by a suitable trans- lation so that the end point of one vector is identical with starting point of the other vector. The result of addition is the vector between the starting point of the first vector and end point of the second vector (see Fig. 6.1). The result of subtraction is geometrically equivalent to the   vector which connects the end points of the vectors a and b if they have the common starting  point. The resulting vector points to the end point of the vector a (see Fig. 6.1).

53

Liedl / Dietrich Mathematical Methods

Examples:  0  − 2 a =   , b =   1  1 

    0 + (− 2) − 2 c = a + b , c =   =    1+1   2 

    0 − (− 2) 2 d = a − b , d =   =    −     1 1  0

Fig. 6.1: Addition and subtraction of vectors

6.2.2 Multiplication of a Vector by a Scalar

A vector can be transformed by multiplication of each component with a scalar:

    λx = (λx1 ,λx2 ,λx3 ) = λx1e1 + λx2e2 + λx3e3 (Eq. 6.4)

When the scalar is zero the result is the null vector. If the relation between two vectors can be   expressed by a = λb , then the vectors are collinear. They are parallel for λ>0 and antiparallel for λ<0.

Example:   F = ma   F - force acting on an object; m - mass of the object; a - acceleration

6.2.3 Linear Combination of Vectors and Decomposition

   A linear combination of vectors x1 , x2 , ..., xn with real coefficients a1 , a2 , ..., an is a vector of the form     y = a1 x1 + a2 x2 + ... + an xn (Eq. 6.5)

In a similar way, a vector can also be decomposed. A common example of a vector decompo- sition is that of a vector into the unit vectors of a coordinate system.

54

Liedl / Dietrich Mathematical Methods

If it is possible to combine three vectors with non-zero coefficients in such a way that     o = a1x1 + a2 x2 + a3 x3 , then the vectors are coplanar. Geometrically, that means the three vec- tors are parallel to one plane.

Example: 0 − 2 4  =    =    =   x1   , x2   , x3   1  1  0

    2x1 + (−2)x2 + (−1)x3 = o

   If vectors x1 , x2 , ..., xn are given such coefficients a1 , a2 , ..., an and it can be found that     a1 x1 + a2 x2 + ... + an xn = o , then the vectors are linearly dependent. Otherwise they are linear- ly independent. The maximum number of independent vectors in a given system is equal to the number of vector components in the system. Collinear and coplanar vectors are always linearly dependent.

6.3 Multiplication of Vectors

As opposed to the calculus with real numbers, several types of multiplication exist for the cal- culus of vectors.

6.3.1 Scalar Product (Dot Product)

        The scalar product a ⋅b of two vectors a and b is defined as the product a ⋅b = a b cosϕ where ϕ is the angle between the two vectors (see Fig. 6.2). In Cartesian coordinates it can be calculated using the formula   3 a ⋅b = ∑aibi (Eq. 6.6) i=1

Example:   1 1  a =   b =   , ϕ = 45 1 0

    1 a ⋅b = a b cosϕ = 2 ⋅1⋅ 2 = 1 2   a ⋅b = a1 ⋅b1 + a2 ⋅b2 = 1⋅1+1⋅ 0 = 1

55

Liedl / Dietrich Mathematical Methods

Fig. 6.2: Illustration for the calculus of scalar product.

The following rules are valid for the scalar product:     a ⋅b = b ⋅ a (commutative law),       a(a ⋅b) = (aa) ⋅b = a ⋅ (ab) (associative law for multiplication with a real number) and        a ⋅ (b + c) = a ⋅b + a ⋅ c (distributive law).

      In general, it is not true that a ⋅ (b ⋅ c) = (a ⋅b) ⋅ c .

If the scalar product of two vectors is equal to 0 then the vectors are perpendicular.

Example:  3   2  a =   , b =   1 − 6

  a ⋅b = 3⋅ 2 +1⋅ −6 = 0

  Conclusion: a and b are perpendicular.

6.3.2 Vector Product (Cross Product)

In addition to the scalar product, there exists another vector product, in which the result is a     new vector. This product is called the vector product a ×b of the vectors a and b . The   length of the resulting vector is equal to the area of the parallelogram ( = a b sinϕ ) spanned       by a and b (see Fig. 6.3). The resulting vector is perpendicular to a and b such that a , b   and a × b form a right-handed system. In Cartesian coordinates it can be calculated using the formula      a ×b = (a ybz − azby )ex + (azbx − axbz )ey + (axby − a ybx )ez (Eq. 6.7) Example: 1 0       a = 0 b = 1     0 0

      c = a × b = (0 ⋅ 0 − 0 ⋅1)ex + (0 ⋅ 0 −1⋅ 0)e y + (1⋅1− 0 ⋅ 0)ez

56

Liedl / Dietrich Mathematical Methods

0    c = 0   1

Fig. 6.3: Illustration for the calculus of vector product.

The following rules are valid for the vector product:     a × b = −b × a (not commutative, alternative),       a(a × b) = (aa) × b = a × (ab) (associative law for multiplication with a real number)        a × (b + c) = (a × b) + (a × c) (distributive law).

      In general, it is not true that a × (b × c) = (a × b) × c .

If the vector product of two vectors is equal to 0 then the vectors are collinear.

6.3.3 Multiple Products of Vectors

The two different types of vector products can occur multiplied and also together. An example    is the vector triple product a × (b × c) . The result of this product is a vector which is coplanar   with the vectors b and c . This fact is reflected in the expansion theorem:

         a × (b × c) = (a ⋅ c) ⋅b − (a ⋅b) ⋅ c (Eq. 6.8)

Example: 0 1 0          a = 1 , b = 0 , c = 1       1 0 0

57

Liedl / Dietrich Mathematical Methods

0 0 1          a × (b × c)= 1 × 0 = 0       1 1 0

         a × (b × c)= (a ⋅ c)b − (a ⋅b)c

1 0 1       = 1⋅0 − 0 ⋅1 = 0       0 0 0

   The scalar triple product (a × b) ⋅ c is a combination of the different types of products of vec-   tors resulting in a scalar which is equal to the volume of the parallelepiped spanned by a , b  and c . It is positive if the three vectors form a right-handed system, and negative otherwise.   The scalar triple product can also be written as (abc) . In Cartesian coordinates, it can be cal- culated using the formula

  (abc) = (by cz − bz c y )ax + (bz cx − bx cz )a y + (bx c y − by cx )az (Eq. 6.9)

If two of the vectors are interchanged in the product, the sign changes          (abc) = −(acb) = −(bac) = −(cba) . The reason is the alternative behaviour of the vector product. The scalar triple product can be used to evaluate the linearity of three vectors. If and   only if (abc) ≠ 0 then the vectors are linearly independent.

Furthermore, there exists an exchange theorem for the combination of the two product types:

      (a × b) ⋅ c = a ⋅ (b × c) (Eq. 6.10)

A further useful relation, which is based on the two products of vectors, is Lagrange's identity

            (a × b) ⋅ (c × d) = (a ⋅ c)(b ⋅ d) − (b ⋅ c)(a ⋅ d) (Eq. 6.11)

6.4 Applications of Vectors in Geometry

Vector algebra gives a simple representation of an analytic geometry formulae and simplifies some geometrical calculations.

6.4.1 Applications of Vectors for Geometrical Calculations

Vector calculus is very useful for the calculation of distances, areas and volumes of different geometrical shapes. Some examples for such applications are given in Table 6.1.

58

Liedl / Dietrich Mathematical Methods

Tab. 6.1: Examples for the application of vectors for geometrical calculations Designation Vectorial formula   Distance between two points, which are d = a − b   defined by the radius vectors a and b   Area of the parallelogram spanned by the A = a × b   vectors a and b Area of a triangle which is formed by three 1   1      A = a × b = b × c = vectors a , b and c 2 2

  Volume of the parallelepiped spanned by the V = (abc)    vectors a ,b and c     Angle between the vectors a and b ab cosϕ =   a b

6.4.2 Equations of a Straight Line

Using vectors, a straight line in space can be expressed by the following formula (see also Fig. 6.4)    x = x0 + λ v (Eq. 6.12)

  Thereby, x0 is the radius vector of a selected point on the straight line and v represents the direction of the line. The coefficient λ can take an arbitrary value.

Example: 2  =   x0   1

 1 v =   1

 2 1 x =   + λ  1 1

Fig. 6.4: Representation of a straight line by vectors.

59

Liedl / Dietrich Mathematical Methods   Another possibility is to use the normal vector n which is perpendicular to the vector v (see fig 6.5).

       n ⋅ (x − x0 ) = 0 respectively n ⋅ x = n ⋅ x0 = np (Eq. 6.13)

Continuation I of Example:  1  1  1 n =   , p = 2 −1 2   1 1 1 n ⋅ x0 = 2 ⋅ +1⋅ − = 1 = n ⋅ p = 1⋅ 2 2 2

Thereby, p is the assigned distance of the line to the origin of the coordinate system and n is the magnitude of the normal vector. In the case of two dimensions, the Hesse normal form can be derived from the above formula using the representation with the scalar components

x cosϕ + y sinϕ − p = 0 (Eq. 6.14)

Continuation II of Example: ϕ = −45 1 x ⋅ cos(− 45 )+ y sin(− 45 )− = 0 2

with ϕ as the angle between the x-axis and the normal vector. The angle can be calculated us- p p ing the intercept of the line with the x-axis ( cosϕ = ) or the y-axis ( sinϕ = ). a b

The Hesse normal form can also be used for the calculation of the distance d of a given point  p p p x = (x , y ) to the straight line

d = x p cosϕ + y p sinϕ − p (Eq. 6.15)

Continuation III of Example:

 p 3 x =   2 1 d = 3⋅ cos(− 45 )+ 2 ⋅sin(− 45 )− 2 1 −1 2 1 = 3⋅ + 2 ⋅ − 2 = 0 2 2 2

 p Conclusion: x is lying on a straight line.

60

Liedl / Dietrich Mathematical Methods

Fig. 6.5: Representation of a line using the normal vector.

The intercepts of the line with the axes can further be used for the intercept equation of a line x y + = 1 (Eq. 6.16) a b

In the following, other well-known representations of a straight line are given for complete- ness

y − y1 y2 − y1  2 a) Two-point equation: = ( x = (x2 , y2 ) as a second point of the x − x1 x2 − x1 line),

y − y1 1 b) Point-slope form: = m ( x = (x1 , y1 ) as a point of the line), x − x1

c) Normal form: y = mx + n (m - slope of the line, n=b - line segment).

Continuation IV of Example:

x y intercept equation: + = 1 1 −1 y −1 2 −1 two-point equation: = x − 2 3 − 2 y −1 point-slope form: = 1 x − 2 normal form: y = 1x + (−1) = x −1

61

Liedl / Dietrich Mathematical Methods

6.4.3 Equations of a Plane

It is also possible to describe the set of all points of a plane in a multi-dimensional space using vectors. The first possibility is similar to the vector representation of a straight line (see Fig. 6.6)

    x = x0 + λ v + µ w (6.16)

Fig. 6.6: Representation of a plane by vectors.

 Thereby, x0 is the radius vector of a selected point of the plane spanned by the linearly inde-   pendent vectors v and w . The coefficients can take arbitrary values.

 Another possibility is to use the normal vector n , which is perpendicular to each vector in the plane        n ⋅ (x − x0 ) = 0 respectively n ⋅ x = n ⋅ x0 = np (Eq. 6.17)

Thereby, p is, as for the straight line, the assigned distance of the plane to the origin of the co- ordinate system and n is the magnitude of the normal vector. Using the above equation a Hes- se normal form for the plane in the three-dimensional space can also be derived

x cosα + y cosβ + z cosγ − p = 0 (Eq. 6.18)

 p p p p and a formula for the calculation of the shortest distance between a point x = (x , y , z ) and the given plane.

d = x p cosα + y p cosβ + z p cosγ − p (Eq. 6.19)

 The angle α, β and γ are between the axes and the normal vector n . The direction cosines can be calculated using the intercepts of the plane a, b and c with the axes

a b c cosα = , cosβ = and cosγ = (Eq. 6.20) a 2 + b2 + c2 a 2 + b2 + c2 a 2 + b2 + c2

62

Liedl / Dietrich Mathematical Methods

The plane can also be represented by an intercept equation as for the line

x y z + + = 1 (Eq. 6.21) a b c

63

Liedl / Dietrich Mathematical Methods 7 Matrices and Determinants

The relationship between different parameter sets and the description of an individual parame- ter set can be represented using tables. An appropriate mathematical tool for the calculus with such "tables" is matrix algebra.

Example:

Table (a) Table (b) Z1 Z2 E1 E2 E3 R1 2 1 Z1 1 2 4 R2 0 2 Z2 6 3 2 R3 3 1 R4 5 0 R5 3 4

Ri - raw material Zi - intermediate product Ei - final product

7.1 Definition of a Matrix

A matrix A is a set of m*n quantities arranged in a rectangular array of m rows and n columns

 a a  a   11 12 1n   a21 a22  a2n  A =   (Eq. 7.1)         am1 am2  amn 

The entries aij in a matrix are called elements of the matrix. Their position in the array is given by the double indices, the first indicating the row and the second the column. The single col- umns (rows) are called column (row) vectors.

The number of rows and columns determines the order of the matrix. A matrix of m rows and n columns is said to be of the order (m*n). A matrix with the same number of rows and col- umns is a square matrix of order n. A column matrix has only one column of elements. The row matrix has only one row of elements.

If the rows and columns of a matrix are interchanged, a new matrix called the transposed ma- trix is obtained. It is denoted by T. For example, if A is a (3*2) matrix

 a a   11 12  A = a21 a22  (Eq. 7.2)   a31 a32 

then its transpose is the (2*3) matrix

T  a 11 a 21 a 31  A =   (Eq. 7.3) a 12 a 22 a 32 

64

Liedl / Dietrich Mathematical Methods

A matrix in which every element is zero is called a zero or null matrix, 0. 7.2 Matrix Algebra

Two matrices A and B are equal only if they are of the same order and if all their correspond- ing elements are equal (i.e. aij = bij).

The addition and subtraction of matrices is only possible if the used matrices are of the same order and the number of rows and columns equal. The addition and subtraction is carried out as an operation of the corresponding elements

A ± B = C ↔ aij ± bij = cij for each pair I and j. (Eq. 7.4)

Hence, it follows that the addition of matrices is associative and commutative.

Example: 3 4 1 1     A = 2 4 , B = 0 2     1 2 0 3

 3 +1 4 +1 4 5     C = A + B = 2 + 0 4 + 2 = 2 6     1+ 0 2 + 3 1 5

Like vectors, matrices can also be multiplied by a scalar. The result of such an operation is de- fined as a matrix whose elements are calculated by multiplying each element of the original matrix with the scalar. For example, if

3 4 3k 4k  A =   then B = kA =   . (Eq. 7.5) 2 1 2k 1k 

It is also possible to multiply two matrices A and B together to form their product C (=AB). The prerequisite is that the number of columns of A is equal to the number of rows of B. The resulting matrix has the same numbers of rows as A and of columns as B. The elements of C are defined by

p

c jk = ∑ a jsbsk , (Eq. 7.6) s=1 where p is the number of columns of A and rows of B, respectively. For example, if A and B are (3*2) and (2*3) matrices, respectively given by

 a a   11 12   b b b  = =  11 12 13  A a21 a22  and B     b21 b22 b23  a31 a32 

65

Liedl / Dietrich Mathematical Methods

then the product C=AB is a (3*3) matrix defined as

 a b + a b a b + a b a b + a b   11 11 12 21 11 12 12 22 11 13 12 23  C = a21b11 + a22b21 a21b12 + a22b22 a21b13 + a22b23  .    a31b11 + a32b21 a31b12 + a32b22 a31b13 + a32b23 

This example clearly shows that the matrix multiplication is not commutative. In contrast to AB, the result of BA is in this case a matrix of the order (2*2).

Example: 3 4 7 8 12     T 1 0 0 A ⋅ B = 2 4   = 6 8 12   1 2 3   1 2 3 4 6 

3 4   T 1 0 0  3 4  B ⋅ A =   2 4 =   1 2 3   10 18 1 2

This non-commutative property of matrix multiplication appears even when A and B are ma- trices of the same order. However, apart from this non-commutative behaviour of matrix mul- tiplication, matrices satisfy the associative and distributive laws of multiplication

(AB)C = A(BC) and (A + B)C = AC + BC . (Eq. 7.7)

Division of matrices is not defined, i.e. it is not possible.

7.3 Determinants

A squared matrix can be characterised by a single number, the determinant.

 a a  a  a a  a  11 12 1n  11 12 1n a21 a22  a2n  a21 a22  a2n D = det A = det  = (Eq. 7.8)             an1 an2  ann  an1 an2  ann

66

Liedl / Dietrich Mathematical Methods

7.3.1 Calculation for 2x2- and 3x3-Matrices

For squared matrices of the order 2 and 3, simple formulas exist for the calculation of the de- terminant. For the case of a (2*2)-matrix, the determinant is obtained by

Example:

a11 a12 = a11a22 − a21a12 a21 a22

3 1 = 3⋅ 2 −1⋅ 0 = 6 0 2 To calculated the determinant of a (3*3) matrix, the following formula can be used

a11 a12 a13

a21 a22 a23 = a11a22 a33 + a12 a23a31 + a13a21a32 − a13a22 a31 − a11a23a32 − a12 a21a33 (Eq. 7.9)

a31 a32 a33

Example: 3 2 1 6 4 2 = 0 1 1 0

7.3.2 Calculation Using Cofactors

Determinants of matrices of higher order can be calculated using the cofactors of the elements of the matrices. A cofactor is a minor of the whole matrix A (meaning that it is a partial matrix i+j of A). For each element aij of A, the cofactor of aij is defined as (-1) times the minor of A, which is obtained by deleting the i-th row and the j-th column. This is denoted by Aij:

a11 a12  a1, j−1 a1, j+1  a1n

a21 a22  a2, j−1 a2, j+1  a2n        i+ j Aij = (−1) ai−1,1 ai−1,2  ai−1, j−1 ai−1, j+1  ai−1,n . (Eq. 7.10)

ai+1,1 ai+1,n  ai+1, j−1 ai+1, j+1  a1+1,n       

an1 an2  an, j−1 an, j+1  ann

The determinant of the matrix A can then be calculated using the Laplace expansion for any fixed k

67

Liedl / Dietrich Mathematical Methods

n n det A = ∑ aik Aik = ∑ aki Aki . (Eq. 7.11) i=1 i=1

This means that the determinant is equal to the sum of the elements of the k-th row (or column) with their cofactors.

Example: 3 2 1 det A = 6 4 2 1 1 0

1+1 4 2 1+2 6 2 1+3 6 4 det A = 3⋅ (−1) ⋅ + 2 ⋅ (−1) ⋅ +1⋅ (−1) ⋅ 1 0 1 0 1 1 det A = 3⋅ (4 ⋅ 0 − 2 ⋅1)− 2 ⋅ (6 ⋅ 0 − 2 ⋅1) +1⋅ (6 ⋅1− 4 ⋅1) det A = 0

7.3.3 Calculation Rules for Determinants

There exist some rules for the calculation of determinants, which can reduce the efforts of cal- culation

• The value of a determinant is not changed if the determinant is mirrored at the leading di- agonal. • The value of a determinant is not changed if a linear combination of the other rows (col- umns) is added to a row (column). • A determinant has the value zero if a row or a column contains only zeros. • A determinant has the value zero if a row (column) is a linear combination of the other rows (columns). • A determinant changes sign if two rows (columns) are changed. • If all elements of a row (column) are multiplied by a factor, then the value of the determi- nant is also multiplied by this factor. • If two square matrices are multiplied, then the determinant of the resulting matrix is equal to the product of the determinants of the input matrices.

7.3.4 Use of Determinants in Vector Algebra and Geometry

The use of the determinant allows for a simple expression for the multiplication of vectors. For example, the vector product can be written as follows

   i j k   a × b = ax a y az . (Eq. 7.12)

bx by bz

Thereby, the elements ax, ay, az and bx, by, bz, respectively, are the scalar components of the      vectors a and b . The vectors i , j and k are the unit vectors in the directions of the coordi- nate axes. The triple scalar product can be expressed very simply using a determinant

68

Liedl / Dietrich Mathematical Methods

ax a y az      (a ×b )⋅ c = (abc)= bx by bz . (Eq. 7.13)

cx c y cz

The determinant notation is also useful for geometrical problems. The volume Vt of a tetraeder can be calculated with the formula

x0 y0 z0 1

1 x1 y1 z1 1 Vt = with the corner points Pi = (xi , yi ,zi ); j = 0,1,2,3. (Eq. 7.14) 6 x2 y2 z2 1

x3 y3 z3 1

If Vt is equal to zero it follows that all four points are in one plane.

7.4 Special Types of Matrices

There are some additional special types of matrices. The identity or unit matrix, I is a square matrix in which each element in the leading diagonal is 1 and all other elements are zero

1 0  0   0 1  0 I =   (Eq. 7.15)         0 0  1

Another important matrix is the inverse or inverse matrix. The inverse matrix exists only for square matrices. The inverse of a matrix A is denoted by A-1. The product of a matrix with the corresponding inverse is equal to the unit matrix.

A⋅ A−1 = I (Eq. 7.16)

An inverse matrix exists only if the determinant of the matrix is not equal to zero. Further- more, the following rule exists for invertable matrices A and B

(AB)-1=B-1A-1 (Eq. 7.17)

For the calculation of the inverse of a matrix A, two methods exist.

First method: The matrix equation A⋅ X = I , where the elements of X are unknown, leads to n systems of linear equations. Each system contains n equations with n unknowns. The solu-

69

Liedl / Dietrich Mathematical Methods tion of each of these systems gives a column of the inverse X = A−1 . (For the solution of lin- ear equation systems see chapter 8).

Second method: The inverse of a matrix A can also be calculated using the determinant and the cofactors of the matrix A

T  A A  A   11 12 1n  −1 1  A21 A22  A2n  A =   (Eq. 7.18) det A          An1 An2  Ann 

In the case of square matrices there are the following possible distinctions. A square matrix A of order n is called:

symmetric if AT= A skew-symmetric if AT=-A orthogonal if AT=A-1 diagonal if aij=0 for all i ≠ j upper triangular if aij=0 for all i > j lower triangular if aij=0 for all i < j

The following propositions exist related to these definitions: 1. For every matrix A, both AAT and ATA are symmetric. 2. Every square matrix can be decomposed into the sum of a symmetric and a skew- symmetric matrix:

A = (A + AT )/ 2 + (A − AT )/ 2 (Eq. 7.19)

3. A matrix A of order n is orthogonal if, and only if, its row vectors and its column vectors, respectively, form an orthonormal basis of the space Rn. 4. Orthogonal matrices have a determinant equal to ±1. 5. If the matrices A and B are orthogonal, then so are AB and A-1.

70

Liedl / Dietrich Mathematical Methods 8 Solving Linear Equation Systems

Many problems in the natural sciences can be approximated using linear equation systems. An example from geosciences is the calculation of a stationary two-dimensional hydraulic head distribution based on a known transmissivity distribution and known boundary conditions.

8.1 Definition of Linear Equation Systems

A system of linear equations consists of a set of m equations, which are linear in terms of n unknowns xi:

a11 x1 + a12 x2 +  + a1n xn = b1

a21 x1 + a22 x2 +  a2n xn = b2 (Eq. 8.1)     = 

am1 x1 + am2 x2 ++ amn xn =bm

The aik values are called coefficients of the system, the bi are the constant terms and the left sides of the equations are the linear forms. An ordered n-tuple (x1,...,xn) of numbers is a solu- tion of the system if these numbers make each equation valid. The collection of all possible solutions is called the solution set. Two linear equation systems are equivalent if they have the same solution set.

The solution set of a linear equation system would not be changed • if a single equation is multiplied by a scalar, which is not equal to zero. • if two equations of the system are interchanged. • by adding a multiple of one equation to another.

The matrix equation Ax=b delivers an equivalent representation of the linear equation system. Thereby, A is the coefficient matrix, x the vector of unknowns and b the column vector of the right side of the equation system:

a11 a12  a1n  x1  b1        a21 a22  a2n x2 b2 A =   , x =   , b =   . (Eq. 8.2)                   am1 am2  amn  xn  bm 

The extended matrix (A,b) has a special meaning

a11 a12  a1n b1    a21 a22  a2n b2 (A,b) =   . (Eq. 8.3)          am1 am2  amn bm 

71

Liedl / Dietrich Mathematical Methods

8.2 Existence of Solutions

Three cases are possible for a linear equation system: no solution, a unique solution or an infi- nite number of solutions. The behaviour of the system can be determined using the rank of the coefficient matrix A and the rank of the extended matrix (A,b).

The rank of a matrix is defined as the number of rows, which are linearly independent. That means the rank gives the number of equations, which are sufficient for the construction of all equations of the linear system. If the coefficient matrix A is a square matrix and its determi- nant is not equal to zero, then the order of the matrix is equal to the rank. The linear equation system has in this case a unique solution.

A linear equation system has solutions if the rank of the coefficient matrix A is equal to the rank of the extended matrix. Otherwise, the equation system cannot be solved. In the case that the ranks of the two matrices are equal, the number of solutions can be derived from the com- parison of the rank and the number of unknowns. The equation system has a unique solution if the rank is equal to the number of unknowns. If the common rank of the two matrices is less than the number of unknowns, then an infinite number of solutions exist.

8.3 Use of Matrix Calculus

Because a linear equation system can also be understood as a matrix equation, the use of ma- trix calculus is one possibility of solving such a system.

8.3.1 With the Inverse

If the equation system has the same number of equations and unknowns, and the determinant of the coefficient matrix is not equal to zero, then the inverse of the coefficient matrix can used for solving.

Ax = b − − A 1 Ax = Ix = A 1b (Eq. 8.4) x = A−1b

1 3 4 0     Example: A = 2 0 1 , b = 0   3 1 2 1 −1 − 2 3  −1 1   A = −1 −10 7 4    2 8 − 6 4 0 0 1 0 0 −1 1     A⋅ A = 0 4 0 = 0 1 0 = I 4     0 0 4 0 0 1

72

Liedl / Dietrich Mathematical Methods

 3/ 4  −   A 1 ⋅b =  7 / 4  = x   − 6 / 4 1 3 4 3/ 4  0      A⋅ x = 2 0 1 7 / 4  = 0 = b     3 1 2− 6 / 4 1

8.3.2 Cramer's Rule

In the special case of a system with n equations and n unknowns, and a unique solution, it is possible to calculate the solution of a single component without solving the complete system. In this case, Cramer's rule is applied. Using this rule, the value of a selected unknown xi is calculated with

D x = i . (Eq. 8.5) i D

Thereby D is the determinant of the coefficient matrix and Di is the determinant of the matrix which is gained by replacing the i-th column of the coefficient matrix by the column of con- stant terms.

a11  a1i  a1n a11  b1  a1n

D = det    Di = det    (Eq. 8.6)

an1  ani  ann an1  bn  ann

Example: I. 3x1 – 4x2 + x3 = 9, II. x1 + x2 – 5x3 = -10, III. 6x1 + 2x2 + 4x3 = 12;

3 − 4 1 9 − 4 1

D = 1 1 − 5 = 174 ; D1 = −10 1 − 5 = 174 ; 6 2 4 12 2 4

3 9 1 3 − 4 9

D2 = 1 −10 − 5 = 174 ; D3 = 1 1 −10 = 348; 6 12 4 6 2 12

D D D x = 1 = 1; x = 2 = −1; x = 3 = 2 . 1 D 2 D 3 D

3 + 4 + 2 = 9, 1 – 1 – 10 = -10, 6 – 2 + 8 = 6.

73

Liedl / Dietrich Mathematical Methods

8.3.3 With Transformation Matrices

Another way to solve the linear equation system is with the use of addition and exchange ma- trices. As opposed to the application of the inverse, this method can also be applied when the numbers of equations and unknowns are different or the determinant of the coefficient matrix is equal to zero.

The so-called addition matrix, Akl(t) arises from the unit matrix after replacing the element akl with the quantity t. The following examples show how an addition matrix operates

Example:

1 t a11 a12  A12 (t) =   , A =   0 1 a21 a22 

a11 + ta21 a12 + ta22  A12 (t) A =    a21 a22 

a11 ta11 + a12  AA12 (t) =   a21 ta21 + a22 

The application of an exchange matrix, Ckl leads to an interchanging of rows (if Ckl is multi- plied from the left side) or an interchanging of columns (if Ckl is multiplied from the right side). The indices k and l represent the number of rows (columns) which are interchanged.

1 0 0 a11 a12 a13  =   =   C23 0 0 1 , A a21 a22 a23  , 0 1 0 a31 a32 a33 

a11 a12 a13  a11 a13 a12  =   =   C23 A a31 a32 a33  and AC23 a21 a23 a22  . (Eq. 8.7)   a21 a22 a23  a31 a33 a32 

Based on the transformation matrices, the solution of a linear equation system can be deter- mined by a transform of the coefficient matrix into a triangular matrix (see section 7.4). The same transformation must be applied to the column vector of the right sides of the equations. In this way, a linear equation system A*x=b* arises, which can be easily solved. The reason is that the number of unknowns increased from one equation to the next.

74

Liedl / Dietrich Mathematical Methods

8.4 Gaussian Algorithm

The Gaussian algorithm is based on a similar idea. It was developed by Carl Friedrich Gauss for the interpretation of the data from a cadastral survey. The aim of the Gaussian algorithm is to transform the original equation system

a11 x1 + a12 x2 +  + a1n xn = b1

a21 x1 + a22 x2 +  a2n xn = b2 (Eq. 8.8)     = 

am1 x1 + am2 x2 ++ amn xn =bm into a system of a triangle form

a'11 x1 + a'12 x2 ++ a'1n xn = b'1

a'22 x2 +  a'2n xn = b'2 (Eq. 8.9)   = 

a'mn xn =b'm

Such a system only arises if the rank of the coefficient matrix is equal to the number of un- knowns and to the rank of the extended matrix. If the two ranks are different, then the Gaussi- an algorithm leads to rows where the left side is zero but the right side is not zero. In this case, the equation system cannot be solved. If the two ranks are equal but are less than the number of unknowns, then the last row contains two or more terms with unknowns.

The sought form of the equation system can be constructed in the following way: 1. Select an elimination equation, where the first coefficient is different from zero. 2. Multiply this elimination equation by factors c21, c31, ..., cn1 and add it to the second, third,

al1 ..., m-th equations. The equation (row) specific factors are calculated by cl1 = − . a11 3. The resulting equation system contains, only in the first equation, a coefficient for the first unknown. Now the first equation would be ignored, and the same procedure is carried out again for the remaining equations until only one or no unknowns remain in the resulting equation(s).

It is useful, when the factors c21, c31, ..., cn1 are small, to reduce the numerical inaccuracy. Se- lecting the equation with the greatest coefficient as the elimination equation can attain this.

For practical purposes, the following scheme is recommended for the Gaussian algorithm (on- ly the coefficients and constants are written):

75

Liedl / Dietrich Mathematical Methods

x1 x2 x3 ... xn bi si test σ1 σ2 σ3 ... σn σ S ? * a11 a12 a13 ... a1n b1 s1 0 c21 a21 a22 a23 ... a2n b2 s2 0 ------... ------? c31 a31 a32 a33 ... a3n b3 s3 0 1. step ------... ------? ...... cm1 am1 am2 am3 ... amn bm sm 0 ------... ------? * 0 a'22 a'23 ... a'2n b'2 s'2 ? c32 0 a'32 a'33 ... a'3n b'3 s'3 ? ------... ------? 2. step ...... cm2 0 a'm2 a'm3 ... a'mn b'm s'm ? ------... ------? 0 a''33 ... a''3n b''3 s''3 ? ......

At the end of the transformation, the equations indicated by * give an equation system in the form of a triangle or a trapezoid (if more than one solution exists). This system can then be easily used for the calculation of the solution of the equation system.

The coefficients σi, si and S are introduced for an effective control of the error-free progress and a shortened control of the final result. The coefficients σi in the second row are equal to the column sums of the coefficients of the original equation system

m m

σ i = ∑aik σ = ∑bk . (Eq. 8.10) k =1 k =1

* * * Therefore, the following equation must be valid if the solution (x 1, x 2,..., x n) is correct

n * σ = ∑σ k xk . (Eq. 8.11) k =1

n

To continuously check for calculation errors, the so-called sum tests si = ∑aik si are used. To k =1 these sum tests, the same transformations are applied as for the corresponding equation. The transformed sum tests are then compared with the corresponding sum of the new coefficients. Such continuous controls increase the security of the calculation and in doing so can reduce unnecessary work.

Example: 0.783x1 + 2.525x2 – 1.253x3 + 2.000x4 = 1.361, 5.777x1 - 1.300x2 + 2.710x3 – 3.987x4 = 8.477, 2.655x1 + 1.875x2 + x3 + x4 = 8.988, x1 - x2 + 0.731x3 - x4 = 1.111.

76

Liedl / Dietrich Mathematical Methods

k = 1 2 3 4 ai si Probe 10.215 2.100 3.188 -1.987 19.937 33.453 0.006 1st Step * 5.777 -1.300 2.710 -3.987 8.477 11.677 0 -0.1355 0.783 2.525 -1.253 2.000 1.361 5.416 0 -0.783 0.176 -0.367 0.540 -1.149 -1.582 0.001 -0.4596 2.655 1.875 1.000 1.000 8.988 15.518 0 -2.655 0.597 -1.246 1.832 -3.896 -5.367 0.001 -0.1733 1.000 -1.000 0.731 -1.000 1.111 0.842 0 -1.000 0.225 -0.470 0.691 -1.469 -2.024 -0.001 * 0 2.701 -1.620 2.540 0.212 3.834 0.001 2nd Step -0.9152 0 2.472 -0.246 2.832 5.092 10.151 0.001 -2.472 1.483 -2.325 -0.194 -3.509 0.001 0.2869 0 -0.775 0.261 -0.309 -0.358 -1.182 0.001 0.775 -0.465 0.729 0.061 1.100 0 * 0 1.237 0.507 4.898 6.642 0.000 3rd Step 0.1649 0 -0.204 0.420 -0.297 -0.082 0.001 0.204 0.084 0.808 1.095 0.002 0 0.504 0.511 1.013 0.002

5.777x1 – 1.300x2 + 2.710x3 + 3.987x4 = 8.477, 2.701x2 – 1.620x3 + 2.540x4 = 0.212, 1.237x3 + 0.507x4 = 4.898, 0.504x4 = 0.511

x4 = 1.013, x3 = 3.544, x2 = 1.251, x1 = 0.785.

8.5 Homogeneous and Inhomogeneous Systems

For the case in which only a unique solution exists, it can be calculated using the solving methods described in the foregoing sections. If there exist more than one solution, the com- plete solution set can be calculated using the separation of homogeneous and inhomogeneous equation system.

If all constants on the right sides of the equations are equal to zero, the equation system is a homogeneous system. Otherwise, if at least one coefficient of the right side is different from zero, the equation system is inhomogeneous. Based on this definition, each inhomogeneous system and corresponding homogeneous system can be defined.

The complete solution set of an inhomogeneous linear equation system can be expressed by the sum of a single solution of the inhomogeneous system xI and the solution set of the homo- geneous system xH

x = xI + xh . (Eq. 8.12)

77

Liedl / Dietrich Mathematical Methods

For the calculation of the solution xI, all these unknowns are set equal to zero, for which no equations exist in the result of the Gaussian algorithm. That means if k is the rank of the equa- tion system for n unknowns, then the last (n-k) unknowns are set to zero. The values of the other unknowns for a solution of the equation system can then be easily calculated from the resulting equations.

Each homogeneous equation system has at least one solution. If the rank k of the coefficient matrix is equal to the number n of the unknowns, then this solution is the trivial solution (zero for all unknowns). In the other case, an infinite number of solutions exist. All these solutions can be calculated by substituting the last (n-k) unknowns by a set of variables νl. Using this substitution, values for all other unknowns can be calculated (e.g. from the result of Gaussian transformation). By separating the expression for the different variables, the solution set of the homogeneous equation system can be written as a sum of vectors

n l xH = ∑ν l x , (Eq. 8.13) l=(n−k )

l whereby x is the vector which contains all coefficients of the expressions with the variable νl. The l-th component of this vector is equal to one, and the components corresponding to the other variables are equal to zero.

The complete solution set of the inhomogeneous system is then

n l x = xI + ∑ν l x . (Eq. 8.14) l=(n−k )

Example: x1 + 2x2 – x3 – x4 = -3, 3x1 + x2 + 2x3 + x4 = 4, 2x1 – x2 + x3 – x4 = 1, -2x1 – 4x2 + 2x3 + 2x4 = 6. After some transformation the following system can result: x1 + 2x2 – x3 – x4 = -3, -5x2 + 5x3 + 4x4 = 13, -2x3 – 3x4 = -6. The homogeneous equation system is: x1 + 2x2 – x3 – x4 = 0, -5x2 + 5x3 + 4x4 = 0, -2x3 – 3x4 = 0, 9 7 3 and has the general solution x1 = c , x2 = − c , x3 = − c , x4 = c1 or 10 1 10 1 2 1  9   10   7  −  = xh c1  10 . 3  −   2   1 

78

Liedl / Dietrich Mathematical Methods

For the determination of a special solution of the inhomogeneous system, x4 is set to zero. 4 2 The solutions for the other unknowns are: x1 = − , x2 = , x3 = 3; 5 5  4 −  5  2  x =   . 0  5   3     0  By combining the solutions of the homogeneous and the inhomogeneous, the complete solu- tion of the equation system can be expressed:  9   4   − 10  5  7    −  2 x = x + x = c +   . h 0 1  10 5 3    −   3   2   0   1   

79

Liedl / Dietrich Mathematical Methods

9 Coordinate Transformations

A coordinate transformation can be a useful tool for simplification of problems in the natural sciences. An example is the use of polar coordinates in a homogeneous aquifer for the de- scription of radial flow to a pumping well. 9.1 Definition and Types of Coordinate Systems

A coordinate system is a system of geometrical objects, which can be used to describe the po- sition in a space of other objects, one of which being the coordinate origin. The scaling factors (coefficients), which are necessary for the unique description of a point’s position using the objects of the coordinate system, are called coordinates. They can be presented in the form of a vector.

An example is the two-dimensional Cartesian coordinate system. The system of geometrical objects consists in this case of the coordinate origin and the two unit vectors in the directions of the x- and y-axis. The x- and y-value, which describe the position of a point in this system, are the coordinates of this point.

Some common examples of coordinates systems are: • the linear coordinate systems (e.g. the Cartesian system), • the curvilinear coordinate systems (e.g. the polar coordinate system) and • the barycentric coordinate systems.

A coordinate transformation allows the position of a point in one coordinate system to be ex- pressed by the objects of a new coordinate system, which may still be of the same type as the original coordinate system.

9.2 Polar and Cylindrical Coordinates

Appropriate coordinate systems for the description and solution of problems with a radial symmetric behaviour are the polar (2D) and the cylindrical coordinate systems (3D). If the or- igins of a Cartesian and a polar coordinate system are identical, the transformations between the two systems can be carried out with the following formulas

Cartesian coordinate system (x, y) → Polar coordinate system (r,φ)

y y r = x 2 + y 2 φ = arctan = arcsin (Eq. 9.1) x x 2 + y 2

Polar coordinate system (r,φ) → Cartesian coordinate system (x, y)

x = r ⋅ cosφ y = r ⋅sinφ (Eq. 9.2)

From these transformation equations, it is clear that polar coordinate r is always greater or equal to zero. The angle φ is positive and counter clockwise orientated ( 0 ≤ φ < 2π ).

80

Liedl / Dietrich Mathematical Methods

If the origins of the two systems are not identical, then an additional translation in the Carte- sian system is necessary for the transformation. Assuming the origin of the polar coordinate system has the coordinates a and b in the Cartesian system, then the transformation equations are

Cartesian coordinate system (x, y) → Polar coordinate system (r, φ)

y − b y − b r = (x − a) 2 + (y − b) 2 , φ = arctan = arcsin . (Eq. 9.3) x − a (x − a) 2 + (y − b) 2

Polar coordinate system (r, φ) → Cartesian coordinate system (x, y)

x = r ⋅ cosφ + a , y = r ⋅sinφ + b . (Eq. 9.4)

The relationships between the three-dimensional Cartesian coordinate system and the cylin- drical coordinate system are very similar to the above formulas. For the more general case, where the origin of the cylindrical coordinate system has the coordinates x=a and y=b in the Cartesian system, the following transformation equations are valid

Cartesian coordinate system (x, y, z) → Cylindrical coordinate system (r, φ, z)

y − b y − b r = (x − a) 2 + (y − b) 2 ,φ = arctan = arcsin , z = z (Eq. 9.5) x − a (x − a) 2 + (y − b) 2

Cylindrical coordinate system (r, φ, z) → Cartesian coordinate system (x, y, z)

x = r ⋅ cosφ + a , y = r ⋅sinφ + b , z = z (Eq. 9.6)

9.3 Spherical Coordinates

For central-symmetric problems, the application of spherical coordinate systems is recom- mended. A point is described in a spherical coordinate system by a distance to the origin (r) and the two spatial angles φ and θ. The relationship between a Cartesian and a spherical coor- dinate system can be described by the following:

Cartesian coordinate system (x, y, z) → Spherical coordinate system (r, φ, θ)

y − b y − b r = (x − a) 2 + (y − b) 2 + (z − c) 2 , φ = arctan = arcsin , x − a (x − a) 2 + (y − b) 2 (x − a) 2 + (y − b) 2 θ = arctan . (Eq. 9.7) z − c

Spherical coordinate system (r, φ, θ) → Cartesian coordinate system (x, y ,z)

x = r ⋅ cosφ ⋅sinθ + a , y = r ⋅sinφ sinθ + b , z = r ⋅ cosθ + c . (Eq. 9.8)

81

Liedl / Dietrich Mathematical Methods

Thereby, a, b and c are the origin coordinates of the spherical coordinate system in the Carte- sian coordinate system. The following ranges exist for the coordinates of the spherical system: r ≥ 0, 0 ≤ φ < 2π , 0 ≤ θ ≤ π . (Eq. 9.9) 9.4 Transformation of Parallel Coordinate Systems

Parallel coordinate systems are coordinate systems, which consist of an origin and a linear co- ordinate axes. The angle between the coordinate axes does not need to be equal to 90 degrees. The Cartesian coordinate system is a special case of the parallel coordinate systems.

The transformation of parallel coordinate systems plays a very important role in geosciences. For instance, it is necessary for the work with geographical information systems (GIS). An- other example is the transformation of a local coordinate system, which is useful for the exe- cution of a field measurement into more general coordinate systems (e.g. of a given map).

At the beginning of this section, possible transformations of an object in a given coordinate system are explained because there exists a simple relationship between the transformation of a coordinate system into another and the transformation of an object in a given coordinate sys- tem.

9.4.1 2D Transformations

All transformation in parallel coordinate systems can be decomposed into applications of the four basic transformations: translation, scaling, rotation and shear. A graphical example of these basic transformations is represented in Figure 9.1.

Fig. 9.1: Basic types of transformation in parallel coordinate systems

For the mathematical description of these transformations, vector and matrix algebra can be applied. For this purpose, column vectors represent coordinate vectors of points. Therefore, the point P with the coordinates x and y and the result of a transformation, the new point P’ with the new coordinates x' and y’, are written as

82

Liedl / Dietrich Mathematical Methods

 x  x' P =   and P'=   . (Eq. 9.10)  y  y'

A translation of a point by tx units parallel to the x-axis and ty units parallel to the y-axis can then be expressed more concisely as t   x  P’=P+T with T =   . (Eq. 9.11) t y 

A transformation in the form of a scaling (stretching or shrinking), which is equivalent to the following transformation of the single coordinates

x'= sx ⋅ x and y'= s y ⋅ y , (Eq. 9.12) can also be simply expressed by the matrix equation

 s 0   x  P'= S ⋅ P with S =   . (Eq. 9.13)  0 s y 

A rotation of a point about the origin of the coordinate system is defined mathematically by the matrix equation

cosθ − sinθ  P'= R ⋅ P with R =   (Eq. 9.14)  sinθ cosθ  where θ is the rotation angle (with counter clockwise orientation).

For the last basic transformation, the shear, a representation in the form of a matrix equation is also possible. Thereby, a shear in the x-direction and a shear in the y-direction can be distin- guished. For a shear in the x-direction, the matrix equation is

1 sh   x  P'= SH x ⋅ P with SH x =   . (Eq. 9.15) 0 1 

The analogue for a shear in the y-direction is

 1 0 = ⋅ =   P' SH y P with SH y   . (Eq. 9.16)  shy 1

9.4.2 Homogeneous Coordinates and Matrix Representation of 2DTransformations

83

Liedl / Dietrich Mathematical Methods

Comparison of the mathematical representation of the different transformation types shows that translation is treated differently (as an addition) than the other transformations (treated as multiplications). It would be useful to treat all transformations in a consistent way, such that they can be combined easily.

A possible approach for getting a uniform mathematical form for the different transformations is based on the use of homogeneous coordinates. The homogeneous coordinates arise from the addition of a further coordinate to a point. That means, for the two-dimensional case, instead of being represented by a pair of numbers (x, y), each point is represented by a triplet (x, y, W). For the application of the homogeneous coordinates to the matrix representation of trans- formation, the additional coordinate is set equal to 1.

Because the points are now column vectors with three elements, transformation matrices must now be 3× 3 matrices. The former transformation matrices for the scaling (S), the rotation (R) and the shear (SH) can be changed in the new form by bordering. The corresponding matrices for the transformation of homogeneous coordinates are

 s 0 0 cosθ − sinθ 0 1 sh 0  1 0 0  x     x    S =  0 s y 0 , R =  sinθ cosθ 0 , SH x = 0 1 0 and SH y =  shy 1 0 .          0 0 1  0 0 1 0 0 1  0 0 1

(Eq. 9.17)

Using the homogeneous coordinates, the translation can now also be represented as a multi- plication with a matrix.

1 0 t  1 0 t   x  x + t   x'  x   x     x    P'= T ⋅ P with T = 0 1 t y  → P'= 0 1 t y  ⋅ y =  y + t y  =  y' .           0 0 1  0 0 1   1  1   1 

(Eq. 9.18)

9.4.3 Homogeneous Coordinates and Matrix Representation of 3D Transformations

In a similar way, as for a two-dimensional system, the transformations in a three-dimensional right-handed system can be represented by matrix multiplication. Using homogeneous coordi- nates, the points P and P' are defined as column vectors of the shape

 x  x'      y  y' P = and P = . (Eq. 9.19)  z   z'          1  1 

In addition, the transformation matrices for 3D can be easily derived from the 2D case. The corresponding matrices for translation and scaling are

84

Liedl / Dietrich Mathematical Methods

1 0 0 t   s 0 0 0  x   x  0 1 0 t y   0 s y 0 0 T = and S = . (Eq. 9.20) 0 0 1 t   0 0 s 0  z   z      0 0 0 1   0 0 0 1

In a three-dimensional system, more possibilities for rotation exist than in a two-dimensional system; this leads to a greater variety of rotation matrices. In the following, only the matrices for rotation about the different axes are given

axis of rotation sense of rotation cosθ − sinθ 0 0    sinθ cosθ 0 0 - rotation about z-axis: R = z x → y (Eq. 9.21a) z  0 0 1 0      0 0 0 1

1 0 0 0   0 cosθ − sinθ 0 - rotation about x-axis: R = x y → z (Eq. 9.21.b) x 0 sinθ cosθ 0     0 0 0 1

 cosθ 0 sinθ 0    0 1 0 0 - rotation about y-axis: R = y z → x (Eq. 9.21c) y − sinθ 0 cosθ 0      0 0 0 1

Thereby, θ is the respective rotation angle (orientation counter clockwise). Every other rota- tion can be expressed by a sequence of rotations about the axes.

Corresponding to the two-dimensional shear matrices, are three 3D shear matrices. The (x, y) shear is 1 0 sh 0  x  0 1 sh 0 SH = y . (Eq. 9.22) xy 0 0 1 0     0 0 0 1

T T The application of Shxy to a point (x,y,z,1) gives the new point ( x + shx ⋅ z , y + shy ⋅ z , z, 1) . Shears along the x- and y-axis have a similar form.

9.4.4 Composition of Transformations

Based on the transformation matrix representation, the composition of transformations can easily be understood. If there is more than one transformation to carry out, then the complete

85

Liedl / Dietrich Mathematical Methods transformation can be represented by one matrix. For instance, if there is a sequence of trans- formations such as

1. Translation using the matrix T1, 2. Rotation using matrix R1, and 3. Scaling with matrix S1, then the complete transformation can be represented by the matrix

C = S1 ⋅ R1 ⋅T1 . (Eq. 9.23)

In the other direction, a complicated transformation can also be decomposed into simple trans- formation steps. In Figure 9.2, this is illustrated by a rotation of a house about an edge point of this object.

Fig. 9.2: Rotation of a house about the point P1 by an angle θ.

The sequence of simple transformations in this case is

1. Translating the house such that P1 is at the origin, 2. Rotating the house by an angle θ, 3. Translating the object such that the point at the origin returns to P1.

86

Liedl / Dietrich Mathematical Methods

9.4.5 Inverse Transformation

Furthermore, the uniform transformation representation offers a relatively simple determina- tion of the inverse transformation. Based on matrix algebra,

P’ = C P C-1P’ = C-1C P (Eq. 9.24) C-1P’ = P, it follows that the inverse of the forward transformation matrix C describes the inverse trans- formation. If the matrix C represented a composite transformation then the rules of matrix al- gebra could be applied to the calculation of the inverse transformation matrix.

Example: −1 −1 −1 −1 −1 C = T1 ⋅ R1 ⋅ S1 ⋅T2 → C = T2 ⋅ S1 ⋅ R1 ⋅T1 Matrix representation of inverse 2D transformation:  1   0 0 s  x   cos ρ sin ρ 0 −  1  −   S 1 =  0 0 , R 1 = − sin ρ cos ρ 0 s  y   0 0 1  0 0 1       1 − sh 0  1 0 0 1 0 − t   x     x  SH x = 0 1 0 , SH y = − shy 1 0 , T = 0 1 − t y        0 0 1  0 0 1 0 0 1 

9.4.6 Transformation as a Change in Coordinate System

In the forgoing paragraph, it was assumed that the considered objects in the coordinate system were transformed. It is also possible to assume that the coordinate system itself would be transformed. The Figure 9.3 illustrates these different viewpoints.

Fig. 9.3: A house and two coordinate systems. The coordinates of points on the house can be represented in either system.

87

Liedl / Dietrich Mathematical Methods

Consider the case of translating the set of points that define the house so that the centre of the house (x1, y1) comes to the origin of the coordinate system. This transformation is character- ized by the matrix

1 0 − x   1  T = 0 1 − y1  . (Eq. 9.25)   0 0 1 

By labelling the two coordinate systems as in Figure 9.3, it can be seen that the transfor- mation, which maps coordinate system 2 into coordinate system 1, is the inverse to the above mentioned transformation

−1 1 0 − x  1 0 x   1   1  −1 T = 0 1 − y1  = 0 1 y1 . (Eq. 9.26)     0 0 1  0 0 1 

Indeed, the general rule is that the transformation that transforms a set of points in a single coordinate system is just the inverse of the corresponding transformation to change the coor- dinate system in which a point is represented.

88

Liedl / Dietrich Mathematical Methods

10 Solution of Non-linear Equation Systems

Non-linear equations or non-linear equation systems describe numerous problems in . Because such equations play an important role more and more in modern natural sci- ences, it is necessary to know their solving methods. Non-linear equation systems can have none, only one, some, or an infinite number of solutions. For the solving of non-linear equa- tion systems, methods can be used which are similar to the methods for the solution of one non-linear equation.

In the following, some methods are presented for the situation when the non-linear equation cannot be resolved for the unknown. The usefulness of the different methods depends on the specific case.

A non-linear equation can generally be expressed in the form f (x) = 0. Only for special cas- es, like the quadratic equation, do there exist formulas for the determination of the roots. More often, it is necessary to apply numerical methods to find approximate solutions. The most commonly used methods have two main parts: a) finding initial approximate value(s) b) improving the value(s) by an iterative process

10.1 Determination of Initial Approximate Values

If a possible solution of a given non-linear equation is unknown, then initial values can be de- termined by one of the following two methods:

10.1.1 Graphical Method

Initial approximate values for the roots of a non-linear equation can be graphically determined by plotting (or sketching) the graph of the function y = f (x) . The approximate values of the roots are taken from the graph were the curve cuts the x-axis (see Fig. 10.1 a). Another graph- ical approach is based on the rewriting of f (x) = 0 in the form of g(x) = h(x) . In this case, the approximate roots are the points where the graphs of the two functions g(x) and h(x) in- tersect (see Fig. 10.1 b).

1.0 0.0 y = ln x y = ln x + x 0.5 -0.5

0.0 y = -x 0.4 0.6 0.8 -1.0 -0.5

-1.5 -1.0

-1.5 -2.0 a) b) 0.2 0.4 0.6 0.8 Fig. 10.1: Two graphical approaches for the estimation of the root of the function f (x) = ln x + x .

89

Liedl / Dietrich Mathematical Methods

10.1.2 Algebraic Method

The algebraic method is based on the calculation of the function y = f (x) for a sequence of x-values until the values of the function for two values of x have a different sign.

Example: f (x) = ln x + x f (0.2) = −1.409 f (0.5) = −0.193  different signs → f (x) = ln x + x has a root f (0.8) = +0.577 between 0.5 and 0.8

10.2 Methods of Nest of Interval

If two values x- and x+ are known, for which the function values have different signs, then the root between these values can be found be minimising the interval (x-, x+) so that f (x − ) ⋅ f (x + ) < 0. The minimisation is carried out in the following way:

1. select a value for x between x- and x+ , 2. calculate f(x), 3. if f (x) ≠ 0 then change the interval limits in the following manner if f (x) > 0 then x+ = x else x- = x 4. continue with 1. until f (x) = 0 or x has a satisfying precision.

For the selection of x between x- and x+ different possibilities exist:

Bisection

The value x is the midpoint of the interval (x-, x+)

Golden section algorithm

The value x is calculated by x = x − + (1.5 − 5 / 2) ⋅ (x + − x − ) ≈ x − + 0.382 ⋅ (x + − x − ) .

Regula falsi (method of false position)

Based on the assumption that the function f(x) can be approximated in a small interval by a straight line, the value x can be calculated using the formula

x + − x − x = x − − ⋅ f (x − ) . (Eq. 10.1) f (x + ) − f (x − )

90

Liedl / Dietrich Mathematical Methods

Example: determination of the root xr of the function f (x) = ln x + x in the starting interval (0.5, 0.8).

Bisection Golden section algorithm Regula falsi 1. f(0.65) ≈ 0.22 f(0.6146) ≈ 0.13 f(0.5753) ≈ 0.022

→ 0.5 < xr < 0.65 → 0.5 < xr < 0.6146 → 0.5 < xr < 0.5753 2. f(0.575) ≈ 0.022 f(0.5438) ≈ -0.065 f(0.5675) ≈ 0.00088

→ 0.5 < xr < 0.575 → 0.5438 < xr < 0.6146 → 0.5 < xr < 0.5675 3. f(0.5375) ≈ -0.083 f(0.5708) ≈0.010 f(0.56716) ≈ 0.000035

→ 0.5375 < xr < 0.575 → 0.5438 < xr < 0.5708 → 0.5 < xr < 0.56716 4. f(0.55625) ≈ -0.030 f(0.5541) ≈-0.036 f(0.56714) ≈ 0.0000014

→ 0.55625 < xr < 0.575 → 0.5541 < xr < 0.5708 → 0.5 < xr < 0.56714 5. f(0.565625) ≈ -... f(0.5605) ≈.... f(0.56714) ≈ 0.0000014

10.3 Iterative Methods

Another group of methods for the determination of the roots of a nonlinear equation are the it- erative methods, which start from a single initial value. With the iterative methods, a new es- timation for the root is calculated using a prescription, which is related to the nonlinear equa- tion. In this way a sequence of values x(0), x(1), x(2), x(3) ... is found.

10.3.1 General Behaviour of Iteration

If the behaviour of the sequence x(0), x(1), x(2), x(3) ... is compared with the sought root, 4 basic types of behaviour can be distinguished: monotone convergence, alternating convergence, monotone divergence and alternating divergence. These different types are shown in Figure 10.2 for an iteration based on the equation x(n+1)=g(x(n)). This iteration equation can be easily derived from the equation f(x)=0.

Example: Which value is a root of the equation cosx-x=0?

iteration recipe: x(n+1)=cos(x(n)) starting value: 0.5

1. cos(0.5) = 0.878 4. cos(0.745) = 0.735 2. cos(0.878) = 0.639 5. cos(0.735) = 0.742 3. cos(0.639) = 0.803 6. cos(0.742) = 0.737 4. cos(0.803) = 0.695 7. cos(0.737) = 0.740 5. cos(0.695) = 0.768 8. cos(0.740) = 0.738 6. cos(0.768) = 0.719 15. cos(0.738) = 0.740 7. cos(0.719) = 0.752 16. cos(0.740) = 0.739 8. cos(0.752) = 0.730 17. cos(0.739) = 0.739 9. cos(0.730) = 0.745

91

Liedl / Dietrich Mathematical Methods

convergence (alternating) divergence (alternating)

y=F(x)

(0) (2) (1) (3)

convergence (monotone) divergence (monotone) y=x

Fig. 10.2: Basic types of iteration behaviour.

For a convergence of the iteration with the equation x(n+1)=g(x(n)), the following condition must be fulfilled near the root g'(x) < 1. If -1 < g'(x) < 0 than an alternating convergence would occur. In the case of 0 < g'(x) < 1 monotone convergence would occur for the sequence x(0), x(1), x(2), x(3) ....

For practical purposes, it is necessary to define some criteria for when to stop iterating. Such a criteria could be a maximum number of iteration steps or an accuracy value ε , ε > x (n+1) − x (n) . In the case of an alternating convergence, it is clear that if the accuracy cri- teria is fulfilled, the deviation between the root and the approximation x(n) and x(n+1) is less than ε . With a monotone convergence, the approximation x(n) and x(n+1) can still be far from the root, even if the accuracy criteria is fulfilled.

10.3.2 Newton Method

An iterative method, which has an iteration prescription of the type x(n+1)=g(x(n)) is the New- ton method. The basic idea of the Newton method is the use of the tangent on the function at the point xn. This tangent is characterised by the derivation of the nonlinear function f(x). Therefore, the iteration prescription of the Newton method is

f (x (n) ) x (n+1) = x (n) − . (Eq. 10.2) f '(x (n) )

92

Liedl / Dietrich Mathematical Methods

Example: Which value is a root of the equation cosx-x=0?

x(n) − cos x(n) iteration recipe: x(n+1) = x(n) − = h(x(n) ) 1+ sin x(n) starting value: 0.5

1. h(0.5) = 0.7552 2. h(0.7552) = 0.7391 3. h(0.7391) = 0.7391

10.3.3 Solving by Separation into Two Functions

Another possibility to develop an iteration recipe is the rewriting of f(x)=0 to an equation of the form p(x(n+1))= h(x(n)), whereby p(x) can be easily resolved for x. A sufficient condition for convergence of this approach is p'(x) > h'(x) near the root. The above presented iteration method with x(n+1)=g(x(n)) is a special case of this iteration approach.

Example: Which value is the root of the equation x 2 − ln x − 2 = 0 ?

p(x) = ln x and h(x) = x2 − 2

graphical determined approximate root: 0.15

1 convergence can be expected: p'(x) = > h'(x) = 2x for x < 0.5 x

1. 0.152-2 = -1.9775 → exp(-1.9775) = 0.138415 2. 0.1384152-2 = -1.98084 → exp(-1.98084) = 0.137953 3. 0.1379532-2 = -1.98097 → exp(-1.98097) = 0.137935 4. 0.1379352-2 = -1.98097 → exp(-1.98097) = 0.137935

93

Liedl / Dietrich Mathematical Methods 11 Partial Derivatives

This chapter deals with derivatives of functions, which depend on two or more variables. In the Applied Environmental Sciences these functions occur, for instance, in model equations developed for simulating flow and transport problems.

Differentiation of a function depending on two variables is illustrated in Fig. 11.1. A function f = f(x,y) may be visualised as a surface in xyz-space. For each pair (x,y) in the function’s do- main, there is a unique number z representing the function’s value. The function f may be dif- ferentiated with respect to each variable. Each first-order derivative may be associated with the slope of a tangent touching the surface f(x,y). When f is differentiated with respect to x, the corresponding tangent is contained in a plane which is in parallel with the xz-plane. When f is differentiated with respect to y, the corresponding tangent is contained in a plane which is in parallel with the yz-plane. This is indicated by the hatched cross-sections in Fig. 11.1.

Fig. 11.1:Differentiation of a function depending on two variables (from Zachmann, 1981)

∂ f ∂ f These first-order derivatives are denoted by (x, y) and (x, y) , respectively. They are ∂ x ∂ y called first-order partial derivatives. In order to distinguish them from derivatives of a func- tion depending on a single variable, the notation is slightly modified, i.e. d is replaced by ∂. Partial derivatives with respect to any variable are calculated in the same way as in Section 3.2 treating all other variables as constants.

∂ 2 f ∂ 2 f ∂ 2 f Similarly, second-order partial derivatives are denoted by (x, y) , (x, y) , (x, y) ∂ x2 ∂ y2 ∂ x∂y ∂ 2f and (x, y) , respectively. The second-order derivatives represent the curvature of the sur- ∂y∂ x face shown in Fig. 11.1.

94

Liedl / Dietrich Mathematical Methods

Example: In this example some partial derivatives of a function depending on three variables are calcu- lated. In particular, the function f (x, y,z) = x² sin(2z) − x e3y is considered. It is found that

∂ f e3y (x, y,z) = 2x sin(2z) − ∂ x 2 x ∂ f (x, y,z) = − 3 x e3y ∂ y ∂ f (x, y,z) = 2x² cos(2z) ∂ z ∂ ² f e3y (x, y,z) = 2sin(2z) + ∂ x² 4 x³ ∂ ²f 3e3y (x, y,z) = − ∂ y∂ x 2 x ∂ ²f 3e3y (x, y,z) = − ∂ x∂y 2 x ∂ ²f (x, y,z) = 0 ∂ y∂ z

Remarks: • As stated above, partial differentiation in the example is performed by applying the rules from Section 3.2 with respect to one variable and treating all the others as constants. This remains true for arbitrarily many variables. ∂ 2 f ∂ 2 f • Mixed derivatives, such as (x, y,z) and (x, y,z) are equivalent unless f exhib- ∂ x∂y ∂y∂ x its jumps or cusps. • Higher-order partial derivatives may be obtained by successively applying the differentia- tion rules summarised in Section 3.2, i.e. by differentiating an appropriate lower-order de- rivative. In most practical cases, only first-order and second-order partial derivatives are of interest.

95

Liedl / Dietrich Mathematical Methods 12 Fields and Differential Operators

12.1 Definitions

Fields are functions of two or three variables which represent spatial co-ordinates. In addition, time may occur as another variable (see below). Accordingly, the domain of a field is a subset of two-dimensional (2D) or three-dimensional (3D) space and part of the time axis (if the field is time-dependent).

For our purposes, three types of fields may be distinguished according to the properties of the physical quantities to be considered. If each point in the domain is associated with a scalar quantity (e.g. concentration, density, temperature, hydraulic head) then the field is called a scalar field. A 3D concentration field in xyz-space, for instance, may be denoted by

c = c(x, y,z) (Eq. 12.1)

If each point in the domain is associated with a vector quantity (e.g. velocity, acceleration, flux, force) then the field is called a vector field. A 3D velocity field in xyz-space, for in- stance, may be denoted by

v (x, y,z)  x  v = v(x, y,z) = vy(x, y,z) (Eq. 12.2)   vz(x, y,z)

Similarly, if each point in the domain is associated with a tensor quantity (e.g. hydraulic con- ductivity, stress, dispersion) then the field is called a tensor field. A 3D conductivity field in xyz-space, for instance, may be denoted by

 K (x, y,z) K (x, y,z) K (x, y,z)  xx xy xz  K = K(x, y,z) =  Kyx(x, y,z) Kyy(x, y,z) Kyz(x, y,z) (Eq. 12.3)    Kzx(x, y,,z) Kzy(x, y,z) Kzz(x, y,z)

Time-dependent scalar fields and vector fields may be denoted by c(x,y,z,t) and v(x,y,z,t), re- spectively. Usually, time-dependent tensor fields do not occur in problems associated with the Applied Environmental Geosciences.

The rest of this chapter is devoted to scalar fields and vector fields. In particular, differentia- tion is addressed.

96

Liedl / Dietrich Mathematical Methods

12.2 Scalar Fields

Two-dimensional and three-dimensional scalar fields may be visualised by plotting equipoten- tial lines (isolines) or equipotential surfaces (isosurfaces), respectively. A well-known exam- ple for isolines is provided by contour lines on topographical maps. Isolines and isosurfaces are implicitly given by the equations

c(x, y) = c0 (Eq. 12.4) and

c(x, y,z) = c0 (Eq. 12.5) respectively, where c0 denotes the value represented by the isoline or isosurface (Fig. 12.1).

grad(c)

c=3

c=2

c=1

Fig. 12.1: Isolines and gradient for a 2D scalar field

Fig. 12.1 also shows the gradient of a scalar field. In each point of the domain the gradient is a 2D or 3D vector which is perpendicular to the corresponding isoline or isosurface and is di- rected towards increasing function values. The components of the gradient vector are given by partial derivatives of the scalar field. Thus, we have

 ∂c   ∂ x gradc =   (Eq. 12.6)  ∂c    ∂ y and

97

Liedl / Dietrich Mathematical Methods

 ∂ c    ∂ x  ∂ c gradc = (Eq. 12.7) ∂ y  ∂   c ∂ z respectively.

Example: For the 2D scalar field c(x,y) = 1/(1+x²+4y²) the isolines are defined by eq. (12.4). Here, this relationship is equivalent to x²+(2y)² = (1/c0)-1. Therefore, the isolines are ellipses with semi- axes coinciding with the co-ordinate axes. The length of each horizontal semi-axis is twice the length of the corresponding vertical semi-axis. It should also be noted that the above equation defining the ellipses can only be solved for 0 < c0 ≤ 1. Otherwise, the expression (1/c0)-1 would become negative or infinite. The maximum value (c0 = 1) is attained at the origin.

The gradient of c(x,y) is given by

2  x  gradc = −   (1+ x² + 4y²)² 4y

Gradients of scalar fields occur in many laws of motion, which may be expressed verbally as

flux = - material_property * gradient_of_scalar_field

Here, material_property may either represent a scalar quantity or a tensor quantity (“matrix”). In both cases, flux and gradient_of_scalar_field are vectors. The negative sign indicates that the flux vector is directed towards decreasing values of the scalar field. Some examples are given in Tab. 6.1.

Tab. 12.1: Laws of motion law of motion process flux material property scalar field Fourier’s law conduction of heat heat thermal temperature conductivity Ohm’s law conduction of electric current electric electric potential electricity conductivity Fick’s first law diffusion mass diffusion concentration coefficient Darcy’s law groundwater flow specific discharge hydraulic hydraulic head (Darcy velocity) conductivity

98

Liedl / Dietrich Mathematical Methods

For isotropic media, material_ property is a scalar. In this case, the angle between flux and gradient_of_scalar_field is equal to 180° (or π). For anisotropic media, material_property is a tensor and the above-mentioned angle is between 90° and 180° (Fig. 12.2).

isotropic anisotropic gradient gradient

motion

motion

Fig. 12.2: Motion in isotropic and anisotropic media

Fig. 12.3 presents an example for motion in an isotropic medium considering groundwater flow through a dam∗. Curves with arrows indicate groundwater flow paths. These curves are called flow lines or stream lines. They are perpendicular to the isolines and, therefore, the gradient vectors are tangential to these curves. Please note that in Fig. 12.3 arrows point to- wards decreasing head values, i.e. hydraulic head gradient vectors point in the opposite direc- tion. Further examples, referring to isolines and stream lines for different ratios of anisotropy, are shown in Fig. 12.4.

Fig. 12.3: Groundwater flow through a dam (from Freeze and Cherry, 1979)

∗ From hydraulic considerations one may conclude that the curvature of the groundwater table in the dam is in- correct. As a result, the curvature of stream lines in the dam also has to be modified. All this, of course, does not affect the general definition of isolines and stream lines.

99

Liedl / Dietrich Mathematical Methods

Fig. 12.4: Isolines and stream lines for ratios of anisotropy equal to (a) 1:4, (b) 1:1, and (c) 4:1 (from Freeze and Cherry, 1979)

12.3 Vector Fields

The gradient of a scalar field may serve as an example of a vector field, i.e. a vector is associ- ated with each point in the domain. A vector field may be visualised by vector lines, which are defined as curves being tangential to the vectors of the vector field (Fig. 12.5). Vector lines, of course, are equivalent to the stream lines defined in the previous section.

Fig. 12.5: Vector field with vector lines

100

Liedl / Dietrich Mathematical Methods

There are two main criteria for classifying vector fields. First, vector fields may be classified with respect to the presence of sources and sinks. Sources and sinks are singular points of the vector field where infinitely many vector lines meet (Fig. 12.6). A source is encountered if the vectors close to the singular point are directed away from that point. Otherwise, i.e. when the vectors are pointing towards the singular point, this point is called a sink. Sources and sinks usually represent local gain or local loss, respectively, of some physical quantity such as mass or volume or energy.

Fig. 12.6: Source and sink of a vector field

An example of a vector field with a source and a sink is provided by the electric field of a di- pole. Fig. 12.7 shows a cross section of the 3D dipole field containing the location of the source (“+” = positive charge) and the sink (“-“ = negative charge). In this example, the source and the sink have the same “strength” resulting in a symmetric pattern of isolines (dashed lines) and vector lines (solid lines).

Fig. 12.7: Vector field of an electric dipole (Dransfeld and Kienle, 1980)

101

Liedl / Dietrich Mathematical Methods

The “strength” of sources and sinks is measured by the divergence of a vector field. (This term has nothing in common with the divergence of an iterative method, see Chapter 4.) The divergence of a 3D vector field is a scalar quantity defined by

∂ v ∂ vy ∂v divv = x + + z (Eq. 12.8) ∂ x ∂ y ∂ z

Of course, the last term does not appear for a 2D vector field. If divv is positive at some point (x,y,z) then there is a source at this point. If divv is negative at (x,y,z) a sink is encountered at this point. If divv = 0 for all points in the domain the vector field is called a solenoidal field, source-free field or zero-divergence field.

Example: sin x cos y The divergence of the 2D vector field v(x, y) =   is found to be cos x sin y divv = cosxcosy + cosxcosy = 2cosxcosy.

The divergence of a vector field is used in order to provide a mathematical formulation of conservation laws in the Natural Sciences. For steady-state conditions, a conservation law may be verbally expressed by

div(flux) = 0 or

div(material_property * gradient_of_scalar_field) = 0

These “formulae” state that the total change of the flux vector across the surface of any small portion (control volume or volume element) of the model domain equals zero, i.e. there is no net flow and the total inflow rate equals the total outflow rate. Thus, the divergence may be viewed as the derivative of a vector field with respect to an infinitesimally small volume ele- ment.

102

Liedl / Dietrich Mathematical Methods

Vector fields may also be characterised with respect to vortices. Curls are encountered when vector lines are closed, i.e. they neither have a starting point nor an end point in the domain (Fig. 12.8). This type of vector field is what you observe after stirring your morning coffee.

Fig. 12.8: Vortices in a vector field

Further examples are provided by magnetic fields. Fig. 12.9 shows a magnetic field develop- ing due to changes in electric current.

Fig. 12.9: Closed vector lines of a magnetic field (from Dransfeld and Kienle, 1980)

103

Liedl / Dietrich Mathematical Methods

“Strength” and orientation of vortices of a 3D vector field are given by the curl or rotation (symbol “curl” or “rot”), which is defined by

 ∂ v ∂ v   z − y   ∂ y ∂ z   ∂ v ∂ v  curlv = rotv = x − z (Eq. 12.9)  ∂ ∂   z x  ∂ vy ∂ vx  −   ∂ x ∂ y  curlv is a 3D vector field. At each point, curlv is in parallel with the axis of rotation. Its length |curlv| is a measure of the “strength” of the vortex. Please note that curl is only defined for 3D vector fields.

Example:  sin y cosz   The curl of the 3D vector field v(x, y,z) =  sin z cos x is found to be   sin x cos y  − sin x sin y − cosz cos x sin x sin y + cosz cos x     curlv(x, y,z) = − sin y sin z − cos x cos y = − sin y sin z + cos x cos y .      − sin z sin x − cos y cosz  sin z sin x + cos y cosz

Zero-curl vector fields are related to scalar fields. In particular, the gradient of a scalar field c is a zero-curl vector field. For each zero-curl vector field, on the other hand, there is a scalar field with a gradient being equal to that vector field (Fig. 12.10). Please note that there is no such correspondence for vector fields with vortices.

104

Liedl / Dietrich Mathematical Methods

vector field v

with vortex without vortices curl(v) = 0 curl(v) = 0

with source div(v) > 0

with sink div(v) < 0

without sources and sinks div(v) = 0

v = grad(c)

v points in direction of movement

grad(c) points in direction of increasing c c=1 c=2 c=3

scalar field c

Fig. 12.10: Scalar fields and vector fields

105

Liedl / Dietrich Mathematical Methods

12.4 Differential Operators for Cartesian Coordinates

The gradient, divergence and curl provide examples of differential operators, which may be viewed as some sort of “function” which maps a scalar field or a vector field, respectively, to a mathematical expression containing derivatives of this field.

Many differential operators may be written by employing the Nabla operator (or Hamilton op- erator), which is defined for 2D Cartesian co-ordinate systems by

 ∂    ∂ x ∇ =    ∂  ∂ y and for 3D Cartesian co-ordinate systems by

 ∂    ∂ x ∂ ∇ =   ∂ y    ∂  ∂ z

The Nabla operator can be used as a “symbolic vector” in order to express other differential operators. For instance, the gradient of a scalar field c may now be written as

 ∂c   ∂ x gradc = ∇c =   (Eq. 12.10)  ∂c ∂ y

and

 ∂   c ∂ x ∂c gradc = ∇c =   (Eq. 12.11) ∂ y    ∂c ∂ z for 2D and 3D, respectively. Thus, gradc is obtained by simply multiplying ∇ and c.

106

Liedl / Dietrich Mathematical Methods

Similarly, the divergence of a vector field v is obtained by the scalar product of ∇ and v, i.e.

∂ v ∂ vy divv = ∇Tv = x + (Eq. 12.12) ∂ x ∂ y and

T ∂ v ∂ vy ∂ v divv = ∇ v= x+ + z (Eq. 12.13) ∂ x ∂ y ∂ z respectively.

The curl of a 3D vector field v may be viewed as the vector product of ∇ and v. Thus, we have

 ∂vz ∂vy  −   ∂ y ∂ z   ∂ vx ∂vz curlv = ∇ × v = − (Eq. 12.14)  ∂ z ∂ x   ∂ vy ∂ vx  −   ∂ x ∂ y

Finally, the divergence and the gradient may be combined yielding the Laplace operator ∆, which may be applied to scalar fields. The formulae for a scalar field depending on two or three spatial variables can be written as

∂ ²c ∂ ²c ∆c = divgradc = ∇T∇c = + (Eq. 12.15) ∂ x² ∂ y² and

∂ ²c ∂ ²c ∂ ²c ∆c = divgradc = ∇T∇c = + + (Eq. 12.16) ∂ x² ∂ y² ∂ z² respectively. Thus, the Laplace operator produces a sum of second-order derivatives of a sca- lar field. Note that mixed second-order derivatives do not appear in eqs. (6.15) and (6.16).

Example: The Laplace operator is now applied to the 2D scalar field c(x,y) = 1/(1+x²+4y²), which has already been studied in Section 6.2. In a first step, second-order derivatives are calculated by applying the quotient rule of differentiation which results in

∂ ²c − 2 + 6x² − 8y ² = ∂x ² (1+ x² + 4y²)³

107

Liedl / Dietrich Mathematical Methods

and

∂ ²c − 8 − 8x² + 96y ² = ∂ y² (1+ x² + 4y²)³

Using these results in eq. (12.15) one arrives at

5+ x² − 44y ² ∆c = − 2 (1+ x² + 4y²)³

Remarks: • The symbol ∆, which is used for the Laplace operator, should not be confused with the same symbol being employed for denoting finite differences in numerical methods for solving differential equations. • Please note that all formulae in this section hold only if the co-ordinate system is Carte- sian. • Differential operators may also be defined for other co-ordinate systems (e.g. polar, spher- ical or cylindrical) but the corresponding formulae are more involved.

108

Liedl / Dietrich Mathematical Methods 13 Partial Differential Equations

13.1 Definitions and Classification

Many flow and transport processes in the Environmental Sciences are mathematically de- scribed by functions depending on two, three or four variables (spatial co-ordinates and time). These functions are obtained as solutions of a mathematical model consisting of a partial dif- ferential equation and adequate initial and boundary conditions.

In general, a partial differential equation (PDE) is an equation containing an unknown func- tion depending on two or more variables and partial derivatives of this function. In addition, the function's arguments may explicitly occur in partial differential equations.

PDEs may be characterised with respect to their order. The order of a PDE is given by the maximum order of all partial derivatives occurring in the PDE. PDEs occurring in flow and transport models usually are first-order or second-order equations.

For further classification it is assumed for simplicity that the unknown function f depends on two variables x, y only. In this case, a first-order PDE is called linear if it may be written in the form

∂ f ∂ f a (x, y) (x, y) + a (x, y) (x, y) + a (x, y) f (x, y) = g(x, y) (Eq. 13.1) 10 ∂x 01 ∂ y 00 with known functions g(x,y), a00(x,y), a01(x,y) and a10(x,y). Otherwise, the first-order PDE is non-linear. If the coefficients a00, a01 and a10 do not depend on x and y, eq. (13.1) represents a linear first-order PDE with constant coefficients.

A second-order PDE is called linear if it may be written in the form

∂ 2 f ∂ 2 f ∂ 2 f a (x, y) (x, y) + a (x, y) (x, y) + a (x, y) (x, y) + 20 ∂x 2 11 ∂x∂y 02 ∂y 2 (Eq. 13.2) ∂ f ∂ f + a (x, y) (x, y) + a (x, y) (x, y) + a (x, y) f (x, y) = g(x, y) 10 ∂x 01 ∂ y 00

with known functions g(x,y), a00(x,y), a01(x,y), a10(x,y), a02(x,y), a11(x,y) and a20(x,y). Other- wise, the second-order PDE is non-linear. If the coefficients a00, a01, a10, a02, a11 and a20 do not depend on x and y, eq. (13.2) represents a linear second-order PDE with constant coeffi- cients.

If g(x,y) = 0 for all x and y, then a linear PDE is homogeneous, otherwise it is inhomogeneous.

As with ODEs, the solution of a PDE is not unique. In fact, there are infinitely many solu- tions. In order to select a specific solution, which corresponds to the specific scenario to be modelled, additional requirements have to be formulated. These requirements, which usually reflect some additional information about the scenario to be studied, are called initial condi- tions or boundary conditions, i.e. the "additional information" may define starting conditions of the process (independent variable = time) or conditions holding at the boundary of the model domain (independent variable = spatial co-ordinate). The number of initial or boundary conditions required to identify a unique solution of a PDE is discussed in the next section.

109

Liedl / Dietrich Mathematical Methods

Unfortunately, there is no general method for obtaining the solution of a given PDE. In other words, there are many PDEs, which cannot be solved by any known solution technique. In the rest of this chapter linear PDEs are studied for which some fundamental solutions are known and some basic solution techniques have been developed.

13.2 Formulation of Mathematical Models

The formulation of any mathematical model typically consists of five steps: • define geometry of the model domain (dimensionality, shape, moving boundaries) • determine system parameters (natural constants, material properties etc.) considering spa- tial or temporal variations if present • develop or select a PDE, which is usually based on physical principles like conservation of volume, mass, energy or momentum • specify initial conditions (ICs): − values of the unknown function(s) at time t = 0 − this is not required for steady-state (stationary, time-independent) processes • specify boundary conditions (BCs): − BCs have to be specified along the complete boundary of the model domain (also at in- finity if the model domain is unbounded) − BCs may be time-dependent − there are different types of BCs (see below)

Regarding initial and boundary conditions, it is helpful to note: • The number of conditions equals the order of the highest derivative. (This "rule of thumb" has to be applied for each variable separately!) • There are three fundamental types of BCs: − 1st kind (Dirichlet): Function values are specified. − 2nd kind (Neumann): The component of the gradient which is perpendicular to the boundary of the model domain is specified. − 3rd kind (Cauchy): A relationship between the function values and the component of the gradient which is perpendicular to the boundary of the model domain is specified.

BCs of the 1st and 2nd kind are schematically shown in Fig. 13.1.

110

Liedl / Dietrich Mathematical Methods

time BC 2nd kind gradient

model BC PDE BC domain (PDE & IC)

BC 1st kind IC space

boundary model boundary domain

Fig. 13.1: Boundary conditions of first and second kind

Example: In this example we consider 2D diffusion of a chemical in air or water. The model domain is a rectangle with length Lx and width Ly (Fig. 13.2). The diffusion coefficient D is the only sys- tem parameter which is required. It is assumed to be constant in space and time. The model equation is given by the diffusion equation (Fick’s 2nd law)

∂c = D∆c (Eq. 13.3) ∂ t where c denotes concentration, t is time and ∆ is the Laplace operator as defined by eq. (12.15). (It may be noted that equation (13.3) is equivalent to the heat conduction equation.)

Next, an initial condition has to be specified, i.e. information about the concentration distribu- tion c(x,y,0) at the beginning of the modelling period (t = 0) is required.

Finally, boundary conditions are formulated for the complete model domain boundary. Boundary conditions of the first kind are specified at the boundaries x = 0 and y = Ly. where the concentrations c(0,y,t) and c(x,Ly,t) are given. At the boundaries y = 0 and x = Lx a bound- ary condition of the second kind is prescribed, i.e. the component of gradc, which is oriented in parallel with the outward unit normal vector n, has to be given. As the model boundaries ∂c ∂c are in parallel with the co-ordinate axes the partial derivatives (x,0,t) and (Lx, y,t) are ∂y ∂x specified in this example.

111

Liedl / Dietrich Mathematical Methods

y

BC: c(x,Ly,t) Ly

n )

t , system parameter: D ) y , t , 0 y (

,

c δc x

: model equation: = D ∆ c

L

δt ( C

c x

B

δ δ

initial condition: c(x,y,0) : C

B

0 BC: δc (x,0,t) n Lx x δy

Fig. 13.2: Example for model formulation (2D diffusion problem)

112

Liedl / Dietrich Mathematical Methods

13.3 A PDE Model for Groundwater Abstraction

Groundwater abstraction from a confined aquifer may be modelled by a second-order PDE and adequate initial and boundary conditions. The simplified problem to be dis-cussed here deals with radial groundwater flow towards a single pumping well (see vertical cross section shown in Fig. 13.3). For simplicity, vertical flow components are neglected so that the model domain is an (infinite) 2D plane.

Fig. 13.3: Drawdown of hydraulic heads due to pumping (from Freeze and Cherry, 1979)

The aquifer is characterised by a storage coefficient S and a transmissivity T representing the system parameters. The PDE governing groundwater flow is given by

∂h S = div(Tgradh) (Eq. 13.4) ∂ t where h is hydraulic head varying in space and time. If it is further assumed that the aquifer is homogeneous, i.e. S and T are spatially constant, eq. (13.4) may be written in the form

S ∂h = ∆h (Eq. 13.5) T ∂ t

113

Liedl / Dietrich Mathematical Methods

This linear second-order PDE is the model equation to be solved below. Before doing so it is helpful to recall that in our example flow is radial with the pumping well located at the origin of the co-ordinate system. This suggests that polar co-ordinates r and ϕ may be more adequate than Cartesian co-ordinates x and y. Polar co-ordinates are related to Cartesian co-ordinates via x = rcosϕ and y = rsinϕ (Fig. 13.4).

y

(x,y)

ϕ n

i s r

r

ϕ 0 r cosϕ x

Fig. 13.4: Cartesian and polar co-ordinates

Therefore, the Laplace operator occurring on the right-hand side of eq. (13.5) has to be ex- pressed in terms of polar co-ordinates, i.e. here it is not correct to employ eq. (12.15) which holds for Cartesian co-ordinates only. The Laplace operator for polar co-ordinates is given by

1 ∂  ∂  1 ∂ ² ∆ = r  + (Eq. 13.6) r ∂ r  ∂ r r 2 ∂ϕ ²

Therefore, the right-hand side of eq. (13.5) is equal to

1 ∂  ∂h 1 ∂ ²h ∆h = r  + (Eq. 13.7) r ∂ r  ∂ r r 2 ∂ϕ ²

Due to radial symmetry of the flow pattern (∂(…)/∂ϕ = 0), the second term on the right-hand side of eq. (13.7) is equal to zero. Therefore, the model equation to be solved is given by

S ∂ h 1 ∂  ∂h = r  (Eq. 13.8) T ∂ t r ∂ r  ∂ r

Eq. (13.8) represents a 1D problem with space-dependent coefficients, i.e. the number of space dimensions is reduced here by switching to polar co-ordinates. Consequently, hydraulic head depends on r and t only.

114

Liedl / Dietrich Mathematical Methods

A uniform initial condition is assumed in our example, i.e. h(r,0) = h0 for some constant h0. Boundary conditions have to be specified along the complete model boundary, i.e. at the well (r = 0) and at large distances from the well (r → +∞). For large values of r it is assumed that the initial head is not affected by pumping, i.e.

lim h(r,t) = h0 (Eq. 13.9) r→+∞

At r = 0 the pumping rate Q is given. According to Darcy’s law, groundwater discharge given ∂h by -Q equals -2πrT . The factor 2πr is required to represent the uniform distribution of the ∂ r total flow rate along any circumference of the well. Approaching the well, which is assumed to have a negligible radius, the second BC is obtained by

 ∂h  Q limr (r,t) = (Eq. 13.10) r↓0  ∂ r  2π T

∂h Here a limit is used on the right-hand side as it is not clear a priori whether remains finite ∂ r when r tends to 0. This completes the formulation of the mathematical problem.

The problem is solved by employing a Boltzmann transform. The idea behind this approach is that the solution of equations with a structure similar to eq. (13.8) frequently has been found to depend on the ratio r²/t only. Therefore, the Boltzmann transform is tantamount to the an- satz

h(r,t) = y(x) (Eq. 13.11) where y is an unknown function depending on a single variable x, which is related to the vari- ables r and t via

Sr 2 x = (Eq. 13.12) 4Tt

Please note that x → +∞ for r → +∞ and t → 0, respectively.

Eqs. (13.11) and (13.12) are now inserted in the model equation (13.8) in order to derive an equation for y(x). A series of manipulations lead to the linear second-order ODE

d  dy dy  x  = − x (Eq. 13.13) dx  dx dx

 dy  Q The corresponding boundary conditions are y(+∞) = h0 at infinity and lim x (x) = x↓0  dx  4π T at the well. The solution of eq. (13.13) is obtained by observing that the term in parentheses dy on the left-hand side is equivalent to the negative right-hand side. This suggests that x is dx an exponential function. Accounting for the boundary condition at x → 0 we obtain

115

Liedl / Dietrich Mathematical Methods

dy Q − x x = e (Eq. 13.14) dx 4πT

Dividing by x and integrating yields

+∞ ~ Q e − x = − ~ y h0 ∫ ~ dx (Eq. 13.15) 4πT x x

In eq. (13.15) also the boundary condition at infinity is considered. It should be noted that the integral in eq. (13.15) equals the function E1(x) defined by eq. (A.8) in Appendix 1. As men- tioned above, this function is abbreviated by W(x) and called the well function in standard textbooks on groundwater hydraulics. Following this convention, eq. (13.15) may be written as

Q y = h − W(x) (Eq. 13.16) 0 4πT

Using eqs. (13.11) and (13.12) the solution

Q  Sr2  h(r,t) = h − W  (Eq. 13.17) 0 4πT  4Tt  is achieved.

13.4 Solution of a PDE via Laplace Transform

Laplace transforms are a special type of integral transforms which may be used for solving linear PDEs, linear ODEs and linear integral equations. Another example for an integral trans- form is the Fourier transform, which is not treated in this script.

The basic idea of any type of integral transforms is (i) to replace the original problem by an- other one which is easier to solve (“transform”), (ii) to obtain the solution of the transformed problem and (iii) to use this solution in order to derive the solution of the original problem (“inverse transform”). Frequently, direct determination of the solution is much more difficult than performing these three steps which are outlined in Fig. 13.5 for the solution of a linear PDE. In this case, the transformed problem consists of an ODE (instead of a PDE), which is generally supposed to be easier to solve than the original equation. It has to be emphasised that it is not sufficient just to transform the PDE. In addition, initial and boundary conditions have to be transformed.

116

Liedl / Dietrich Mathematical Methods

transform original problem transformed problem (PDE) (Fourier or (ODE)

Laplace transform)

solution of inverse transform solution of original transformed problem problem (inverse Fourier or Laplace transform)

Fig. 13.5: General scheme for solving a linear PDE by employing an integral transform

Usually, the Laplace transform is applied to time-dependent problems and acts on the time variable as will be shown below. In this case, it does not affect the space co-ordinates. In gen- eral, the Laplace transform acts on variables which are defined in an interval bounded on one side (where all the “additional conditions” have to be given!) and unbounded on the other side such as 0 < t < +∞.

The Laplace transform f(s) of a function f(t) is defined as

+∞ f(s) = ∫ f (t)e− st dt (Eq. 13.18) 0 where s denotes the Laplace variable. The dimension of s is the inverse of the dimension of t. The function f may depend on other variables which are not affected by the integral transform. In this case, the Laplace transform also depends on these variables.

There is also a formula quantifying the inverse transform of eq. (13.18), i.e. it provides an ex- pression for obtaining f(t) if the Laplace transform f(s) is given. This formula, however, in- volves integration in the complex plane (this is equivalent to compute special integrals in 2D space) and is rarely used in practice. Rather, f(t) is found in tables of Laplace transforms. Part of such a table is shown in Fig. 13.6.

117

Liedl / Dietrich Mathematical Methods

Fig. 13.6: Table of Laplace transforms (from Abramowitz and Stegun, 1968)

Example: In the following, the Laplace transform is applied in order to solve the 1D diffusion equation

∂c ∂ 2c = D (Eq. 13.19) ∂ t ∂ x2 where c denotes concentration, t is time, x is the space co-ordinate and D is the diffusion coef- ficient. Initial and boundary conditions are given by c(x,0) = c0 and c(0,t) = c1, c(+∞,t) = c0, respectively. This situation represents diffusion of a chemical into a semi-infinite tube (0 < x < +∞).

This problem has to be transformed now, resulting in a linear ODE. For this purpose, the left- hand side of the diffusion equation (13.19) is transformed first according to eq. (13.18). In- volving partial integration results in

∂c   (x,s) = sc(x,s) − c (Eq. 13.20) ∂ t  0

Next, the right-hand side of eq. (13.19) is transformed. As this part of eq. (13.19) does not in- volve a time derivative, we simply arrive at

118

Liedl / Dietrich Mathematical Methods

 ∂ 2c ∂ 2c  D  (x,s) = D (x,s) (Eq. 13.21)  ∂ x2  ∂ x2

Therefore, the transformed model equation reads

∂ 2c D = sc − c (Eq. 13.22) ∂ x2 0

This is equivalent to a second-order ODE as there is no derivative with respect to the Laplace variable s in eq. (13.22).

Finally, the boundary conditions have to be transformed according to eq. (13.19) yielding c(0,s) = c1/s and c(+∞,s) = c0/s, respectively. Please note that the initial condition has al- ready been invoked in eq. (13.20).

The solution of eq. (13.22) is assumed to be of the form

s/ Dx − s/ Dx c0 c(x,s) = A(s)e + B(s)e + (Eq. 13.23) s with unknown functions A and B depending on s only. This approach is selected because both terms containing exponential functions are solutions of the corresponding homogeneous ODE and the third term, which is independent of x, is a special solution of the inhomogeneous ODE (13.22).

By inserting eq. (13.23) in eq. (13.22), it may be verified that cˆ(x, s) really is a solution of the second-order ODE. The unknown functions A(s) and B(s) may be determined by evaluating eq. (13.23) for x → +∞ and at x = 0, respectively. By doing this, it is found that A(s) = 0 and B(s) = (c1-c0)/s. Therefore, the Laplace transform of c(x,t) is given by

c1 − c0 − s/ Dx c0 c(x,s) = e + (Eq. 13.24) s s

From this, the solution of the original problem can be obtained by using formula (29.3.83) as shown in Fig. 13.6. Setting k = x/√D in this relationship, we arrive at

x c(x,t) = (c1 − c ) erfc + c (Eq. 13.25) 0 2 Dt 0 where erfc denotes the complementary error function as defined by eq. (A.10) in the Appen- dix. Using this definition, it may be verified that eq. (13.25) is a solution of the 1D diffusion problem discussed here.

119

Liedl / Dietrich Mathematical Methods 14 Inverse Problems

The interesting parameters of subsurface material, e.g. the hydraulic properties, can often not be directly measured. In general, a naturally or artificially induced quantity (quantities) would be registered, which is affected by the interesting parameters. The values of the parameter are then determined by the interpretation of the measured quantity (quantities). This applied mathematical procedure can be described as the solution of an inverse problem.

14.1 General Conceptions

A necessary condition for the solution of inverse problems is the possibility to describe the re- lations between the sought parameters and the measured quantities with a mathematical mod- el. The calculation of the measurable quantities for a given parameter distribution is called the solution of the forward problem. Generally, the forward problem can be expressed as a map- ping of the form

A( f ) → g (Eq. 14.1) where A is the operator, which describes the system behaviour, f is the input function and g is the output function. A general graphical illustration of the forward problem is given in Figure 14.1.

f A g

Fig. 14.1: General graphical representation of mathematical system.

Examples:

I) The forward problem for the seismic tomography can by described by a matrix equation of the form   A⋅ s = t , where the matrix A represents the length of the rays through the discretized cells of the inves-  tigation area (operator of the system behaviour), s is the vector of the slowness of the cells  (input function) and t is the vector of the travel times of the rays (output function).

II) The following partial differential equation and the related boundary condition describe the forward problem in the case of a steady flow to a well in a heterogeneous confined aquifer

∂  ∂u(x, y)  ∂  ∂u(x, y)  +   = = T (x, y)  T(x, y)  q(x, y) and u(x, y) Γ g(x, y) ∂x  ∂x  ∂y  ∂y  where T is the spatial distribution of the transmissivity and u is the distribution of the hydrau- lic head. The function q describes the sources (sinks) in the interesting area and g the hydrau- lic head on the boundary Γ of the area. In this example q and g are the input function,

120

Liedl / Dietrich Mathematical Methods

∂  ∂ ⋅  ∂  ∂ ⋅  u is the output function and the T (x, y)  + T (x, y)  de- ∂x  ∂x  ∂x  ∂x  scribe the system behaviour.

The inverse problem consists of the determination of the operator A or of the input function f. The determination of the input function is called an inverse problem of the first kind. The pre- requisite for this is the knowledge of the output function and the knowledge of the operator A.

Example: An inverse problem of the first kind is the determination of the recharge from the measured hydraulic head distribution if the transmissivity distribution and the boundary conditions are known.

The aim of an inverse problem of the second kind is the determination of the operator A based on the knowledge of the input and output function.

Example: For a better understanding of the flow process in a given aquifer, the spatial distribution of the transmissivity is to be determined. For this purpose, different pumping tests are carried out. The pumping parameters are equivalent to the input function. The measured hydraulic head values represent the output function. The sought transmissivity distribution is a part of the op- erator, which describes the system behaviour.

Two further terms, which are related to the inverse problem of the second kind, are the model calibration and the parameter identification. The model calibration involves the adjustment of the structures and parameter values of the model in the investigated area. The adjustment can be carried out simultaneously (the structures and parameter values are determined at the same time) or sequentially (the structures are first determined, and then the parameter values are de- termined). If the problem consists only of the determination of the parameter values for given structures, then the solution of the inverse problem is called parameter identification.

14.2 Ill-Posedness of an Inverse Problem

If one of the three following properties of the solution of the inverse problem is not fulfilled, then the problem is ill posed:

• Existence, • uniqueness and • stability.

14.2.1 Existence

Intuitively, it can be assumed that the existence of the solution is not a problem, since the physical reality must be a solution. In practice, however, observation errors (or noise) of the measured quantities cannot be avoided. Also, the parameterisation (or discretization) of the problem can be inadequate for representing reality. As the result of both, an accurate solution of the examined inverse problem may not exist.

An example of this is demonstrated in the interpretation of a pumping well test in a heteroge- neous aquifer with the Theis method. A basic assumption for this interpretation method is

121

Liedl / Dietrich Mathematical Methods homogeneity of the aquifer. Due to the existing heterogeneity in the distribution of aquifer pa- rameters, it is not possible to find a transmissivity value which satisfies all observation data.

14.2.2 Uniqueness

If the measured quantities can be satisfied by different parameter sets, the solution is non unique. This nonuniqueness can be caused by the physical behaviour of the system or by the suitability of the used measurement configurations. Especially, the solution of inverse prob- lems of potential field methods, e.g. DC-geoelectrics and stationary groundwater hydraulics, is often nonunique for physical reasons.

Example:

I) The gravitational potential U at a point with the coordinates x’, y’ and z’ can be calculated using the formula

σ U (x' y', z') = γ dx dy dz , ∫∫∫ 2 2 2 x y z (x'−x) + (y'−y) + (z'−z) where γ is the gravitational constant and σ the density distribution. It can be shown with this formula, that the gravitational potential outside of the sphere with a spherical symmetric den- sity distribution depends only on the total mass and not on the given density function.

a π 2π a σ (r)r 2 sinθ 2πγ U (R) = γ dϕ dθ dr = σ (r)[R + r − R − r ]r dr ∫ ∫ ∫ 2 2 R ∫ r=0θ =0ϕ =0 R + r − 2rR cosθ r=0 a γ γm U (R) = σ (r)r 2dr = , R ∫ R r=0

(R – distance of the point P(x’, y’, z’) to the centre of the sphere, a(

The nonuniqueness can be mathematically investigated by the analysis of the problem

A( f ) → g = 0 (≠ A( f ) → 0) . (Eq. 14.2)

If non-trivial solutions of the inverse problem exist which fulfilled this mapping prescription, then these non-trivial solutions characterise the nonuniqueness.

122

Liedl / Dietrich Mathematical Methods

14.2.3 Stability

Stability characterises the behaviour of the inverse problem solution by considering the influ- ence of small deviations in the known output function. An inverse problem is stable if small variations of the output function cause only sufficiently small variations in the sought input function or in the parameter values characterising the operator A.

A) target velocity model; B) result of reconstruction using complete ray-path coverage; C) reconstruction using data from measurements with borehole and surface instruments; D) reconstruction using cross hole data only.

Fig. 14.2: Example for the influence of ray coverage on the solution of the inverse problem of seismic tomography (from Jackson & Tweeton, 1994).

Example: In DC-geoelectrics the relationship between the measured parameters (the voltage V and the induced electrical current I) and the resistivity ρa of the subsurface material can be expressed in a first approximation by the formula

ρ V a = , K I

123

Liedl / Dietrich Mathematical Methods

where K is a geomectrical factor which depends on the used measurement configuration. From this formula it is obvious that the interpretation of measurements with small configura- tion factors (e.g. Wenner configuration) is more stable than the interpretation of measure- ments with high configuration factors (e.g. dipole-dipole configuration with a great dipole dis- tance).

14.3 Solution Methods

14.3.1 Trial and Error Method

The simplest method for solving inverse problems is the trail and error procedure. It only needs:

• some values of the output function and • a numerical algorithm for the solution of the forward problem.

The application of the trial and error method can be very tedious and the progress at the de- termination of solution of the inverse problem depends on the experience of the user.

14.3.2 Direct Solving

Another approach for solving inverse problems is a transformation of to a new mapping pre- scription, where the sought quantities are the new output function. For example

A( f ) → g ⇒ B(g) → f . (Eq. 14.3)

This approach is not always possible (e.g. if the output function g is not completely known). Sometimes it leads to an unstable mapping prescription B.

Example:   If the original forward problem can be described by the matrix equation A⋅ x = b and the inter-  esting quantity is the vector x then the inverse problem can be solved by

  A⋅ x = b −  −  A 1 ⋅ A⋅ x = A 1 ⋅b  −  x = A 1 ⋅b

A prerequisite is that the matrix A is not singular. It must be mentioned that the calculation of the inverse matrix A-1 is often very difficult due to the size of the matrix. For instance if the matrix A describes the relationship between 100 measurement values and 100 sought parame- ters the dimension of the matrix is already 100 x 100.

124

Liedl / Dietrich Mathematical Methods

14.3.3 Indirect Solving

Another type of approach for the solution of inverse problems is based on the minimisation of an error functional. The most common functional is the Output Least Squares Criterion

L 2 = cal − obs J ( p) ∑[gl ( p) gl ] , (Eq. 14.4) l=1

obs cal where L is the number of measured data gl and gl are the corresponding solutions of the forward problem using the parameter distribution p. The basic idea of this approach is the fol- lowing assumption: If E(p2 ) < E(p1 ), then p2 is better than p1 . Consequently, the inverse solu- tion psol may be obtained by solving the following optimisation problem

E(psol ) = min E( p) with P = {p | all physically admissable parameter sets}. p∈P The basic step of most optimisation methods is the calculation of the gradient of E(p) in terms of the sought parameters. In the numerical application, this gradient corresponds to the prod- uct of the Jacobian matrix J with the deviation between the calculated and observed values

T  cal cal  ∂g1 (p) ∂g1 (p)    g cal (p)− g obs   p1 pn  1 1 T   E'( p) = 2⋅ J ⋅ ∆g = 2⋅         (n - number of parameters). (Eq. 14.5)  cal cal  cal obs ∂gl (p) ∂gl (p)  −     gl (p) gl   p1 pn 

The idea behind this gradient is that the matrix calculates the opposite direction from the actu- al parameter set to a local minimum of the error functional. And in the case of reaching a min- imum of the error functional, this gradient is equal to 0.

Selected methods of improvement of a given parameter set for a minimisation of E(p)

I) Gradient method: A simple method based on the direct use of the gradient E’(p). The improvement ∆p of the parameter set is calculated by

∆p = −α ⋅ E'(p), (Eq. 14.6) where the coefficient α can be determined by a trial and error procedure.

II) Second order method: The starting point for this method is the condition that the gra- dient E’(p) is 0 for a minimum of E(p) and that E’(p) can be approximated by the Taylor se- ries

0 = E'( p) + E''( p)⋅ ∆p + ... = E'( p) + H ( p)⋅ ∆p + ... , (Eq. 14.7) where H(p) is called the Hessian matrix and can be approximated by J T ⋅ J . The improvement ∆p of the parameter set is then calculated by

125

Liedl / Dietrich Mathematical Methods

−1 −1 ∆p = −(J T ⋅ J ) ⋅ E'(p) = −(J T ⋅ J ) ⋅ J T ⋅ ∆g . (Eq. 14.8)

The above mentioned methods all work iteratively with the following iteration prescription

pi+1 = pi + ∆pi , (Eq. 14.9) where i indicates the number of the iteration step.

126

Liedl / Dietrich Mathematical Methods 15 References

Abramowitz M., Stegun I. A. (1968): Handbook of mathematical functions, Dover Publ.

Bronshteyn I. N., Semendyayev K. A. (1997): Handbook of Mathematics, Springer, 3rd ed.

Carslaw H. S., Jaeger J. C. (1959): Conduction of heat in solids, Oxford University Press, 2nd ed.

Collatz L. (1973): Differentialgleichungen, Teubner, 5th ed.

Crank J. (1975): The mathematics of diffusion, Oxford Science Publ., 2nd ed.

Davis J. C. (1986): Statistics and data analysis in geology, John Wiley & Sons.

Dransfeld K., Kienle P (1975): Physik II - Elektrodynamik, Oldenbourg.

Eisenreich G., Sube R. (1996): Technical Dictionary of Mathematics – English / German / French / Russian, Langenscheidt, 4th ed.

Freeze R. A., Cherry J. A. (1979): Groundwater, Prentice Hall.

Gradshteyn I. S., Ryzhik I. M. (1994): Table of integrals, series, and products, Academic Press, 5th ed.

Graham D., Graham C., Whitcombe A. (1995): A level mathematics, BPP (Letts Education- al).

Stephenson G., Radmore P. M. (1990): Advanced mathematical methods for and science students, Cambridge University Press.

Waltham D. (2000): Mathematics – A simple tool for geologists, Blackwell, 2nd ed.

Yeh T.-C. J. (1989): One-dimensional steady state infiltration in heterogeneous soils, Water Resour. Res. 25, 2149-2159.

Zachmann H. G. (1981): Mathematik für Chemiker, Verlag Chemie, 4th ed.

Zwillinger D. (1998): Handbook of differential equations, Academic Press, 3rd ed.

127

Liedl / Dietrich Mathematical Methods Appendix 1: Some Special Functions

A1.1 Dirac "Function"

The Dirac “function” is used for modelling pulses, i.e. processes which have infinitely large speed within an infinitely small period of time. However, the total energy, mass or volume stored in the pulse is always equal to 1. Dirac “functions” may also be employed for model- ling sharp peaks, i.e. where some physical quantity is concentrated in an infinitely small area before it starts to spread.

The Dirac “function”, which is commonly abbreviated by δ(x), is defined by

x 2  1 − ( )  δ(x) = lim e a  (A1.1) a↓0  πa 

This definition is visualised by Fig. A1.1 which shows several graphs of the expression en- closed in the outer parentheses in eq. (A1.1) for different values of a. It is seen that the peaks become sharper and sharper as a tends to 0. In the limit, the Dirac “function” δ(x) is ap- proached. Therefore, δ(x) = 0 for all arguments x ≠ 0 and δ(0) = +∞. This infinite value is the reason why δ(x) actually does not represent a function which must have finite values. Never- theless, the terms Dirac “function” or δ “function” are used.

3 y

2 a=0.25

1

a=0.5

a=1.0 0 x -3 -2 -1 0 1 2 3

Fig. A1.1: Definition of the Dirac “function” according to eq. (A.1)

From eq. (A1.1) it may be suspected that the area between each graph and the x-axis is the same. In particular, it can be shown that all these areas are equal to 1. For a → 0 this results in the most basic relationship with respect to Dirac “functions”, i.e.

+∞ ∫ δ(x)dx =1 (A1.2) −∞

128

Liedl / Dietrich Mathematical Methods

This is the mathematical equivalent to a statement made above, i.e. that the energy or mass or volume stored in a δ pulse is equal to 1.

Eq. (A1.2) be generalised yielding

+∞ +∞ ∫ f (x~)δ(x − x~)dx~ = ∫ f (x − x~)δ(x~)dx~ = f (x) (A1.3) −∞ −∞ for any function f(x) which is defined for all real x. In this equation the integrands are equal to 0 unless x~ = x in the first integral or x~ = 0 in the second integral. Therefore, δ may be viewed as a weighting function attributing “full” weight to f(x) only (Fig. A1.2). If f(x) = 1, eq. (A1.3) reduces to eq. (A1.2).

y

~ y=f(x)

f(x)

x ~ (x-x)~ = 0 ~ δ(x-x) = 0 δ x

δ(x-x)~ = + 8

Fig. A1.2: Diagram illustrating eq. (A.3)

Similar formulae apply when real numbers a, b are used as limits of integration, i.e.

 f (x) if a < x < b b x−a  1 f (a) if x = a ~ ~ ~ ~ ~ ~  2 f (x )δ(x − x )dx = f (x − x )δ(x )dx =  1 (A1.4) ∫ ∫ = a x−b  2 f (b) if x b  0 if x < a or x > b

Eq. (A1.3) is found to be a special case of eq. (A1.4) when a and b are approaching -∞ and +∞, respectively.

129

Liedl / Dietrich Mathematical Methods

A1.2 Heaviside Function

The Heaviside function, which is commonly denoted by H(x) or u(x), is a step function de- fined by

0 if x < 0  1 H(x) =  2 if x = 0 (A1.5)  1 if x > 0

Eq. (A1.5) is illustrated by Fig. A1.3 below. It should be noted that H(0) = ½ has been chosen here for the sake of symmetry. H(0) could be equal to any value in the interval 0 ≤ y ≤ 1.

y

y=H(x) 1

0.5

0 x

Fig. A1.3: Heaviside function

The Heaviside function may be seen as an indefinite integral of the Dirac “function” because the slope of H(x) is 0 for x ≠ 0 and it is infinitely large for x = 0 where H exhibits a jump. In particular, we have

x ∫ δ(x~)dx~ = H(x) (A1.6) −∞

A1.3 Exponential Integral

The exponential integral Ei(x) is obtained as a solution of some partial differential equations. For example, the Theis formula, expressing the transient decrease of hydraulic head in a con- fined aquifer due to pumping activities, is related to the exponential integral. Ei(x) is defined by

x ~x  e ~  ∫ ~ dx if x < 0  −∞ x Ei(x) =  ~ ~ (A1.7)  −a e x x e x  lim d~x+ d~x  if x > 0  a↓0  ∫ ~ ∫ ~    −∞ x a x 

130

Liedl / Dietrich Mathematical Methods

As the integrand has a pole at 0, this value is excluded from the domain of Ei(x). For the same reason, the definition of Ei(x) for x > 0 is a little bit more complicated than for x < 0. By em- ploying the limit a → 0, one ensures that the pole of the integrand is excluded from the inter- val of integration. It is found that the term in brackets converges for all positive x. However, explicit expressions for the integrals occurring in eq. (A1.7) are not available so that numeri- cal evaluation of this formula is required.

In several applications the function E1(x) is needed. This function is closely related to the ex- ponential integral according to

+∞ ~ e − x = − − = ~ E1(x) Ei( x) ∫ ~ dx (A1.8) x x

E1(x) is defined for x > 0 only and is sometimes also termed the exponential integral. To in- crease confusion, the notation W(x) is used in most hydrogeology textbooks where the Theis formula (mentioned above) is presented. W(x) is also given by the right-hand side of eq. (A1.8), i.e. W(x) = E1(x). The graphs of Ei(x) and E1(x) are shown in Fig. A1.4 for x > 0. For negative arguments, the graph of Ei(x) is obtained by simply rotating the E1 curve by 180° around the origin.

Fig.A1.4: Graphs of Ei(x) and E1(x) for positive arguments (from Abramowitz and Stegun, 1968)

131

Liedl / Dietrich Mathematical Methods

A1.4 Error Function and Complementary Error Function

Error functions and complementary error functions frequently arise as solutions of model equations for advective-dispersive transport, diffusion or heat transfer in Cartesian co-ordinate systems. The error function is defined for all real x by

x 2 ~ 2 erfx = ∫ e − x dx~ (A1.9) π 0

As shown in Fig. A1.5, erf is strictly monotonically increasing with a zero at x = 0 which also is a point of symmetry. The error function has an asymptote y = 1 for x → +∞ and an asymp- tote y = -1 for x → -∞. However, there is no explicit expression for the integral in eq. (A1.9) so that numerical evaluation is required.

The complementary error function is given by

+∞ 2 ~ 2 erfcx =1−erfx = ∫ e − x d~x (A1.10) π x for all real x. The complementary error function is strictly monotonically decreasing with a point of symmetry at (0,1). It has an asymptote y = 0 (x-axis) for x → +∞ and an asymptote y = 2 for x → -∞ (Fig. A1.5).

y 2

erfc(x)

1

0 -2 -1 0 1 2 x

erf(x) -1

Fig. A1.5: Error function and complementary error function

erf and erfc are closely related to the cumulative distribution function of a Gaussian probabil- ity distribution. This could have been expected, as the integrand in eq. (A1.9) – and in eq. (A1.10) as well – is proportional to the probability density function (pdf) of a Gaussian distri- bution (see Fig. 2.4a). For a zero mean and a unit variance, the pdf of a Gaussian distribution is given by

1 1 − x 2 ϕ(x) = e 2 (A1.11) 2π

132

Liedl / Dietrich Mathematical Methods and the corresponding cumulative distribution function (cdf) is obtained by integrating eq. (A1.11), i.e.

x 1 2 1 − x~ Φ(x) = ∫ e 2 dx~ (A1.12) 2π −∞

Therefore, the value of Φ(x) is the area enclosed by the pdf, the horizontal axis and a vertical line segment at x. Φ(x) may now be expressed in terms of the (complementary) error function via

1  x  1 x Φ(x) = 1+ erf  =1− erfc (A1.13) 2  2  2 2

These relationships may easily be solved for erf and erfc, resulting in

erfx = 2Φ( 2x) −1 (A1.14) and

erfcx = 2 − 2Φ( 2x) (A1.15) respectively.

133

Liedl / Dietrich Mathematical Methods

Appendix 2: Exercises

134

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 2:

2.1 Established through pump tests of an investigated region are the following hydraulic -1 conductivities, kf [ms ]:

3.8E-3 5.1E-2 7.4E-3 1.0E-3 3.9E-2 7.6E-3 7.2E-3 7.9E-3 3.8E-3 4.7E-3 2.7E-2 7.8E-4 1.9E-2 7.5E-4 8.2E-4 1.7E-2 2.4E-2 4.0E-3 1.3E-2 4.1E-3

Determine for the values of kf and for the log values (ln kf) a) the mean value x , b) the median, c) the extreme values (min,max), d) the standard deviation σn-, e) the skewness, f) the quartiles x1/4 and x3/4, g) and the range R.

Draw for the ln kf –distribution a histogram and the accompanying cumulative distribu- tion plot.

2.2

b

a

After taking 10 measurements of each side a and b, establish the lengths of a and b and the area A of the rectangle. (Note: There exists an inner and an outer edge.) State the error associated with the measurement of the area by using the following formula: 2 2 σA = (b σa) + (a σb)

2.3 Construct the regression curve for the following data and then plot the data and the re- gression curve together. Show how the formulas were used to calculate the coefficients and state the resulting regression equations.

x 1.38 1.98 3.18 3.56 4.9 6.21 6.44 7.47 8.36 8.81 y 8.19 17.77 20.12 14.55 20.17 31.22 28.94 34.79 40.26 38.99

135

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 3:

3.1 Calculate the derivatives f '(x) of the following functions: 2 1 a) f (x) = 3x 5 + − x 2 , x 2 b) f (x) = x a sin x,

cos x c) f (x) = , 1+ x 4 d) f (x) = e a sin bx

dM 3.2 Calculate the desorption rate for the following time history dt

6M ∞ 1  Dt  = o − 2 2 M (t) ∑ 2 exp n π 2  π n=1 n  a 

of the mass of sorbed particles during a desorption process with M o = sorbed mass at time t = 0, D = diffusion constant, a = grain radius (compare with Crank, 1975).

3.3 Expand the function f (x) = cos x into a Taylor series including up to the fourth order term. Use a = π/4 as the point of expansion.

3.4 Determine an approximate solution of the equation x = cos x , whereby cos x is replaced by the 2nd order Taylor series approximation ( a = π/4 ), i.e. take only the terms up to sec- ond order from the solution of Problem 3.3.

136

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 4:

4.1 Calculate the indefinite integral for 2 1 a) f (x) = 3x 5 + − x 2 , x 2 b) f (x) = xsin ax, sin x c) f (x) = 1+ cos x

+∞ 4.2 Calculate the improper integral ∫ f (x)dx for 0 1 a) f (x) = , 1+ x 2 x b) f (x) = , 1+ x 2 2 c) f (x) = xe−ax for a > 0

1 4.3 Calculate the improper integral ∫ f (x)dx for 0 1 a) f (x) = , − 2 1 x x b) f (x) = 1− x 2

2 4.4 Calculate the improper integral ∫ f (x)dx for 0 1 a) f (x) = , 1− x 1 b) f (x) = , 1− x 1 c) f (x) = (1− x) 2

137

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 5:

5.1 Under certain conditions, dissolution kinetics of Calcite can be described with the help of the differential equation

4 d  c(t)   c(t)    = k1−      dt  ceq   ceq 

-3 -3 where c is the solution concentration [ML ], ceq is the equilibrium concentration [ML ], and k is an empirically determined mass transfer coefficient [T-1]. Solve this differential equation for the initial condition c(t=0) = c0.

5.2 Under the influence of a constant groundwater recharge N, one-dimensional stationary flow in an unconfined aquifer (with homogeneous conductivity K) is described by the differential equation

d  dh   Kh  = −N dx  dx 

Determine the head distribution h(x) in the interval 0 ≤ x ≤ L for the boundary conditions h(0) = h0 and h(L) = hL.

5.3 Steady-state vertical flow in heterogeneous soil can be modelled by the differential equa- tion

dh K(x)eα (h−x) = −q dx

(e.g. Yeh, 1989). Thereby h is the hydraulic potential [L], q is the flow velocity per cross- sectional area [LT-1], K(x) is the spatially dependent conductivity [LT-1] and α > 0 is a fitting parameter [L-1]. a) Determine the solution h(x) of the above-mentioned differential equation for the boundary condition h(0) = h0. b) Simplify the solution from part a) under the assumption of a spatially constant con- ductivity K(x) = K.

138

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 6:

6.1 Which of the following vectors are orthogonal to each other:

 2  2  1  2         a = − 3 , b = 3 , c = − 2 , d = 4          8  8  −1 1

6.2 The vertices of a triangle in Cartesian coordinates are given: A = (1 / 2 / 4), B = (-3 / 8 / 2), C = (9 / 4/ -1). Calculate for this triangle a) the lengths of the sides, b) the inner angles, c) and the area.

6.3 Three points P1(3,1), P2(1,2), P3(2,2) are given. Establish for the straight line through points P1and P2 a) the normal equation, b) the point-slope equation, c) the 2 point equation, d) the intercept equation, e) the normal equation of Hesse, f) the vector representation, g) and calculate the distance from P3(2,2) to the line.

6.4 Determine the horizontal and vertical components of the real velocity of a particle (not the Darcy velocity) for groundwater that flows at a 300 incline from horizontal. Assume 0 that the potential gradient along the flow path is 1 /00. (Aquifer parameters: hydraulic conductivity = 2E-4 m/s, effective porosity = 20 %.)

139

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 7:

3 0 2  7     7.1 Calculate Ax for A = 5 −1 3  , and x = 4 .     2 4 − 7 1

 2 7 1   7.2 Calculate AB for A (from Problem 1.) and B =  8 4 0 .   − 3 −1 8

7.3

z

K2 J β K1

α x 0

On this sketch of an anisotropic aquifer is the hydraulic conductivity tensor K with the  cos 2 β sin β cos β  longitudinal components KL = K1  and the transverse compo-  2  sin β cos β sin β   cos 2 β sin β cos β  nent KT = K2  together. The corresponding component of the  2  sin β cos β sin β  potential gradient J is

cosβ − sin β JL = J cos(α − β)  and JT = J sin(α − β)  .  sinβ   cosβ  Calculate a) the hydraulic conductivity tensor K = KL + KT, b) the determinant from K, KL and KT for K1 = K2, c) the potential gradient J = JL + JT as well as the magnitudes |J|, |JL|, |JT| d) the Darcy velocity q and the magnitude |q|, e) and the angle between the gradient and the Darcy velocity vector,

sin(x ± y) = sin x cos y ± cos xsin y, Note: cos(x ± y) = cos x cos y  sin xsin y.

140

Liedl / Dietrich Mathematical Methods

1 2 2 7   1 3 3 2 7.4 Calculate the inverse matrix from A = . 3 9 9 2     2 6 3 5

141

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 8:

8.1 Solve the system of equations 2x1 + x2 + x3 = 2 x1 + 3x2 + x3 = 2 2x1 + x2 + 7x3 = 2

a) with Cramer’s rule, b) with inversion of the coefficient matrix, c) with the Gaussian algorithm.

8.2 Solve the system of equations x1 - x2 + x3 = 4 x1 + 2x2 + x3 = 13 2x1 + 4x2 + 2x3 = 26 4x1 + 5x2 + 4x3 = 43

 5 7 3 8  61      7 5 6 6 55 8.3 Solve the system of equations Ax = b with A = and b = .  6 3 3 4 40         11 1 10 2  43

8.4 Determine the particular values of λ, which give non-trivial solutions for the system of equations Ax = λx, where

2 1 − 2 / 3   A = 2 3 − 4 / 3   3 3 −1 

and then calculate for each of the found values the solution set.

142

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 9:

9.1 Conduct for a rectangle with corner points (1,1), (3,1), (3,2), and (1,2) successive trans- formations through: a) a shift of three units in the x-direction and two units in the y-direction, b) a 90 degree counter-clockwise rotation around the point (4,3), c) a shearing in the x-direction by a factor of 2, d) a scaling in the y-direction by a factor of 3. Present the result of each step graphically and state the corresponding transformation ma- trix.

9.2 State the two transformation matrices which make possible a direct transformation 1) from the initial state in Problem 1 to the final state and 2) from the final state in Problem 1 to the initial state.

9.3 On the coordinates (3, 2, -5) in a Cartesian coordinate system, lies the centre of a sphere with a two unit diameter. Show a coordinate transformation that gives a constant coordi- nate for the spherical surface.

9.4 The coordinates for two different Cartesian coordinate systems are given for the three points: Coordinate system 1 Coordinate system 2 P1 (102, 50) (2, 10) P2 (112, 50) (10, 4) P3 (102, 80) (20, 34)

Establish the transformation matrix for the coordinate transformation between both coor- dinate systems.

143

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 10:

10.1 Determine the solution to the equation x3 + 3x + 3 = 0 using Newton’s Method with an accuracy of 4 decimal places.

10.2 The equation x = cos x should be solved with the use of the so-called relaxation factors λ with the iteration recipe x(n+1) = λcos x(n) + (1- λ)x(n). a) Sketch F(x) = λcos x + (1- λ)x for the values λ = 0.3, 0.5, 0.7, 1.0. For which of these λ values are alternating or monotone convergence expected? b) Calculate for λ = 0.3, 0.5, 0.7, 1.0 approximations of x = cos x with an accuracy of 3 decimal places in each case starting with x = 0.5. How many iterations are necessary in each case?

10.3 For which values of λ in Problem 10.2 does the iteration method diverge if the starting value x(0) lies “near” the solution x = 0.739.

144

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 11:

11.1 Calculate the partial derivatives of the first order for a) f (x, y) = e 2x + y 2

2 b) f (x, y) = e 2x+ y

c) f (x, y, z) = xy 2 z 3 d) f (x, y, z) = xsin(y 2 ) + x 2 + z 2

11.2 Calculate the mixed partial derivatives of the second order for a) f (x, y) = cos(xy)

b) f (x, y, z) = xyz + x 2e z + z 4 ln y

145

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 12:

12.1 Calculate for the scalar field h(x, y) = x 2 + y 2 a) the equipotential lines, b) gradh, c) ∆h .

 2 −   x yz  12.2 Calculate for the vector field v(x, y, z) =  z 2 − xy     2   y − xz a) the divergence, b) the curl (rotation).

12.3 Calculate the general curlgradh for any hydraulic head h = h(x, y, z) and interpret the result for steady-state flow in a homogeneous aquifer.

146

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 13:

13.1 Which of the functions f (x, y) = x 2 , f (x, y) = xy , f (x, y) = xy 2 , f (x, y) = xy + ln x , and f(x,y) = xy + ln(xy) are solutions of the partial differential equation

∂ 2 f = 1 ∂x∂y

13.2 In a domain with length L and of constant cross-sectional area, diffusion may be mod- elled by means of the 1D diffusion equation

∂c ∂ 2c = D ∂t ∂x 2

for the region 0 ≤ x ≤ L and t ≥ 0 . Assume that no concentration gradient exists per- pendicular to the x direction. 2 a) Verify that the function c(x,t) = αe -β Dt cos(βx) is a solution to the above differential equation (α, β are arbitrary positive constants). b) Determine β such that the boundary condition c(L,t) = 0 is fulfilled. L M c) Additionally, determine α so that the initial condition ∫ c(x,0)dx = 0 is fulfilled 0 A (M0 = dissolved mass at time t = 0). d) Plot the concentration distribution c = c(x,t) for increasing t values. e) At which time does the concentration at x = 0 fall to half of its initial value? ∂c f) Calculate the mass flow rate Q = −AD as a function of time at the borders x = 0 ∂x and x = L. g) Calculate the dissolved mass M(t) in the entire domain.

147

Liedl / Dietrich Mathematical Methods

13.3 The function

+∞ (x−x′)2 1 − = ′ 4Dt ′ c(x,t) ∫ cinit (x ) e dx 4πDt −∞

is the solution of the diffusion equation

∂c ∂ 2c = D ∂t ∂x 2

in a 1D domain infinite in both directions for an arbitrary initial concentration

c(x,0) = cinit (x) . a) Determine c(x,t) for the case in which the diffusing substance is concentrated at time t =0 at the points x = -a and x = a, i.e., for the initial condition

cinit (x) = m1δ(x + a) + m2δ(x − a) .

Plot the concentration distribution for several different times. b) Determine c(x,t) for the initial condition

c1 for x < 0 cinit (x) =  c2 for x > 0

In this way, the process modelled is that which begins to occur after the removal of a partitioning wall from a tank that initially contains concentrations c1 and c2, respec- tively, on each side of the wall. Plot the concentration distribution for several differ- ent times. c) Determine c(x,t) for the initial condition

c1 for − a < x < a cinit (x) =   0 for x > a or x < −a

Here, the initial conditions with finite extent are investigated. Inside of this area, the initial concentration is constant. This corresponds to the removal of two partitioning walls at x = a and x = -a and corresponding diffusion into the adjacent regions. Plot the concentration distribution for the several times.

148

Liedl / Dietrich Mathematical Methods

Problems Related to Chapter 14:

14.1 The equation y = x² + 3 describes the forward problem for the relation between x and y and for x < -3. Formulate (if possible) the inverse problem x = f(y) and characterise it (well- or ill-posed). Substantiate your characterisation.

14.2 The equation y = exp(-x) – 0.01 describes the forward problem for the relation be- tween x and y and for x > 10. Formulate (if possible) the inverse problem x = f(y) and characterise it (well- or ill-posed). Substantiate your characterisation.

149