Chapter 2

Vector algebra and vector calculus

Peter­Wolfgang Gr¨aber Systems Analysis in Water Management CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

On the basis of simple, well-known representations of vector calculus the basic rules of the vector algebra are specified. Subsequently, the rules of vector differentiation with descriptive examples are discussed.

52 2.1 Unit vectors

Different unit vectors of vector representations are dependent on the use of coordinate system. Then the vector �a can be expressed as the sum of multiples of the unit vectors. The unit vectors have the length (magnitude) one|e| = 1, and are always pa rallel to the coordinate system axis. For the practical work in water management three coordinate systems, the Cartesian, the cylindri- cal and the spherical, are generally used. In table 2.1 the vector �a is described in each of this three coordinate systems (also see figures 2.2 and 2.1).

Table 2.1: coordinate systems for description of vectors coordinate unit vector�a system vectors → → → → → → → Cartesian i � j � k a=a x i+a y j+a z k → → → → → → → cylindrical r � φ� z a=a r r+a φ φ+a z z → → → → → → → sphericalrisch r � θ � φ a=a r r+a θ θ+a δ φ

Figure 2.1: vector representation in Cartesian coordinates

In two-dimensional space the polar coordinate system will be used (see Figure 2.3).

Peter­Wolfgang Gr¨aber Systems Analysis in Water Management CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

Figure 2.2: vector representation in spherical coordinates

Figure 2.3: vector representation in two-dimensional space

Since the vector �a is independent of the used coordinate system, the following conver- sion is applicable between the Cartesian and the polar coordinate system:

2 2 ar = ax +a y =|�a| a a =� arctan y α a � x � (2.1)

ax = cot (aα)·a y

ax = cos (aα)·|�a|

54 2.2 Algorithms

In the following some important basic arithmetic rules for vectors are to be demon- strated by examples in the Cartesian coordinate system.

• Addition The arguments of the Cartesian unit vectors are respectively added in the vector addition:

�a+ �b=(a x +b x)�i+(a y +b y)�j+(a z +b z)�k (2.2)

Notice: This relationship applies only to the Cartesian coordinate system and can not be transferred to other coordinate systems. In the vector algebra the following laws apply:

commutative law A�+ B�= B�+ A� (2.3)

distributive lawm(n A�) = (mn)A�=n(m A�) (2.4)

distributive law(m+n) A�=m A�+n A� (2.5)

distributive lawm( A�+ B�)=m A�+m B� (2.6)

associative law A�+( B�+ C�)=(A�+ B�)+ C� (2.7)

• Magnitude The magnitude of a vector is equal to its length and thus a scalar, which is direction-independent. 2 2 2 |�a|= ax +a y +a z (2.8) In paticular it applies that the magnitude� of the unit vector is equal to one.

|�i|=| �j|=| �k|=|�r|=|�α|=| �δ|=1 ( 2.9)

• Product There are two kinds of vector products with respect to the vector algebra, the scalar product (dot product) and the vector product(cross product). The scalar product between two vectors is defined:

�a· �b=|�a| · | �b| · cos(�a��b) (2.10)

Peter­Wolfgang Gr¨aber Systems Analysis in Water Management CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

Hence the scalar product between two vectors is equal to zero, if they stand perpendicularly to each other. In particular it applies that the scalar product of a vector with itself, i.e. the square, is equal to the square of the magnitude:

0 �a⊥�b    |�a| · |�b| �a� �b  �a· �b=  (2.11)   −|�a| · |�b| �a�� �b   |�a| · |�b| · cos �a��b generally    � � Particularly for the unit vectors:

�i· �j = 0; �i· �k=0; �j· �k=0; �r· �α = 0; �r· �z = 0; (2.12) �i· �i = 1; �j· �j = 1; �k· �k=1; �r· �r=1; �α· �α = 1; �z· �z = 1;

According to the above algorithms we compute the scalar product as follows:

�a· �b =(ax�i+a y�j+a z�k)·(b x�i+b y�j+b z�k) (2.13)

=a xbx +a yby +a zbz

For computing the angle between two vectors we use the equation:

a b +a b +a b cos(�a��b) = x x y y z z (2.14) 2 2 2 2 2 2 ax +a y +a z bx +b y +b z � � The cross product between two vectors yields a vector:

�a× �b= �v (2.15)

its magnitude is equal to the positive area of the parallelogram having �a and �b as sides |�v|=|�a× �b|=|�a| · | �b| · sin(�a��b)

and its direction is perpendicularly to �a and �b:

�v⊥�a and �v⊥�b

56 2.2. Algorithms

Generally:

0 �a��b    |�a| · |�b| �a⊥�b  |�a× �b|=  (2.16)   −|�a| · |�b| �b⊥�a   |�a| · |�b| · sin(�a��b) generally    For the Cartesian coordinate system applies:

�i �j �k � � � � �a× �b= � � (2.17) �ax ay az� � � � � � � �bx by bz � � � � � � � Especially for unit vectors: � �

�i× �j = 1 �i× �k = 1 �j× �k = 1|�r× �α|=1|�r× �z|=1 � � � � � � � � �� � � � �� � � � �� � � i× j�= k � i× k�= j � j× k�= i �r× �α= �z �r× �z= �α

�i× �i = 0 �j× �j = 0 �k× �k = 0|�r× �r|=0|�α× �α|=0|�z× �z|=0 � � � � � � (2.18) � � � � � � � � � � � � Notice: For the vector product the commutative law is not applicable, but the anticom- mutative: �a× �b=− �b× �a (2.19) The vector product is still distributive:

�a×( �b+ �c)= �a× �b+ �a× �c (2.20)

• Differentiation In vector analysis we speak of three different kinds of differentiation, the (grad), the divergence (div) and the or rotation (rot) of a vector. For all three methods a uniform differential vector, the Nabla operator∇ applies (see table 2.2). Table 2.3 shows the ways of writing of the different kinds of differentiation in the overview as a function of the used coordinate system. For

57 CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

further simplification the Laplace differential operator� will be used. This is equal to the double application of the Nabla operator: Δ =∇·∇ (2.21)

Table 2.2: Description of the NABLA operator in different coordinate systems

coordinate system

∂ ∂ ∂ Cartesian �= �i+ �j+ �k ∂x ∂y ∂z

∂ 1 ∂ ∂ cylindrical �= �r+ · −→ϕ+ �z ∂r r ∂ϕ ∂z

∂ 1 ∂ 1 ∂ −→ spherical �= �r+ · −→ϕ+ · θ ∂r r· sinθ ∂ϕ r ∂θ

For the gradient

∇ϕ = gradϕ (2.22)

scalar ϕ=⇒ vector∇ϕ

∂ −→ ∂ −→ ∂ −→ ∂ϕ−→ ∂ϕ−→ ∂ϕ−→ ∇ϕ= i+ j+ k ϕ= i+ j+ k ∂x ∂y ∂z ∂x ∂y ∂z � � the Nabla operator is applied to a scalar fieldϕ. The result for this is a vector. The gradient can be regarded as the formal multiplication of the Nabla operator with a scalar. In the field of the hydrogeology this quantity can be the groundwater levelh, fieldsT , concentration distribu tionsC, evaporation

or groundwater regeneration ratesv N and others. There scalars () are non- directional and have thereby no vector character. However they are location dependent. The most important application of the gradient is the Darcy law for the computation of the groundwater flow velocity (see section 7.1 ). �v=−k gradh (2.23)

Example for the gradient: The groundwater level of an aquifer is indicated by the function: h=2xy−3x+2

58 2.2. Algorithms

We compute the groundwater flow velocity for the case that the permeability coefficient of the aquifer isk=2·10 −3m·s −1. It applies:

�v=−k grad(h)

∂(2xy−3x+2) ∂(2xy−3x+2) ∂(2xy−3x+2) m =−2·10 −3 �i+ �j+ �k ∂x ∂y ∂z s � � m m = (6−4y)10 −3 ·�i−4·x·10 −3 · �j s s It is to be recognized, that:

1. there is no vertical stream 2. the velocity is dependent on the coordinates. Thus the current in the aquifer is not constant.

The divergence is the application of the Nabla operator on a vector:

∇�v =div �v (2.24)

vector �v=⇒ scalar

∂ ∂ ∂ ∂v ∂v ∂v ∇�v= �i+ �j+ �k v �i+v �j+v �k = x + y + z ∂x ∂y ∂z x y z ∂x ∂y ∂z � � � � The result of divergence formation is a scalar quantity. The divergence can be regarded as the formal application of the scalar product between the Nabla operator and a vector. According to the rule of scalar product formation the divergence of a vector is a scalar quantity. The divergence, also noted as productivity of an areaG, indicates whether sources or sinks are in this area. If the divergence of a vector field is equal to zero (∇�v =div �v = 0), the area has neither a source nor a sink. According to Gauss’ law the entire source and sink activity of an areaG can be computed by the volume integral of the divergence. At the same time it is known from the balance laws that the difference between the source and sink activities, i.e. the flow rates, have to discharge through the surface:

div �vdV= �v· �ndS( 2.25)

���G �G � For the two-dimensional area follows similarly:

div �vdA= �v· �ndL (2.26)

��A �L

59 CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

�n is a normal (perpendicularly standing) unit vector to the surface or to the circumfer- ence. With Gauss’ theorem the volume integral can be converted into an integral over the surface and an area integral can be converted into an integral over the bound. Also the divergence plays a fundamental role in the hydrogeology, since all processes must be balance in the mathematical description. In particular a large number of further is based on the following relation:

div �v = div(−k gradh)=q( 2.27)

Example of divergence calculation: We compute the divergence of the velocity vector �v for the previous example:

∂ ∂ ∇�v= (3−2y)2·10 −3 + (−4·10 −3x) = 0 ∂x ∂y

Thus this area is neither source nor sink.

The curl/rotation is the rotation of a vector field and is the cross product of the Nabla operator with a vector:

rot �v=∇× �v (2.28)

�i �j �k � � � � ∂vz ∂vy ∂vz ∂vx ∂vy ∂vx rot �v= � ∂ ∂ ∂ � = − �i− − �j+ − �k � ∂x ∂y ∂z � ∂y ∂z ∂x ∂z ∂x ∂y � � � � � � � � � � � � �vx vy vz � � � � � � � The result is� a vector. � If rot �v = 0, we say it is an irrotational field. We can also deduce from it, that rot gradϕ = 0 always is applicab le for irrotational potential fieldsj (a conservative vector field).

Further rules of computation in connection with the vectorial differentiation yiel as a result of application of the vector rules and the extended rules for the differentiation of products:

∇(ϕ1 ·ϕ 2) =ϕ 1∇ϕ2 +ϕ 2∇ϕ1 =ϕ 1 gradϕ 2 +ϕ 2 gradϕ 1 (2.29) ∇ ·(ϕ(�a)) =ϕ∇�a+ �a·∇ϕ=ϕdiv(�a) + �a· grad(ϕ) (2.30) ∇ ×(ϕ�a)=ϕ∇ × �a+ �a×∇ϕ=ϕrot(�a) + �a× grad(ϕ) (2.31)

If we examine the source and sink activity of an aquifer, we can write the Darcy law

60 2.2. Algorithms

as follows:

div(�v) = div(−k· gradh)=q (2.32)

∇(�v)=∇(−k·∇h) =q

∇(�v)=∇(−k)·∇h−k·∇(∇h)=q

∇(�v)=∇(−k)·∇h−k·Δh=q

div(�v) = grad(−k)· grad(h)−k· div(grad(h)) =q

Only for the homogeneous isotropic aquifer may be set grad(−k) = 0 and then the aquifer equation is: div(�v)=−k div(gradh)=q( 2.33)

Table 2.3: differential operators in the different coordinate systems

coordinate system name/operator Cartesian cylindric NABLA operator ∂ � ∂ � ∂ � ∂ 1 ∂ ∂ ∇= ∂x i+ ∂y j+ ∂z k ∇= ∂r �r+ r ∂ϕ �ϕ+ ∂z �z ∇ gradient ∂h� ∂h� ∂h� ∂h 1 ∂h ∂h ∇h= ∂x i+ ∂y j+ ∂z k ∇h= ∂r �r+ r ∂ϕ �ϕ+ ∂z �z gradh=∇h divergence 1 ∂vϕ ∇ ·v= ∂vx + ∂vy + ∂vz ∇ · �v= ∂(r vr) + 1 + ∂vz ∂x ∂y ∂z r ∂r r ∂ϕ ∂z div �v=∇· �v LAPLACE operator 2 2 2 ∂h ∂ h ∂ h ∂ h 1 ∂(r ) 1 ∂2h ∂2h Δh= 2 + 2 + 2 ∂r ∂x ∂y ∂z Δh= r ∂r + r2 ∂ϕ2 + ∂z2 Δh = div(gradh) =∇ 2h

∂v ∂vz y � 1 ∂vz ∂vϕ curl/rotor ∇ × �v= ∂y − ∂z i ∇ × �v= r ∂ϕ − ∂z �r ∂vx ∂vz � ∂vr ∂vz −→ +� ∂z − ∂x �j +� ∂z − ∂r �ϕ ∂ r v rot�v=∇× �v ∂vy ∂vx � + 1 ( ϕ) − 1 ∂vr �z + �∂x − ∂y �k r �∂r r ∂ϕ� � � volume � � dV=dx·dy·dz dV=r·dr·dϕ·dz dV

61 2.3 Examples of vector calculus

3 −1 1. The filter velocity �v consists of the componentsv x = 3·10 m·s ,v z =−5· −4 −1 10 m·s andv y = 0. Outline and compute the filter velocity and indicate the magnitude and the angle.

The magnitude of a vector is:

2 2 2 |�v|= vx +v y +v z � For the given vector this is:

m |�v|= (3· 10 −3)2 + (−5·10 −4)2 = 3� 04·10 −3 s � The angle is calculated by the slope, which is equal to the tangent of the angle:

v −5· 10 −4 α = arctan z = arctan v 3· 10 −3 � x � � � = arctan (−0� 166) = 350� 52 o = 6�12 rad

Thus the vector in Cartesian an polar coordinates is:

m m m m �v=3·10 −3 ·�i+5·10 −4 · �k=3�04· 10 −3 · �r+6�12 · �α s s s s

2. A pollutant particle moves by convection (�vkonv) and by the hydrodynamic dis- persion (�vdisp). Plot and compute the covered way and the end point, if the particel is transported from the origin with the following velocities:

m m �v = 1·10 −4 �i+10 −3 �j and konv s s m �v = 3·10 −10 �r+0� 785�α disp s

In this task two different coordinate representations are used. Since the natural

processes are independent of the type of representation, the task can be solved with the use of the Cartesian coordinate representation or by means of polar coordinates. In both cases a conversion between the two systems is necessary.

Systems Analysis in Water Management Peter­Wolfgang Gr¨aber 2.3. Examples of vector calculus

In this case for the two-dimensional case the following relations are available:

�a=a x�i+a y�j

�a=a r�r+a α�α

2 2 ar = ax +a y =|�a| � ay aα = arctan ax

ax = cos (aα)·a r

ay = sin (aα)·a r

ax = tan (aα)·a y

It is important thata α usually is indicated in radian measure and the following relation applies: � α α◦ = 2π 360◦ With the given numerical values we find:

�v= �v konv + �vdisp

According to the definition:

m v = v2 +v 2 = (10−4)2 + (10−3)2 = 10−7 r konv x y s � v � α = arctan y = 84�29 ◦ konv v � x �

3. Plot and compute the end point of a pollutant particle after one day, if it moves from the originx=0m,y=0m by convection due to a potential gradient of Δh=1m between the pointsx=0m,y=0m andx=30m,y = 40m with ak valuek=5· 10 −4m/s. The Basis of the convection is the filtration velocity �v. Accurate the field velocity

has to be used, however not in this example. The mean transit velocity �va is

63 CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

equated thereby the pore velocity. �v �v = �v filtration velocity� n seep through porosity a n�

�v=−k gradh(Darcy law)

dh Δh v =k ⇒v ≈k r dr r Δr

2 2 2 2 Δr= (x1 −x 2) + (y1 −y 2) = (30m) + (40m) = 50m

� m 1m � m v = 5·10 −4 · = 10−5 r s 50m s

−5 m Distances:s=v r ·t=10 s · 86400s=0� 864m

s= x2 +y 2 Position: � x2 =s 2 −y 2 From the linear equation:y=mx+n or the two points equat of the straight line follows: y −y y−y 1 0 = 0 x1 −x 0 x−x 0 Withx 0 =y 0 = 0 andx 1 = 30m andy 1 = 40m we have the results: y 40 4 4 = = ory= x=m·x x 30 3 3

y2 =m 2 ·x 2 =m 2 ·(s 2 −y 2)

m2 ·s 2 y2 = (1 +m 2) m2 ·s 2 1�333 2(0� 864m) 2 y= = = 0� 4777m=0� 689m �(1 +m 2) � (1 + 1� 7778) � y x= = 0� 517m m We can inserty immediately into the e quation of the lengths: 4 y= x 3

s= x2 +y 2

� 4 16 5 s= x2 + ( x)2 = x2 + x2 = x � 3 � 9 3

64 2.3. Examples of vector calculus

Withs=0� 864m we get the value:

3s x= = 0�6·0� 864m=0� 518m 5 4 y= x=0�69m 3

65 2.4 Exercises

Exercises to 2:

1. The vectors �a��b��c are given in the coordinates:

ax = 5b x = 3c x =−6

ay = 7b y =−4c y =−9

az = 8b z = 6c z =−5 Determine the length of vector d�= �a+ �b+ �c.

2. Given the vectors �a=2�i−3 �j+5 �k and �b=3�i−w �j+2 �k. Computew such that the two vecto rs are perpendicular to each other.

3. Givenϕ=xy+yz+zx and A�=x 2y�i+y 2z�j+z 2x�k. Calculate: (a)A�·∇ϕ (b)ϕ∇· A� (c) (∇ϕ)× A�

4. A particle moves along a space curve in the coordinatesx=t 3 + 2t, y=−3e −2t,z = 2 sin 5t. Compute the velocity and the acceleration of the particle at any timet. Indicate the distances fort=0andt=1.

5. Plot and compute the end point of a pollutant particle after one day, if it moves from the originx=0m,y=0m by a convection due to a potential gradient of �h=1m between the pointsx=0m,y=0m andx=30m,y = 40m with ak valuek=5· 10 −4m·s −1. 6. Given the scalar conservative vector field in a filterh= xy+yz+xz. a) Determine the filter velocity (vector and magnitude) b) Is the activity source or sink in the filter? c) Is the flow in the filter irrational? Given arek=10 −4ms−1 and grad(−k)=0.

7. A pollutant plume spreads in the underground. The distribution of the pollutant varies in the range of the valuesx::=0to10andy ::= 0 to 10 with the foll owing geometry: C(x�y)=50−((x−5) 2 + (y−5) 2)

Systems Analysis in Water Management Peter­Wolfgang Gr¨aber 2.4. Exercises

a) Plot the lines for the concentration values in range ofC(x�y)= 0mg to 50mg with an incrementδC(x�y) = 10. b) Compute the gradient at the pointP(3� 4) and determine the m agnitude and the direction angle.

8. A pollutant plume spreads in the underground. The distribution of the pollutant varies in the range of the valuesx::=0to10andy ::= 0 to 10 with the foll owing geometry: C(x�y) = 125− ((2x− 10) 2 + (y−5) 2) a) Plot the equipotential lines for the concentration values in range ofC(x�y)= 0mg to 125mg with an incrementδC(x� y) = 25. b) Compute the gradient at the pointP(5� 10) and determine the magnitude and the direction angle.

9. The groundwater level of an aquifer which one side is limited by a barrier and a well has the following geometry:

1 (y− 10) 2 z = R 2 x

a) Plot the hydroisohypses in the range ofz R = 1m toz R = 5m with an incrementδz R = 1m for the coordinate 0≤x≤ 10 b) Compute the filtration velocity withk=0� 0001ms −1 at the pointP(5�5); determine the magnitude and the direction angleα. c) Is this field source or sink?

10. The ground water level of a rift inflow in an aquifer is given by the geometrical function:

zR =y+3x

a) Plot the hydroisohypses for the rangez R = 1mto5m with an increment δzR = 1m. b) Compute the filtration velocity withk=0� 0001ms −1 at the pointP(5�5); determine the magnitude and the direction angle. c) Is this field source or sink?

67 CHAPTER 2. VECTOR ALGEBRA AND VECTOR CALCULUS

68