You are on page 1of 125

MATHEMATICAL MODELLING OF WATER QUALITY IN PINACANAUAN DE

TUGUEGARAO RIVER

A Thesis Proposal presented to the

Chemical Engineering Faculty

Cagayan State University

Carig Sur, Tuguegarao City

In Partial Fulfillment of the Requirements

For the Degree of

Bachelor of Science in Chemical Engineering

Submitted by:

Alumit, Razel V. Jr.

Dulliyao, Van Vesper J.

Guillermo, Denver V.

Mamba, Rhea D.

Manaligod, Laica C.

Maruquin, Elha E.
Abstract

Water quality aspect with regards to temperature, dissolved oxygen and pH of Pinacanauan de

Tuguegarao River, located at Barangay Caggay, Tuguegarao City was studied. The main

objective was to develop a two-dimensional water quality model for each parameter. A 200

meter length and 121 meter width was selected as the boundary. Water samples were collected

from designated points in the boundary for every 14 days and analyzed for different parameters.

Simulated values from the developed models were compared to the measured values using

statistical paired t-test and found no significant difference. Furthermore, the developed models

were used to predict the water quality parameters after 1 year.

i
Table of Contents

Abstract ...................................................................................................................................... i

Chapter 1 .................................................................................................................................. 1

INTRODUCTION.................................................................................................................... 1

1.1 Background of the Study .................................................................................................. 1

1.2 Statement of the Problem ................................................................................................. 2

1.3 Objectives of the Study .................................................................................................... 2

1.4 Scope and Limitations ...................................................................................................... 3

1.5 Significance of the Study ................................................................................................. 3

1.6 Locale of the Study .......................................................................................................... 4

1.7 Definition of Terms .......................................................................................................... 4

Chapter 2 .................................................................................................................................. 6

REVIEW OF RELATED LITERATURE ............................................................................ 6

2.1 Pinacanauan de Tuguegarao River ................................................................................... 6

2.2 Water Quality Parameters ................................................................................................ 6

2.3. Governing Laws .............................................................................................................. 8

2.3.1 Conservation Law ...................................................................................................... 8

2.3.2 Hydrodynamics and Transport .................................................................................. 9

2.4 Numerical Solution of Partial Differential Equations ............................................... 13

2.4.1 Finite Difference Method ........................................................................................ 13

2.4.2 Finite Element Method ............................................................................................ 15

2.5 Mathematical Model ...................................................................................................... 16

ii
2.5.1 Formulation of Water Quality Model ...................................................................... 17

2.6. Diffusion Coefficients ................................................................................................... 26

2.6 MATLAB® .................................................................................................................... 27

2.6.1 Water Quality Modelling in MATLAB® ................................................................ 28

2.7 Theoretical Framework .................................................................................................. 30

2.8 Conceptual Framework .................................................................................................. 33

CHAPTER 3 ........................................................................................................................... 35

METHODOLOGY ................................................................................................................ 35

3.1 Study Area ...................................................................................................................... 35

3.2 Initial and Boundary Conditions .................................................................................... 36

3.3 Data Collection ............................................................................................................... 37

3.3.1 Water Quality Parameters ........................................................................................ 37

3.3.1.2 Chemical Method ................................................................................................. 37

3.3.1.3 Used of Measuring Devices .................................................................................. 38

3.3.2 River Geometry ....................................................................................................... 38

3.4 Model Formulation ......................................................................................................... 39

3.4.1 Discretization of DO Model .................................................................................... 40

3.4.2 Discretization of Temperature ................................................................................. 40

3.4.3 Discretization of pH Model ..................................................................................... 41

3.4 Estimation and Calibration of Reaeration and Decay Rate Coefficient ......................... 41

3.5 Solution Scheme............................................................................................................. 42

iii
3.6 Simulation Methodology ........................................................................................... 44

3.7 Model Validation............................................................................................................ 46

CHAPTER 4 ........................................................................................................................... 47

Results and Discussions ......................................................................................................... 47

4.1 Comparison of Actual and Simulated Data .................................................................... 47

4.2 Statistical Analysis of Data ............................................................................................ 49

4.3 Model Accuracy ............................................................................................................. 49

4.4 Contour mapping ............................................................................................................ 53

4.4.1 Temperature ............................................................................................................. 53

4.4.2 Dissolved Oxygen.................................................................................................... 54

4.4.3 pH ............................................................................................................................ 55

4.5 Prediction of Water Quality Parameters......................................................................... 56

CHAPTER 5 ........................................................................................................................... 67

5.1 Summary and Conclusion .............................................................................................. 67

5.2 Recommendations .......................................................................................................... 68

REFERENCES ....................................................................................................................... 69

APPENDIX A ......................................................................................................................... 77

Water Quality Parameters, River Geometry, and Meteorological Data .................................. 77

A.1 Actual Data .................................................................................................................... 77

A.2 Average Height of the River ......................................................................................... 80

A.3 Average Velocity........................................................................................................... 80

iv
A.4 Slope of the River .......................................................................................................... 80

A. 5 Meteorological Data ..................................................................................................... 81

APPENDIX B ......................................................................................................................... 82

Model Discretization and Calculation of Sources/Sinks ......................................................... 82

B.1 Discretization of Formulated Model.............................................................................. 82

B.1.1 Dissolved Oxygen Model ....................................................................................... 82

B.1.2 Temperature Model ................................................................................................. 82

B.1.3 pH Model ................................................................................................................ 83

B.2 Calculation of the Sources/Sinks ................................................................................... 84

B.2.1 Dissolved Oxygen ................................................................................................... 84

B.2.2 Temperature model ................................................................................................. 84

B.2.3 pH Model ................................................................................................................ 86

B.3 Diffusion Coefficient ..................................................................................................... 87

B.3.1 Coefficient of horizontal diffusion.......................................................................... 87

B.3.2 Coefficient of vertical diffusion .............................................................................. 87

APPENDIX C ......................................................................................................................... 88

MATLAB™ CODES ............................................................................................................... 88

C.1 Program Codes for Model Validation ........................................................................... 88

C.2 Matlab™ Codes for Forecasting.................................................................................... 93

APPENDIX D ......................................................................................................................... 95

Simulation Results and Statistical Analysis ......................................................................... 95

v
D.1 Simulation Results......................................................................................................... 95

D.2 Statistical Analysis Using Paired t-Test in Excel .......................................................... 97

D.2.1. Temperature ........................................................................................................... 97

D.2.2 Dissolved Oxygen ................................................................................................. 100

D.2.3 pH ......................................................................................................................... 103

APPENDIX E ....................................................................................................................... 108

APPENDIX F ....................................................................................................................... 111

DOCUMENTATION ............................................................................................................ 111

vi
LISTS OF FIGURES
Figure 1: Theoretical Framework of the Study (Orlob, et al., 1983) ...................................... 30

Figure 2: Conceptual Framework of the Study....................................................................... 34

Figure 3: Study Area. .............................................................................................................. 35

Figure 4: Selection of Boundary ............................................................................................. 36

Figure 5: Solution Scheme (S. A. Mirbagheri, 2009) ............................................................. 43

Figure 6: Solution Methodology ............................................................................................. 45

Figure 7: Theoretical Vs. Actual Temperature for (a) I1 (b) I2 (c) I3. ..................................... 50

Figure 8: I1 Theoretical Vs. Actual pH .................................................................................. 51

Figure 9: Theoretical Vs. Actual DO for (a) I1 (b) I2 (c) I3................................................... 52

Figure 10: (a) Initial and (b) Final Temperature ..................................................................... 54

Figure 11: (a) Initial and (b) Final DO .................................................................................... 54

Figure 12: (a) Initial and (b) Final pH .................................................................................... 55

Figure 13: First discharge for the chosen boundary. A continuous flowing water coming

from the residential houses. ................................................................................................... 111

Figure 14: Second discharge located upstream. A pipe projected directly to the river coming

from residential houses which produces a dark fluid with an awlful smell. .......................... 111

Figure 15: A photo of the group measuring the width of the river (left side) and the its length

on the land area (right side). ................................................................................................. 111

Figure 16: Labelled plastic bottles for the sample collection. From boundary 1 to boundary 7

and inner boundary 1 to inner boundary 3 with two replicates. ........................................... 112

Figure 17: Sample collection from the chosen sampling points. The sampling bottles was

cupped under water to prevent air bubbles. .......................................................................... 112

Figure 18: Analysing the samples using chemical test for the parameters pH and DO. Photo

taken at Bureau of Fisheries and Aquatic Resources (BFAR) laboratory............................. 112

vii
Figure 19: On-site water analysis using the equipment devices (Thermometer, pH meter, and

DO meter). ............................................................................................................................. 113

Figure 20: On-site chemical testing of pH at different sampling points. .............................. 113

Figure 21: Measuring of water depth at different points. ..................................................... 113

Figure 22: Setting up for the Measuring of velocity using a table tennis ball and timer. ..... 114

Figure 23: On-site sampling at the center of the river. ......................................................... 114

Figure 24: Photo taken during the last data collection with the boat owner Lyafayeth Tasi.

................................................................................................................................................ 114

Figure 25: Photo taken at the Laboratory of BFAR with ma'am Divine. ............................. 115

viii
LISTS OF TABLES

Table 1: Monitored Water Quality Parameters per Type of Water Body (DENR-EMB, 2014).

.................................................................................................................................................... 7

Table 2: Number of classified inland surface water bodies (EMB National Water Quality

Status Report, 2006)................................................................................................................... 7

Table 3: Water Quality Guidelines for Primary Parameter....................................................... 8

Table 4: Effluent Standards....................................................................................................... 8

Table 5: Categories of Model (Marion, 2008). ....................................................................... 16

Table 6: Coefficients to Compute Saturation Vapor Pressure. ............................................... 22

Table 7: R2 of the Developed Model ....................................... Error! Bookmark not defined.

Table 8: Typical values of the decay coefficient for various types of wastes. From [Davis and

Cornwell, 1991] ....................................................................................................................... 42

Table 9: Actual vs. Theoretical for Dissolved Oxygen. .......................................................... 47

Table 10: Actual Vs. Theoretical for Temperature Model. ..................................................... 48

Table 11: Actual vs. Theoretical for pH Model. ..................................................................... 48

Table 12: P-Value of Actual Vs. Theoretical. ......................................................................... 49

Table 13: Prediction of Temperature. ..................................................................................... 58

Table 14: Prediction of Dissolved Oxygen. ............................ Error! Bookmark not defined.

Table 15: Prediction for pH .................................................... Error! Bookmark not defined.

ix
Chapter 1

INTRODUCTION

1.1 Background of the Study

Water is one of the most essential natural resources for the existence and survival of

the entire life on this planet. All living organisms need large quantity and good quality of water

to continue their life (Kang, Gao, & Xie, 2017). Preserving this natural resource and ensuring

its availability therefore is very essential to have quality life not just for the present but also for

the next generations.

As populations and economics grow, water quality is degrading at an alarming rate due

to the increase of pollutant loadings in this natural resource. High organic loadings can reduced

dissolved oxygen to levels that are fatal to parts of the aquatic ecosystem and can cause

intolerable odors. Toxic heavy metals and other micro-pollutants can accumulate in the bodies

of aquatic organisms, including fish, making them unfit for human consumption even if they

themselves survive (Loucks & Beek, 2005). In addition, these pollutants can cause water borne

diseases and can end up in surface and ground water bodies. Addressing this concern, models,

water quality analysis, and evaluation techniques were developed in order to attain water

quality.

Water quality models are very useful in describing the ecological state of the water

system and to predict the change in this state when certain boundary or initial conditions are

altered (Lindenschmidt, 2005). Model will also help to explore various water pollution

scenarios and solve water quality planning and forecasting tasks (Ruzgas, Inga Ruzgiene, &

Tomas, 2014). Also, model can become a helpful tool in the management process, enabling the

user to explore new horizons of the imaginations, to compare choices, and to identify pathways

toward superior solutions to practical problems (Orlob, Mathematical modelling of water

quality: Streams, Lakes, and Reservoirs, 1983).

1
River water quality is of great environmental concern since it is one of the major

available fresh water resources for human consumption (Jarvie, Whitton, & Neal, 1998). One

of the most popular river water in the Province of Cagayan is the Pinacanauan de Tuguegarao

River. This river supplies water to more than 500 hectares of farms in 8 Barangays of

Peñablanca and 4 Barangays of Tuguegarao City (Espejo, Tungpalan, Negi, & Alex, 2015).

Therefore, the main purpose of this study is to develop a comprehensive process

engineering approach on water quality modelling in Pinacanauan de Tuguegarao River by

means of a mathematical model in order to determine the condition of the river water and

formulate solutions.

1.2 Statement of the Problem

The study focuses on the water quality modelling of Pinacanauan de Tuguegarao River.

It aimed to answer the following questions:

1. Is the simulated values of water quality parameters have acceptable compatibility with

the measured values?

2. What is the accuracy of the developed model compared to the published models?

3. How will the water quality parameter (temperature, dissolved oxygen, and pH) of

Pinacanauan de Tuguegarao River change when:

Case 1: An additional pollutant source is present in the river;

Case 2: The classification effluent discharge of source 1 is at Class B;

Case 3: The classification of effluent discharge of source 1 is at Class D.

1.3 Objectives of the Study

Generally, the study aimed to develop a water quality model of the Pinacanauan de

Tuguegarao River.

Specifically, it aimed to:

2
1. Compare the difference of the simulated value and the actual values of water quality

parameters using a statistical tool paired T-test.

2. Compare the accuracy of model with published model.

3. Determine the change in the concentration of the different water quality parameters

(dissolved oxygen, temperature, and pH) of Pinacanauan de Tuguegarao River when:

Case 1: An additional pollutant source is present in the river;

Case 2: The classification effluent discharge of Source 1 is at Class B;

Case 3: The classification of effluent discharge of Source 1 is at Class D.

1.4 Scope and Limitations

Portion of the Pinacanauan de Tuguegarao River in Brgy. Caggay, Tuguegarao City,

Cagayan was selected as the locale of the study. This study focused on assessing the water

quality of the river and developed a model that will serve as a forecasting tool for the different

water quality parameters of Pinacanauan de Tuguegarao River. The parameters considered in

this study were dissolved oxygen, temperature and pH and were gathered On-Site. The

collection of data was from December 20, 2018 to April 28, 2019 with 14 days’ interval.

1.5 Significance of the Study

The mathematical model developed could be used to predict water quality parameters.

Different agencies such as Environmental Management Bureau - Department of Environment

and Natural Resources (EMB-DENR) and Bureau of Fisheries and Aquatic Resources could

adapt the developed model to established justified and reasonable programs for long term

measures for pollutant discharge reduction, rational use of water resources, estimation of the

impact in the environment of technological improvements, development of methods and

monitoring facilities, prediction and quality management of the environment, etc. This research

could also be used by future researchers as a reference in testing the validity of related studies.

3
1.6 Locale of the Study

This study was conducted at Brgy. Caggay, Tuguegarao City, Cagayan. Water sampling

and collection were done at the selected boundaries of Pinacanauan de Tuguegarao River. A

length of 200 meters long and a width of 121 meters was selected as the sampling site in the

river. Data analyses were done on-site with the supervision of Bureau of Fisheries and Aquatic

Resources.

1.7 Definition of Terms

Coefficient of determination (R2) - is a measure used in statistical analysis that assesses how

well a model explains and predicts future outcomes and the accuracy of the model. It is

indicative of the level of explained variability in the data set.

Diffusion - is the process by which both ionic and molecular species dissolved in water move

from areas of higher concentration to areas of lower concentration

Dispersion - is the process whereby solutes are mixed during advective transport due to

velocity variations caused by flow variations within the pores and by heterogeneities in the

hydraulic conductivity distribution

Dissolved Oxygen – measures the concentration of oxygen dissolved in water. The higher the

DO, the better the condition for the growth and productivity of aquatic resources.

Dry Bulb Temperature - the ambient temperature of air in the river indicated by a

thermometer.

Power of Hydrogen (pH) - a figure expressing the acidity or alkalinity of a solution on a

logarithmic scale.

Pollution Load - amount of pollutant being discharged into the environment; the product of

the wastewater quality or concentration and the volumetric rate of discharge.

Surface Water - all waters open to the atmosphere and subject to surface runoff.

4
Temperature – is the measurement of how hot or cold a system is. In theoretical terms,

Temperature is what determines the direction of heat flow — out of the region with the higher

temperature and in to the region with the lower temperature.

Reaction rates - are usually expressed as the concentration of reactant (H2CO3) consumed or

the concentration of product formed per unit time.

Reaeration rate - A net rate at which oxygen is replenished in a stream through atmospheric

mass transfer of oxygen.

River reaches - is a length of a stream or river, usually suggesting a level, uninterrupted stretch.

Water Quality - characteristics of water that define its use in terms of physical, chemical,

biological, bacteriological, or radiological characteristics by which the acceptability of water

is evaluated.

Wet Bulb Temperature - the temperature achieved through evaporative cooling of river water

from the thermometer bulb, assuming good air flow and that the ambient air temperature

remains the same.

5
Chapter 2

REVIEW OF RELATED LITERATURE

2.1 Pinacanauan de Tuguegarao River

The Pinacanauan de Tuguegarao River is one of the foremost water resources in

Cagayan Valley. It is also renowned tourism spot in the province. The clear Pinacanauan de

Tuguegarao River serves as a national swimming pool for outdoor recreation, source of

domestic water for consumption of nearby communities and support the National Irrigation

Administration (NIA) for irrigating the rice fields and other agricultural lands. (Dayag,

Gazmen, & Quizon, 2016)

However, in recent years, pollution of rivers has increased steadily. This situation has

arisen as a result of rapid growth of population, increased urbanization, expansion of industrial

activities, dumping of domestic and raw sewage into nearby water courses, increased use of

fertilizer and agrochemicals, lack of environmental regulations and their tardy implementation

(Aina & Asedipe, 1996).

2.2 Water Quality Parameters

Philippine water quality is assessed based on the set beneficial use as defined in

Department of Natural Resources (DENR)-Administrative Order (DAO) 1990- 34. Under this

DAO, there are 33 parameters that define the desired water quality per water body

classification. Accordingly, a water body must meet the corresponding criteria of each

applicable parameter 100 percent of the time to maintain its designated classification. In the

absence of a water quality index, an interim methodology based on compliance to DAO 1990-

34 is used for all surface waters. Table 1 presents the parameters monitored to assess the water

quality per type of water body (DENR-EMB, 2014).

6
Table 1: Monitored Water Quality Parameters per Type of Water Body (DENR-EMB, 2014).

Water Body Water Quality Parameter


Inland surface water  Dissolve oxygen (DO)
 Biochemical Oxygen Demand (BOD)
 Total suspended solid (TSS)
 Phosphates
 Nitrates
 Heavy metals
 Cyanide as free cyanide
Groundwaters  Fecal Coliform
 Nitrates
 Salinity (chloride content)
Coastal and marine waters  Fecal Coliform
 Total Coliform
 DO

Table 2: Number of classified inland surface water bodies (EMB National Water Quality
Status Report, 2006)
Classification Definition Number
Waters intended as public water supply
Class AA requiring only approved disinfection to meet the 5
PNSDW.
Waters suitable as water supply requiring
Class A 203
conventional treatment to meet the PNSDW.
Waters intended for primary contact recreation
Class B 149
(e.g. bathing, swimming, skin diving, etc.)
Waters for fishery, recreation/boating, and
Class C supply for manufacturing processes after 231
treatment.
Class D Waters intended for agriculture, irrigation,
23
livestock watering, etc.

7
Table 3 and Table 4 shows the standard water parameter for the different water classifications.

Table 3: Water Quality Guidelines for Primary Parameter

Class
Parameter Unit
AA A B C D
BOD mg/L 1 3 5 7 15
Chloride mg/L 250 250 250 350 400
Color TCU 5 50 50 75 150
Dissolved Oxygen mg/L 5 5 5 5 2
Fecal Coliform MPN/100 ml <1.1 <1.1 100 200 400
Nitrate mg/L 7 7 7 7 15
Phosphate mg/L <0.003 0.5 0.5 0.5 5
Temperature C 26-30 26-30 25-31 25-32 26-30
Total Suspended Solid mg/L 25 50 65 80 110
Oil and grease <1 1 1 2 5

Table 4: Effluent Standards

Class
Parameter Unit
AA A B C D
Ammonia as NH3-N mg/L NDA 0.5 0.5 0.5 7.5
BOD mg/L NDA 20 30 50 120
COD TCU NDA 60 60 100 200
Color mg/L NDA 100 100 150 300
Fluoride MPN/100 ml NDA 2 2 2 4
Nitrate as NO3-N mg/L NDA 14 14 14 30
pH (Range) NDA 6.0-9.0 6.0-9.0 6.0-9.0 5.5-9.5
Phosphate mg/L NDA 1 1 1 10
Surfactants (MBAS) C NDA 2 3 15 30
Total Suspended Solid mg/L NDA 70 85 100 150
Oil and grease mg/L NDA 5 5 5 15

2.3. Governing Laws

2.3.1 Conservation Law

The conservation equations state that what goes into the system must either come out

of the system somewhere else, get used up or generated by the system, or remain in the system

and accumulate (Duncan, 2017). This principle is expressed as

Accumulation = In - Out + Generation - Consumption (1)

8
Conservation of mass governs law of conservation which states that the mass entering

the system is equal to mass leaving the system. For fluid dynamics, it states that all mass flow

rates into a control volume are equal to all mass flow rates out of the control volume plus the

rate of change of mass within the control volume (Duncan, 2017). This is expressed

mathematically by the following equation:

m
m in  m out  (2)
t

2.3.2 Hydrodynamics and Transport

2.3.2.1 Fick’s First Law

Adolf Fick was the first man to propose the phenomenological relation for diffusion.

Fick’s First Law stated that when considering the flux of particles in a one-dimensional

system caused by a concentration gradient (Paul, Laurila, Vuorinen, & Divinski, 2014), the

flux can be expressed as

dm C
J  D (3)
dtA x

Where J is the flux, dm is the is the change in the amount of matter in small time dt,

A is the area, D is the diffusion coefficient, C is the concentration of the particles and x is the

position parameter. The negative sign indicates that diffusion occurs in the direction opposite

to the increasing concentration gradient.

Molecular diffusion is a transport process that originates from molecular activity with

concentration gradient as its driving force. The molecular diffusion is described by the

molecular diffusion coefficient Dm (Eldho).

C
Specific mass flux: q   Dm
x

C
Molecular diffusion: q   Dm
x

9
C
Turbulent Diffusion: q  ε D
x

C
Dispersion: q   K
x

v x
Momentum Flux: T   ρv
y

v x
Turbulent Momentum Exchange: T   ρvt
y

T
Heat Flux: qT   ρC p DT
x

2.3.2.2 Mass Transport Phenomena

Mass transfer describes the transport of mass from one point to another. Mass transfer

may take place in a single phase or over phase boundaries in multiphase systems. In the vast

majority of engineering problems, mass transfer involves at least one fluid phase (gas or

liquid), although it may also be described in solid-phase materials (multiphysics

CYCLOPEDIA, 2015).

 T T T    2T  2T  2T  T
 v x  vy  vz   DT  2  2  2    (4)
 x y z   x y z  t

2.3.2.2.1 One-Dimensional (1D) Transport Equation

C C 2 C (5)
 vx K I
t t x 2

The equation represents a typical one-dimensional flow that was used to solve mass

transport along one axis, the x axis.

where: vx = the mean velocity in the x-direction;

C = the concentration average over the cross section;

10
I = the sink or source term that describes the reaction of the substance with its

environment.

2.3.2.2.2 Two-Dimensional (2D) Transport Equation

C  C C    2 C 2 C 
  v x  vy   Kx 2  Ky 2   I (6)
t  x y   x y 

This equation represents a two-dimensional flow which considers both the x and y axis

to solve mass transport.

2.3.2.2.3 Three-Dimensional (3D) Transport Equation

C  C C C   2C 2C  2C 
  v x  vx  vx   Kx  K  K I
t   z 2 
(7)
t  t t x 2 y 2
y z

This equation considers the flow in any direction to solve mass transport.

2.3.2.3 Heat Transfer

Heat transfer from systems of high temperature to systems of lower temperature (Nave,

Heat Transfer, n.d.).

 T T T    2T  2T  2T  T
 v x  vy  vz   DT  2 _ 2  2    (8)
 x y z   x x x  t

The heat content of an object depends upon its specific heat and mass. The Heat

Transfer is the measurement of the thermal energy transferred when an object having a defined

specific heat and mass undergoes a defined temperature change (Heat Transfer Formula, n.d.).

The heat transfer equation is express as:

Q = mcpΔT (9)

Where:

Q = heat content in Joules

m = mass

cp = specific heat, J/g °C

11
ΔT = change in temperature

2.3.2.3.1 Conduction

An energy transfers across a system boundary due to a temperature difference by the

mechanism of inter-molecular interactions. The Fourier Law describes conduction rate

equation:

q  -kAT (10)

where:

q = heat flow vector, (W)

k = thermal conductivity, (W/m K)

A = Cross sectional area in direction of heat flow. (m2)

T = Gradient of temperature (K/m)

2.3.2.3.2 Convection

An energy transfers across a system boundary due to a temperature difference by the

combined mechanisms of intermolecular interactions and bulk transport. Convection needs

fluid matter. Newton’s Law of Cooling:

q  hAs T (11)

where:

q = heat flow from surface, a scalar, (W)

h = heat transfer coefficient (which is not a thermodynamic property of the material,

but may depend on geometry of surface, flow characteristics, thermodynamic properties

of the fluid, etc. (W/m2 K)

AS = Surface area from which convection is occurring. (m2)

T  TS - T ∞ = Temperature Difference between surface and coolant. (K)

12
2.3.2.3.3 Radiation

Radiation heat transfer involves the transfer of heat by electromagnetic radiation that

arises due to the temperature of the body. Radiation does not need matter. Emissive power of

a surface:


E  TS W / m 2  (12)

where:

 = emissivity, which is a surface property (ε = 1 is black body)


 = Steffan-Boltzman constant (5.67 x 10-8 W/m2 K4)

TS = Absolute temperature of the surface (K)

2.4 Numerical Solution of Partial Differential Equations

2.4.1 Finite Difference Method

The finite difference method (FDM) is used to approximate differential equation when

it is imposed on the grids or boundary, called boundary-value problems (Kaw, Nguyen, &

Snyder, 2012). FDM is applied to partial differential equation (PDE) by replacing the

approximated dependent variable with the independent variable which are defined by a finite

grid of points. Using Taylor’s theorem, the partial derivatives at each grid points are

approximated from neighboring values (D.M.Causon & Mingham, 2010).

Taylor’s Theorem

Let U(x) have n continuous derivatives over the interval a, b . Then for

a  x0 , x0  h  b ,

U xx ( x o ) U ( n 1 ) ( x o )
U ( x o  h )  U ( x o )  hU x ( x o )  h 2  ....  h n 1  O( h n ) (13)
2! ( n  1 )!

where,

dU d 2U d n 1U (14)
Ux  U xx  U ( n 1) 
dx dx 2 dx n 1

13
U x  ( xo ) is the derivative of U with respect to x evaluated at x  xo

O(h n ) is an unknown error term.

The interpretation of the Taylor’s theorem is that the known value of U and the values

of its derivatives at point xo then equation 8 for its value at the (nearby) point x o + h. The

n n
expression contains an unknown quantity O(h ) . If the term O(h ) is discarded in the equation

(i.e. truncate the right-hand side of the equation 8), an approximation to U ( x0  h) is observed.

n
The error in this approximation is O(h ) (D.M.Causon & Mingham, 2010).

2.4.1.1 Implicit and Explicit Finite Difference Method

Finite difference method has two categories based on time differencing scheme:

implicit and explicit. When sets of equations, matrix or iterative technique are used to define

the dependent variables, the numerical method is implicit. Whereas, the explicit numerical

solution scheme for direct computation of the dependent variables needed for the mathematical

modelling and are used when time accuracy is important (Flow-3D, 2019).

According to (Wageningen-Kessels van, Lint, Hoogendoorn, & Vuik, 2008), implicit

time integration methods reduces the computing time with time steps that are large thus, have

less strict stability conditions. Explicit, on contrary needs to obey to strict stability conditions.

Implicit schemes, has smaller computing times however, the accuracy is dependent on time

integration method but computationally efficient schemes are in acceptable level.

With the utilization of both implicit and explicit methods by means of dispersion model,

a technique that leads to more practical and applicable water quality model in a flooding stream

were developed (Subklay & Pochai, 2017).

By using an explicit scheme of finite difference method known as Saulyev’s formula

with quadratic interpolated initial-boundary condition gives the main advantage of

unconditionally stable one–dimensional water-quality model in a stream. Furthermore, the

14
technique proposed is suitable to be used in real-world problem because of its easy to computer-

code and straightforwardness (Samalerk & Pochai, 2018).

2.4.2 Finite Element Method

The finite element method (FEM) is a numerical technique for solving problems which

are described by PDE to achieve approximate solution. In the form of nodal values of the

physical area, approximation of functions in finite elements which is the interest are

determined. A discretized finite element problem with unknown nodal values is changed from

a continuous physical problem. A system of linear algebraic equations should be solved for

linear problem and in using nodal values, the amounts inside finite elements can be recovered

(Nikishkov, 2004).

2.4.2.1 Discretization

Discretization means converting of continuous PDE into a form that poses a finite

dimensional space also called discrete equation. The process considers the motion taking place

in discrete group, attempting to develop a model that determines the position of the particle at

the nth position. During the procedure, data are collected at specific points or moments in time.

A numerical model is obtained through the discretization of time and space variables in

PDEs on a grid which is later solved in a computer. This numerical approach is considered

cheaper than creating traditional scale models. Moreover, the latter model defies accurate

simulation for the spread of pollutants in surface water (Verwer, 1998).

2.4.2.2 Solvers

Once the matrix equations have been established, the equations are passed on to a solver

to solve the system of equations. Depending on the type of problem, direct or iterative solvers

are generally used.

15
2.5 Mathematical Model

The aim of Mathematical modeling is to describe the real world, its interaction, and its

dynamics through mathematics (Quarteroni, 2009). It is a tool that could be used to develop

scientific understanding of a system. It can also help in testing the effect of changes in a system

thus easing decision making.

A mathematical model can either be empirical and mechanistic. Empirical models

define a mathematical relationship between quantities in a data set. These are obtained from

the general appearance of a data set without regard for underlying biological ideas. Mechanistic

models on the other hand derive relationship between the variables in the data set. Data

obtained are thought to have arisen due to the nature of the relationship is specified in terms of

the biological processes. (Ledder, 2015).

Another classification of models is according to their evolution. Models whose

evolution are completely determined by its initial (starting) value fall under the deterministic

model. In contrast, stochastic models tolerate randomness; these are most appropriate for

processes that are not well defined and whose model variables’ values are defined by

probability distribution rather than a unique value (Livshits & Coleman, 2008). The table below

simplifies the categories of models described above using illustrations.

Table 5: Categories of Model (Marion, 2008).

Empirical Mechanistic
Deterministic Predicting cattle growth from a Planetary motion, based on
regression relationship with feed Newtonian mechanics (differential
intake equations)
Stochastic Analysis of variance of variety Genetics of small populations
yields over sites and years based on Mendelian inheritance
(probabilistic equations)

16
2.5.1 Formulation of Water Quality Model

The mathematical model of the stream water quality is derived from mass balance

equations of particular pollution parameter along the selected stream (Sileika, 1996).

Regression equations expressing the effect of reservoir on pollution were obtained from the

simplified evaluation of the long-term monitoring at upstream and downstream of the

reservoirs (Ruzgiene & Ruzgas, 2014).

Water quality models can range from a zero-dimensional model to a three-dimensional

representation. Zero-dimensional models are for the estimation of spatially averaged pollutant

concentration at minimum cost and cannot predict the fluid dynamic of the system. One-

dimensional models on the other hand are for system’s whose geometry was conceptualized as

a linear network or segments or volumes section. They are formulated by only simulating the

longitudinal differences in the river. For two- or three- dimensional models, the spatial

heterogeneity of the water bodies is represented (Bowie, et al., 1985).

Water quality models are used to describe the main water quality process for different

types of water system such as streams, rivers, lakes reservoirs, estuaries, coastal waters and

oceans (Loucks & Beek, 2005).

2.5.1.1 Mass-Balance Principles

2.5.1.1.1 Advective transport

Advective transport A
T Xo ( M / T ) of a constituent at a site X0 is the product of the site’s

average water velocity v Xo L / T  and surface or cross-sectional area and the constituent’s

average concentration C Xo M / L3 .
A
TXo  v Xo  A  C Xo (15)

Advective transport is water velocity dependent. Particles of pollutants are transported

through the elementary area y and z via water moving with velocity vx. The pollutant mass

17
crossing the area during the time interval t and concentration C is given by (Benedini &

Tsakiris, 2013):

M  Cyzv x t (16)

2.5.1.1.2 Dispersive transport

The dispersive transport D


T Xo M / T  across a surface area is assumed to be proportional

C
to the concentration gradient times the surface area A at site Xo. Letting 
D Xo L2 / T 
x X  Xo

be the dispersion or diffusion coefficient, the dispersive transport is given by:

C
TXoD   DXo  A  (17)
x X  Xo

Dispersion, caused by the variable concentrations in water, could be described using

the Fick’s Law (Benedini & Tsakiris, 2013). The mass crossing the area is:

C
J x yzt  ( E ) x yzt (18)
x

2.5.1.1.3 Mass Transport by Advection and Dispersion

A one-dimensional equation added with the advective and dispersive terms along with

a term at a second surface at site X o  x becomes:

t  t  C C 
 M i  t   v XoC Xo  v Xo v C Xo  v  D Xo  D Xo v   A (19)
t
Mi
 x Xo x Xo v 

where Q Xo L3 / M  is the flow site Xo (Loucks & Beek, 2005).

A study presented a simple mathematical model for river pollution. The model

consisted of a pair of coupled reaction advection-diffusion equations for pollutant and

dissolved oxygen (Hussain, Atshan, & Najam, 2012).

18
 APS x, t    APS x, t  APS x, t 
   Z  PS x, t dx (20)
t x 2 x

 AX S x, t   2  APS x, t  AX S x, t 


 DX     S  X S x, t  (21)
t x 2 x

Expansion of the pollutant and the dissolved oxygen concentrations were accounted

for. The river (Shat Al-Diwanya in Iraq) was assumed to have a uniform cross-sectional area

with a steady state system for simplification. The result of the model for pollution concentration

and dissolved oxygen level was approximately consistent with the values obtained from those

measured at different stations of AL-Diwaniya city.

Another study was conducted to model river pollution using the Fickian advection-

dispersion. This approach was based on the convective-diffusive mass transport in running

waters and is shown as follows.

C  CV X    C 
   DX   S s  St (22)
t x x  x 

The study incorporated two kinds of models. The first models were numerical models

that employed the PDE itself (one-dimensional advective-dispersion equation) and

implemented in COMSOL Multiphysics. The second ones were the analytical model that

employed the analytical solutions of ADE (advective-dispersion equation) and implemented in

MATLAB®.

2.5.2 Formulation of Temperature Model

The advection-diffusion model with sink source terms to prevent physical processes

(Herb & Heinz , 2008):

T  T T    T T    T T  H
  u v    D xx  D xy    D yx  D yy   0 (23)
t  x y  x  x y  y  t y  Pc p

Where: t = time c p = heat transfer coefficient (kJ/s)

19
( x, y ) = coordinates  = water density (kg/m3)

T = water temperature D xx , D yy =Diffusion coefficient

P = depth (m) u, v = velocity components

Equation (23) includes a global, source/sink heat term H . The Net Heat Exchanges

(W/m2) are expressed as follows (Baca & Arnett, 1976) (Edinger, 1979) (Ryan & Harleman,

1973) (Thomann, 1975):

H  H s  H sr  H a  H ar  H br  H e  H c (24)

Where:

H s = shortwave radiation incident to water surface;

H sr = reflected shortwave radiation;

H a = incoming longwave radiation from atmosphere;

H ar = reflected long wave radiation;

H br = back radiation emitted by water body;

H e = energy utilized by evaporation;

H c = energy converted to or from the water body at the surface.

The net short wave solar radiation H ns  is computed (Ryan & Harleman, 1973):


H ns  H s  H sr  0.94 H sc 1  0.65SK 2  (25)

Where:

H sc = clear sky solar radiation (kW m-2);

SK = fraction of sky covered by clouds.

The Net Long-Wave Radiation emitted by the atmosphere is computed as (Swinbank, 1963):

H na  5.16432 x 13 (1  0.17 SK 2 )(Ta  274.16) 6 (26)

Where:

20
H na = net long wave atmospheric radiation (kW m-2);

Ta = dry bulb air temperature (C ) .

The outgoing black-body radiation emitted from water surface is a function only of the water

temperature, and it is given by (Huber and Harleman, 1968):

H br   w (Tw  273.15) 4 (27)

Where:

Tw = water surface temperature;

 w = emissivity of water surface (0.97);

  Stefan-Boltzmann constant 5.670 x10 8 W/m 2 / K 4 

The evaporative heat loss is computed by:

H e   w L(a1  b1Wa )(es  ea ) (28)

Where:

L  (597  0.57Tw ) * 4184 = Latent Heat (J/kg);

Tw = water temperature (C ) ;

a1 ,b1  Empirical coefficient ( a1  0 to 4.0x10-9 , b1  1x10 9 to 3x10-9 ;

  4157 
ea  2.171x108 exp   = saturated vapor pressure [mb];
Td  239.09 

Td = dew point temperature in Celsius;

es   j   j Tw = saturated vapor pressure at coefficient in Table 2.

21
Table 6: Coefficients to Compute Saturation Vapor Pressure.
T j j j
0–5 1 6.05 0.522
5 – 10 2 5.10 0.710
10 – 15 3 2.65 0.954
15 – 20 4 -2.04 1.265
20 – 25 5 -9.94 1.659
25 – 30 6 -22.29 2.151
30 – 35 7 -40.63 2.761
35 - 40 8 -66.90 3.511

The convective heat loss in (Bowen, 1926):

T  Td
Br 
Hc
He

 6.19 x10 4 p s 
e s  ea
(29)

Where:

Br = Bowen ratio;

p = air barometric pressure in mb;

Td = dry bulb air temperature (C ) ;

Ts = surface water temperature (C ) .

2.5.3 Formulation of Dissolved Oxygen Model

The general mass balance equation for the dissolved oxygen in a segment with all the

sources and sins can be presented as (Ali & Husnain , 2010):

dC
V  reaeration  oxidation of CBOD - oxidation NBOD - sediment oxygen deman(SOD) 
dt
photosynthesis - respiratio n - oxygen transport by advection

The mathematical form can also be written as;

C C
 k aV C s  C   Vk d L  Vk n Ln  VS  PV  RV  V
dC
V u V  Dx (37)
dt x x

Equation 37 can also be expressed in 2-dimensional mathematical form, the model

becomes (Jolánkai, 2000):

22
C C   C    C 
V  k aV C s  C   Vk d L
dC
V u V  v V   Dx V   D y (30)
dt x y x  x  y  y 
 Vk n Ln  VS  PV  RV  V

Where:

C s = DO concentration at saturation C = actual DO concentration

k d = CBOD deoxygenation rate coefficient Ln = NBOD concentration

kn = nitrogenous deoxygenation rate coefficients L = CBOD concentration

P = photosynthesis of aquatic plants R = respiration of aquatic plants

S = sediment oxygen demand u = river velocity

x, y = horizontal and vertical distance in the river D y , D x =diffusion coefficients

Assuming that the volume “V” along the river is constant, hence

C C   C    C 
  k a C s  C   k d L
dC
u v   Dx    D y (31)
dt x y x  x  y  y 
 k n Ln  S  V  V

Since all the processes in dissolved oxygen do not occur simultaneously in a river

(Haider & Ali, 2010) , photosynthesis and respiration are not expected due to high turbidity,

sediment oxygen demand is not an important parameter as sediments are frequently wash away

with floods.

The deoxygenation through CBOD and reaeration is only considered in the model since

it is the only source of oxygen. Therefore, Equation 31 will become;

C C   C    C 
  k a C s  C   k d L
dC
u v   Dx    Dy (32)
dt x y x  x  y  y 

23
2.5.4 Formulation of pH Model

The mathematical model for predicting the diffusion of pH was formulated base from

the mass and momentum principle and obtain an ordinary differential equation of (Ukpaka &

Douglas, 2016):

dpH pH pH   pH    pH 


u v   Dx    Dy   kp (33)
dt x y x  x  y  y 

Where: pH = concentration of pH;

u, v = river velocity;

x, y = horizontal and vertical distance in the river;

D y , D x =diffusion coefficients.

k p = rate constant due to chemical reaction

The carbon dioxide (CO2) reacts in and with water which provides the acidity of the

river water and the natural rain. CO2 binds with water to form carbonic acid H2CO3 with

subsequent decomposition into the bicarbonate ion HCO3- and a proton H+:


H 2 CO3  HCO3  H 

 2 (34)
HCO3  CO3  H 

H 2 O  H   OH 

Reaeration at the surface of the water body is a function of CO2 saturation level

(source) and this saturation level is a function of water temperature as it affects Henry’s Law

constant

CO2 ,sat  k H PCO2 (35)

Where: k H = Henry’s constant for CO2;

PCO 2 = partial pressure of CO2 (0.00033 atm is generally used).

24
Henry’s constant for CO2 can be calculated using

k H  M CO2 10 ( 2385.73 / TK )14.01840.0152642TK  (36)

Where: M CO2 = Molecular weight of CO2

From the reactions above (Eqn. 34), the equilibrium constants are:

k1 
HCO H  3
 
(37)
H 2CO3 

k2 
CO H  2 
(38)
HCO 
3

3

 
k w  H  OH   (39)

The equilibrium constant vary with temperature according to the following relationship

(Tetra Tech, 1983):


14.84350.032786TK 
3404.71 

(40)
k1  10  TK 

 2902.39 
 6.4980.02379TK   (41)
k 2  10  TK 

2.5.5 Coefficient of Determination (R2) of the developed model

Water quality models were widely used to predict the concentrations of different water

parameters. Several models of temperature, dissolved oxygen and pH were already published.

The formulated model of dissolved oxygen was applied in Surma River, Bangladesh and it is

found out the coefficient of difference between the simulated model and actual mode is R 2 =

0.963 (Ahmed, 2014). Also, the mathematical model developed was also applied in Tigris

River and the model predicted the depletion of dissolved oxygen with maximum absolute error

of 11% and correlation coefficient of 0.921 (Nasir, Gzar, & Ghulam, 2013).

Models were also used for the prediction of temperature in Wera, Nene, and Tamar

River located at Northampton. The three rivers were predicted at year 1970 to 1976 and the

25
correlation between observed and predicted monthly values of river temperature for three rivers

is shown in Table 7 (Smith, 2009).

Table 7: R2 of Wear, Nene and Tamar River

Year Wear Nene Tamar


1970-1971 0.96 0.94 0.98
1971-1972 0.94 0.946 0.88
1972-1973 0.96 0.97 0.96
1973-1974 0.96 0.976 0.90
1974-1975 0.90 0.905 0.85
1975-1976 0.962 0.953 0.90

The pH model was also use in stagnant water in the neighborhood of the Asphalt

Company Nigeria Limited located at Enito 3, a village located between Ahoada and Mbiama

in Ahoada West Local Government Area of River State and the coefficient of determination

(R2) is 0.839 (Ukpaka & Douglas, 2016).

2.6. Diffusion Coefficients

A study on a method of water quality improvement (Makita & Saeki, 2006) for

aquaculture purposes was made. During the process, the adjective diffusion equation was used

to calculate the mass diffusion transfer of water in a semi-closed water area. Thus, the value of

the coefficient of horizontal diffusion (Dx) used for the equation was calculated by

Dx  cL4 / 3

Where L is the grid size and c is considered constant with a value of 0.01. For vertical

coefficient

D y  0.067 u* H
D y  0.067 H gRh S

Where: u* = shear velocity;

H = average height;

26
g = acceleration due to gravity, 9.81 m/s2;

Rh = hydraulic radius;

S = slope of the river

2.6 MATLAB®

In 1970’s, Cleve Moler developed MATLAB®. The name MATLAB® stands for

MATrix LABoratory and it was written originally to provide easy access to matrix software

developed by the LINPACK (linear system package) and EISPACK (Eigen system package)

projects (Houcque, 2005). MATLAB® is a software package that lets you do mathematics and

computation, analyze data, develop algorithms, do simulation and modelling and produce

graphical displays and graphical user interfaces (Knight, 2000). Simulink is a MATLAB®

extension that has been adopted in other fields of engineering as a means for modeling and

simulating complex systems without the need to write thousands of lines of computer code

during model development. Simulink models can be easily integrated to read and write data

from the workspace and to interact with scripts written with its own high-level programming

language. Simulink has been utilized previously to model the dynamics of engineered systems

in a variety of disciplines (Bowen, Perry, & Bell, 2014).

Compared to conventional computer languages like FORTRAN, MATLAB® has many

advantages for solving technical problems. It is an interactive system whose basic data element

is an array that does not require dimensioning. The software package is now considered as a

standard tool at most universities and industries worldwide (Houcque, 2005).

Examples of Simulink’s use in non-environmental systems analysis include process

modeling in the sugar industry and building systems modeling. In the area of environmental

engineering, Simulink has been used for simulating wastewater treatment plants, either as

individual unit processes, as benchmark simulations of an entire wastewater treatment plant,

for simulation of storm water systems or for integrated models that include both engineered

27
and natural surface water systems. Simulink has also been used to model the hydrodynamics

and water quality of a few surface water natural systems (Bowen, Perry, & Bell, 2014).

2.6.1 Water Quality Modelling in MATLAB®

Complex modelling closer to the end-user and the decision-maker is what the

integration of GIS (Geographic Information Systems) and MATLAB® brings. The hydrologist

modelling in MATLAB® benefits from presentation and accessibility through ArcView while

the GIS expert benefits from the powerful calculation, visualization and animation options

offered by MATLAB® (Raterman, Schaars, & Griffioen, 2000).

According to (Mulla & Bhosale, 2016), MATLAB® is an interactive software that

allows implementation of algorithm, graphics and creation of interface with other computer

languages. In their report, they described how MATLAB® programming tool can be used for

prediction of water quality in river. They conclude that this programming tool helps to predict

future water quality using present data and helps to save time, manpower and other cost for

continuous analysis.

In the study of (Bowen, Perry, & Bell, 2014), a storm water runoff model based on the

Soil Conservation Services (SCS) method and a finite-volume based water quality model has

been developed to investigate the use of Simulink for use in teaching and research. A

graphically based model development environment for system modeling and simulation is

called the Simulink in which it is a MATLAB® extension that is widely used for mechanical

and electrical systems. In addition, their paper talked also about the benefits for water quality

model in teaching and research. A finite volume, multi-layer pond model using the water

quality kinetics present in CE-QUAL-W2 has been developed using Simulink. The model is

one of the first uses of Simulink for modeling eutrophication dynamics in stratified natural

systems.

28
According to (Skorzinski, Shacham, & Brauner, 2009), Simulation programs are widely

used in engineering education for numerical, model-based and virtual experimentation,

analysis of cause-effect relationships in complex systems and visualization of challenging

concepts. In their study, they developed a pollutant dispersion simulation program applicable

in environmental education in which MATLAB® is where the simulation models are

implemented and the user interface is provided in the form of a MATLAB GUI. They also

discussed about three types of simulations namely the use of the oxygen sag model to predict

oxygen concentration and deficit of the river, prediction of pollutant dispersion in air from a

continuous point source using the Gaussian model and prediction of pollutant dispersion in

groundwater from continuous point source.

In the modeling of river water quality parameters, the study of (Dawood, Hussain, &

Hassan, 2016) employed the Artificial Neural Network Model to predict the water quality

parameters in Shatt Al Arab River. Based on their study Artificial Neural Networks (ANNs)

are a form of artificial intelligence whose paradigm architecture is inspired by the way

biological nervous systems such as the brain. Moreover, an ANNs was built, trained and

implemented using MATLAB neural toolbox using back propagation with Levenberg-

Marquardt algorithm. The results prove the ability of the Neural Network models to predict

very well the monthly values of electric conductivity and turbidity. They also concluded that

Neural Network models can be used for the prediction of eater quality parameters.

29
2.7 Theoretical Framework

Goals and Objectives

Conceptualization

Sensitivity Analysis
Selection of model
type

Computational
Representation

First Calibration and


sample Verification
field data
set
Second and
additional Validation
field data
sets
Application

Figure 1: Theoretical Framework of the Study (Orlob, et al., 1983)


According to (Orlob, et al., 1983), the first step of the modeling procedure is

conceptualization. One of its importance is to know the locations of control structures and

tributaries along a river, or to know whether various portions of a lake can be considered

essentially deep or shallow. Conceptualization will involve a choice regarding the possible

(spatial) segregation of the water body into a number of discrete segments and layers. Besides

a spatial separation of the water body it may be necessary to include a grouping and

differentiation of biotic species according to how one visualizes their roles in the ecology of

the water body.

30
With the conceptualization of the modelling problem comes also model formulation. It

is useful to distinguish between various types of model and to discuss briefly their

characteristics. Formulation of the model according to (UNESCO.org, n.d.) involves a decision

about the type of model, elimination of the relationships that do not affect the output results,

examination of alternative types of models and careful relationships of base data collection.

This information is integrated into a conceptual model, in general through the introduction of

simplifying assumptions and qualitative interpretations regarding the flow and the transport

process.

Computational representation includes formulation of equations, formulation of

methods of solution, and selection of a computer code. In formulation of equations, it is

possible to state the relationships involved in some formal mathematical or statistical way.

Adoption of a hierarchical approach to this process often results in a clearer set of equations in

which the influence of primary and secondary relations can be more easily appreciated. Some

preliminary data may be needed to guide the choice. For the formulation of methods of solution,

only in a few special cases it may be possible to solve the equations analytically, but most

models involve the use of numerical methods for solving partial differential equations,

interpolation, etc. The choice of the appropriate numerical technique is crucial for numerical

stability and accuracy and also for minimizing computational effort. For selection of a

computer code, the decision depends on the project goals. If a modelling is intended only to

provide a first approximation, a simple code may be appropriate. The form of input and output

results, and the choice of the language, are in dependence of the available facilities.

The calibration of the model is one of the most critical, difficult, and valuable steps in

the model application process. After a pollutant transport model is calibrated to a satisfactory

degree, it is often applied to predict and simulate the future contaminant migration.

(UNESCO.org, n.d.) Calibration includes experimental design, model structure identification,

31
parameter estimation, and verification. Model structure identification begins by identifying the

large subdivisions of model and proceeds by fitting these together in diagrammatic form with

a flow chart. It is better the model to be created from different modules (separated parts) and

every part to be developed, tested and calibrated apart. Parameter estimation deals with the

computation of values for the parameters that appear in the model equations, once the structure

of these relationships has been properly identified. Verification is the determination of whether

the correct model has been obtained from a given single set of experimental data. Calibration

and verification represent the bulk of the procedure for model development and testing, once

an experimental data set has been obtained (Orlob, et al., 1983).

Validation of the model refers to the testing of the adequacy of the model against a

second, independent set of field data. Because validation thus entails the design and

implementation of new experiments, it is unfortunately a step in the analysis that is all too

rarely attempted (Orlob, et al., 1983).

According to (UNESCO.org, n.d.), it is impossible to apply the model as representative

without suitable proof. The validation of the model depends on the local possibilities. Model

validation, evaluation, confirmation, or testing is the process of assessing the degree of

reliability of the calibrated model using one or more independent data sets. Ideally it is possible

to compare the output results from the model with the observed data.

Sensitivity analysis establishes the relative magnitudes of changes in the simulated

model output responses to changes in the model parameter values. It examines the distribution

of model responses that are possible, given the distributions of estimated parameter values

(Orlob, et al., 1983).

Sensitivity analysis is used before and after calibration mainly to test the responsiveness

and sensitivity of the numerical model to every input parameter. It is useful for: examining the

likely uncertainty in simulation results due to uncertainty in model input parameters, and

32
examining how well parameters are likely to be estimated from the available data for model

calibration. Sensitivity analysis provides important information on how uncertainties in the

model parameters affect the model results. If the model results are highly sensitive to a

particular parameter, the uncertainty associated with that parameter will significantly affect the

ability of the model to make meaningful interpretations and predictions. It is the mean of

determining the model parameters (UNESCO.org, n.d.).

2.8 Conceptual Framework

Figure 3, shows the conceptual framework of the study. The framework is divided into

three major parts- segmentation of Pinacanauan de Tuguegarao River, data collection, and

water quality model. The segmentation of Pinacanauan de Tuguegarao River is based on the

location of the source and setting boundaries within the river reaches. Different parameters

such as dissolved oxygen, temperature and pH were collected. A water quality model is then

developed.

33
SEGMENTATION OF PINACANAUAN DE TUGUEGARAO RIVER

- Location of Waste Inputs (Source)


River Reaches
- Location of Boundaries

DATA COLLECTION

Water Quality Parameters


- Dissolved Oxygen (DO)
- Temperature
-pH

River Geometry
- Length -Velocity
- Width - Depth

WATER QUALITY MODEL

Two-Dimensional Model
- DO model
Field Data - Temperature model
- DO - pH model
- Temperature
- pH

Validation
Model Output
of Model

Figure 2: Conceptual Framework of the Study

34
CHAPTER 3

METHODOLOGY

3.1 Study Area

The study area is located in Brgy. Caggay, Tuguegarao City, Cagayan at the latitude

and longitude of 17° 37’ 37.41” N and 121° 44’ 25.44” E, respectively (Figure 4). It has a total

population of about 7,577 and approximately 25% of its total population resides along the river.

The river has an average depth of 1.56461 m. and an average velocity of 0.30618 m/s. The river

is surrounded by agricultural lands, however there were two pollutant sources were located in

the selected sampling site that impact the water quality of river water (domestic and household

effluents). Also, the nearest distance of the sampling site from the road is 31.8 m while the

furthest is 64.9 m.

Figure 3: Study Area.

35
3.2 Initial and Boundary Conditions

The selected length and width of the rivers’ boundary are 200 m. and 121m.,

respectively. The data were gathered at the outer and inner nodes of the study area. From the

outer nodes, seven points were selected as initial conditions which are denoted as B1 to B7 and

for the inner nodes, three points were selected (I1 to I3). Each point, three parameters were

tested (DO, temperature, and pH). In addition, the location of the upper and lower streams were

identified.
Source 1

Source 2
B4 B3 B2

B5 I1 I2 I3 B1 121 m.

B6 B7
200 m.
50 m. 50 m.
1 m. 1 m.
Figure 4: Selection of Boundary

36
3.3 Data Collection

3.3.1 Water Quality Parameters

Water parameters were measured using two methods: chemical testing method and the

used of measuring devices. The chemical method was used to validate the result of the

measuring devices. The dissolved oxygen, temperature and pH of each point in the boundary

were measured with two replicates. The water sampling was every after 14 days and were

gathered between 9:00 a.m. to 11:30 am.

3.3.1.2 Chemical Method

A. Water Collection

The sampling bottles were rinsed with sample water from the river. A bottle was

submerged in the river and the cap was removed. After the bottle was filled with water, the cap

was replaced and the bottle was retrieved from the river. When air bubbles appeared, the

sampling method was repeated until such time that no air bubbles were seen from the sample.

B. Dissolved Oxygen Measurement

A DO bottle was filled with sample water and added with 8 drops of Manganous Sulfate

Solution (4167). Additional 8 drops of Alkaline Potassium Iodide Azide Solution (7166) was

added to the sample before it was capped, mixed by inverting several times and allowed the

precipitate to settle. Another 8 drops of Sulfuric Acid was added to the sample, capped and

mixed properly until the formed precipitate dissolved. The sample was now “fixed”

A test tube was filled to 20 mL line with “fixed” sample and then capped. The sample

was titrated using Direct Reading Titrator (0377) with Sodium Thiosulfate, 0.025N (4169) until

the color turned to very faint yellow. The titrator was removed and the “fixed” sample was

added with 8 drops of Starch Indicator Solution (4170 WT) where the sample turned blue. The

sample was titrated until the blue color disappeared. Dissolved oxygen was recorded in ppm.

37
C. pH Measurement

A test tube (0106) was filled with 10 mL sample water, added with 8 drops of Wide

Range pH Indicator (2218), capped and properly mixed. The test tube was inserted into a wide

range Octa-Slide 2 Bar (3483-01) and Octa-Slide 2 Viewer and the pH was determined by

comparing the color of the sample with the corresponding color in the Octa-Slide 2 Viewer.

3.3.1.3 Used of Measuring Devices

1. Dissolved Oxygen Measurement

Immerse the DO probe into the solution under test to a depth of at least 10cm. Allow

the test to stabilize for several minutes to achieve thermal equilibrium between the probe and

measurement sample. Read the result given by the DO meter.

2. pH Measurement

Calibrate the pH meter by rinsing its electrode with distilled water. After calibration,

rinsed the electrode and submerged it in the water sample. Allow the readings to stabilize.

Read the result given by the pH meter.

3. Temperature Measurement

At the sampling site, submerged the thermometer in the water for one minute. Removed

the thermometer from the water then read the temperature and record the temperature as

degrees Celsius.

3.3.2 River Geometry

The number of boundaries, rate of flow, velocity, and the cross-section area were

determined. The input data for model validation were topographical and hydraulic data and

water quality in the sampling site. Topographical data were river cross-section that was

measured at all sampling boundaries. Required hydraulic data are flow rates, water depth and

velocity.

38
The data required for this model are as follows:

 Length , width and height of the river

 Number and location of boundaries

 Length between each boundaries

 Location of the intersection point of the sewage and the main river

3.4 Model Formulation

The model formulation for a particular pollutant was based in mass balance principle

and is given as:

Accumulation  inflow - outflow  sources or sinks

The mathematical model, corresponding with initial and boundary conditions, consists

of two - dimensional advection-dispersion mass balance equation of the given pollution

parameter.

The assumptions in such models are:

1. The density of clean water is equal to the density of polluted water.

2. Longitudinal and vertical hydrodynamic dispersion occurs.

3. The depth of the river and the hydraulic radius is similar.

The two-dimensional advection-dispersion model for the conservation of mass of water

quality parameters can be written for a river flow system is as follows:

C C C  2C  2C
u v  Dx 2  D y 2  S
t x y x y

Where:

C = concentration of pollutants u, v = water velocity

t = time Dx, Dy = Dispersion Coefficients

x, y = distance S = Sources or sinks

39
3.4.1 Discretization of DO Model

The formulated model for dissolved oxygen is:

C C C  2C  2C
u v  D x 2  D y 2  k a (C s  C )  k d L
t x y x y

Where:

C s = concentration of dissolved oxygen at saturation

C = actual concentration of dissolved oxygen

ka = reaeration rate constant

k d = decay rate constant

L = BOD concentration

The formulated model was discretized (See solution in Appendix), and the equation becomes:

  C i 1, j ,t  2C i , j ,t  C i 1, j ,t  C  2C i , j  C i , j 1   C i , j ,t  C i 1, j 


 D x    D y  i , j 1,t   v 
x 2   y 2   x 
      
C i , j ,t 1  t    C i , j ,t
C  C i , j 1,t 
 u i , j ,t   k a C s  C i , j ,t   k d L 
   y  

3.4.2 Discretization of Temperature

The advection-dispersion model with sink or source terms to prevent physical

processes:

T  T T    T T    T T  H
  u v    D xx  D xy    D yx  D yy  0
t  x y  x  x y  y  t y  Pc p

Where:  = density of the water

C p = heat capacity of water

P = depth of the river

H = net heat exchanges

40
Discretizing the model (See solution Appendix), it becomes

  Ti 1, j ,t  2Ti , j ,t  Ti 1, j ,t  T  2Ti , j  Ti , j 1   Ti , j ,t  Ti 1, j 


 Dx    D y  i , j 1,t   v 
  x 2
  y 2
  x 
Ti , j ,t 1  t    Ti , j ,t
T  Ti , j 1,t  H
 u i , j ,t   
  y  PCp 

3.4.3 Discretization of pH Model

The pH model was based on the two-dimensional advection-dispersion model and

represented as:

C C C  2C  2C
u v  Dx 2  D y 2  k p
t x y x y

Where:

k p is the rate constant due to chemical reaction (See appendix for the calculation of k p )

The model was discretized and becomes:

  C i 1, j ,t  2C i , j ,t  C i 1, j ,t  C  2C i , j  C i , j 1   C i , j ,t  C i 1, j 


 D x    D y  i , j 1,t   v 
x 2   y 2   x 
      
C i , j ,t 1  t    C i , j ,t
 u C i , j ,t  C i , j 1,t   k 
  y  p
 
 

3.4 Estimation and Calibration of Reaeration and Decay Rate Coefficient

Reaeration and decay rates are very important parameters in order to predict the

dissolved oxygen concentration in the river (Gonçalves, Silveira, Lopes Júnior, da Luz , &

Simões, 2017). Estimating reaeration and decay rate coefficient requires considerable efforts

since measuring these coefficients is laborious and expensive task. Hence, the coefficients used

in this study were estimated using developed equation. For the estimation of reaerations rates,

M. A. Churchill, H. L. Elmore and R. A. Buckingham's equation (1962) was used.

41
5V
k a (20C ) 
h5 / 3

where:

ka = reaeration rate at 20°C (/day)

V = mean velocity (m/s)

h = mean depth (m)

The calculated ka (20C ) were calibrated according to stream temperature using the formula:

k a  k a (20C ) x (T  20)

The temperature correction coefficient, θ, depends on the mixing condition of the river water

body. Values generally range from 1.005 to 1.030. In practice, a value of 1.024 is often used

(Thomann and Mueller, 1987).

Decay rate coefficients is also dependent on temperature. The formula for estimating

decay rate coefficient is

k d  k d (20C ) x (T  20)

where θ is 1.047. The typical value at the reference temperature 20 °C is commonly estimated

using the table below

Waste Type Kd at 20 (day-1)


Raw domestic sewage 0.35-0.70
Treated domestic sewage 0.12-0.23
Polluted river water 0.12-0.23
Table 8: Typical values of the decay coefficient for various types of wastes. From [Davis and

Cornwell, 1991]

3.5 Solution Scheme

The numerical solution of the advection-diffusion equation made use of an implicit

finite difference scheme. The finite difference approximation expressed the values and the

42
partial derivative of each function within a four-point grid formed by the intersections of the

space line i-1, I and i+1 with the time lines tn and tn+1. A control volume was defined and

situated around the grid point i. The river bed, the water surface and the two cross-sections

situated at i-1 and i+1, respectively, are the boundaries of this control volume as shown in the

figure below.

Figure 5: Solution Scheme (S. A. Mirbagheri, 2009)


For a discrete time interval change in Δt, beginning at tn and collecting term in

concentration (C), the resulting finite difference form is:

M  Dp M  Dp M
2 2

p  
t x 2 y 2

M (N wi , N Li , t + 1) M (N wi , N Li , t ) M (N wi+1 , N Li , t + 1) 2M (N wi , N Li , t + 1) + M (N wi 1 , N Li , t + 1)
ρp = +
Δt Δx 2

( )
M (N w , N Li+1 , t + 1) 2M (N wi , N Li , t + 1) + M N wi , N Li +1 , t + 1
Δy 2

M (i, j, t + 1) M (i, j, t ) M (i + 1, j, t + 1) 2M (i, j, t + 1) + M (i 1, j, t + 1)


ρp = Dρ p
Δt Δx 2

M (i, j + 1, t + 1) 2M (i, j, t + 1) + M (i, j 1, t + 1)


+
Δy 2

43
M(i, j, t + 1) M(i, j, t ) Dρ p
= [M(i + 1, j, t + 1) 4M(i, j, t + 1) + M(i 1, j, t + 1)]
Δt ρ p Δx 2

+ M(i, j + 1, t + 1) + M(i, j 1, t + 1)

M (i, j, t + 1) Dρ p Dρ p
+ 4M (i, j, t + 1) = [M(i + 1, j, t + 1) + M(i 1, j, t + 1)]
Δt ρ p Δx 2
ρ p Δx 2

M (i, j, t )
+ M (i, j + 1, t + 1) + M (i, j 1, t + 1) +
Δt

1 4Dρ p Dρ p
+ M (i, j, t + 1) = [M (i + 1, j, t + 1) + M (i 1, j, t + 1) + M (i, j + 1, t + 1)
Δt ρ p Δx 2
ρ p Δx 2

M (i, j, t )
+ M (i, j 1, t + 1)] +
Δt

3.6 Simulation Methodology

Discretized equations shown for temperature, pH and DO were coded in MATLAB

2013a. The simulation starts by loading the initial conditions such as pH, DO and temperature

of the water (Figure 7). Parameter values (e.g. dimensions of river, re-aeration rate, decay rate,

etc.) were initialized. Matrixes for the pH, DO and temperature were initially allocated in order

to increase simulation speed.

The loop is initialized by comparing the simulation time (tinst) with the target end time

(tend). The loop will terminate if the value of tinst is equal to that of tend. While tinst is not equal

to tend, another conditional statement is set to update the boundary conditions.

The simulation time is then increased by time increment, dt (1 second). The new Temp

(temperature at tinst + dt) is calculated followed by, pH (pH at tinst + dt), and DO (DO at tinst +

dt). Initial temp, pH, and DO are then updated by the calculated values.

Another conditional statement is set in order to record the simulated data. If the

remainder is equal to the zero, then, the computed temp, pH and DO will be stored in an MS

Excel file. These data (denoted as simulation data) will be compared with the actual data.

44
Start

Load Initial
Temp, pH, DO
Conditions

Initialized Values

Is tinst= tend? Yes End

No
Update Boundary
Conditions

Increase time
Counter (tinst+dt)

Compute Temp

Compute pH

Compute DO Cs

Update Initial
Conditions

No Is trem= 0?

Yes

Store Data Temp, pH, DO

Figure 6: Solution Methodology

45
3.7 Model Validation

Once the model was simulated, model testing was performed. The model was then used

to simulate an independent period for which field data under different environmental conditions

were available for comparison and validation. Results of the validation run were then compared

with field data for the same period, and a decision was made as to whether predictions and

observations were close enough to consider the model valid for predictive purposes and this

was done using the paired t-Test in Microsoft Excel 2016. If validation results were not

adequately close, the model process controlling parameters were adjusted accordingly, and the

calibration and validation process was repeated. This was done iteratively until the results were

adequate to consider the model valid for predictive purposes.

3.8. Statistical Tool

The results of the simulated data of Temperature, pH, and dissolved oxygen were

validated using paired t-Test at 5% level of significance.

3.9 Calculation of the Coefficient of Determination (R2)

Coefficient of Determination (R2) was used to measure if the simulated data was a good

for the actual data. The R2 was calculated using MATLAB™ 2013a (See codes at Appendix

C.2).

46
CHAPTER 4

Results and Discussions

4.1 Comparison of Actual and Simulated Data

The actual river water quality parameters (dissolved oxygen, temperature, and pH) were

taken every after 14 days. Water quality model for each parameter was developed using the

gathered data at the boundaries as the initial condition and was simulated using MATLAB™

2013a software. The simulated data of dissolved oxygen, temperature, and pH were visually

compared with respective observed data values, as it can be seen in Table 9,10, and 11,

respectively.

Table 9: Actual vs. Theoretical for Dissolved Oxygen.


Dissolved Oxygen (mg/L)
I1 I2 I3
Day
Actual Simulated Actual Simulated Actual Simulated
0 7.66 7.628197 7.66 7.662857 7.66 7.684965
1 7.665 6.603236 7.685 7.489097 7.685 7.35746
2 6.41 6.58578 5.955 3.501366 6.1 5.26473
3 9.03 8.343301 8.27 8.343418 8.16 8.053624
4 8.24 8.197079 8.19 8.240218 7.56 7.845481
5 8.23 7.656159 7.525 7.535051 7.335 7.113582
6 6.95 6.462873 6.5 6.534535 6.3 6.359633
7 5.36 4.562447 5.22 5.693666 6.625 4.625674
8 2.485 4.716579 5.63 3.987134 4.75 5.09569
9 7.39 6.925908 7.345 7.535377 7.555 7.292036
10 6.34 6.225017 6.29 6.251743 7.003 6.210554

47
Table 10: Actual Vs. Theoretical for Temperature Model.
TEMPERATURE (°C)
I1 I2 I3
Day
Actual Simulated Actual Simulated Actual Simulated
0 23.64 23.58306 23.642857 23.64 23.64 23.65483
1 23.5 23.60445 23.5 23.49234 23.5 23.44924
2 23.5 23.97994 22.5 22.87967 23 22.1495
3 24.5 23.65148 24.5 24.13597 25 23.54031
4 22.5 24.25581 22.75 22.99172 23 23.2918
5 26.25 26.20346 25.95 26.20466 26.05 26.09612
6 26 26.31361 27 26.99176 27 26.81986
7 27.5 27.48192 26.75 26.99172 27 27.25281
8 29 29.23192 29 29.08876 29.5 29.36588
9 30.5 30.22895 30.5 30.64344 30.5 30.7923
10 30.25 30.19987 30.6 30.55036 31.3 30.85068

Table 11: Actual vs. Theoretical for pH Model.

pH
I1 I2 I3
Day
Actual Simulated Actual Simulated Actual Simulated
0 6.74 6.758943 6.74 6.729063 6.74 6.74268
1 6.8 6.843442 6.85 6.872851 6.8 6.926767
2 6.9 6.901611 7.2 7.263789 7.2 7.065241
3 6.9 6.190473 5.8 5.739827 6.05 5.858941
4 5.3 5.891832 5.5 6.655944 5.7 5.416848
5 6.9 5.556923 6.85 7.07706 6.9 6.926402
6 4.365 5.09313 6.715 5.159399 7.04 4.886551
7 7.15 6.930695 6.95 7.127184 6.95 6.90239
8 6.9 6.943442 6.25 6.757937 6.4 6.390641
9 7.05 6.980695 7 7.089762 7.05 7.13565
10 6.9 6.951611 7.65 7.610443 7.933 7.946445

48
4.1.1 Statistical Analysis of Data

The statistical tool paired t-test in Microsoft Excel® 2016 was used to determine the

level of marginal significance between the actual and theoretical values. The Table 12 shows

that there is no significant difference between the actual and theoretical values since all the

calculated P values were greater than 0.05 for each water quality parameters (see Appendix

D.2) .Therefore, the application of these models is for calculating water quality parameters

such as dissolved oxygen, temperature and pH.

Table 12: P-Value of Actual Vs. Theoretical.

P- VALUE
Day DO Temperature pH
1 0.094416 0.385828 0.090023
2 0.154069 0.49749 0.365715
3 0.202691 0.053374 0.436546
4 0.211568 0.132078 0.315326
5 0.131526 0.220891 0.491016
6 0.269425 0.400069 0.081096
7 0.195773 0.120917 0.409407
8 0.403408 0.120917 0.177925
9 0.226458 0.387781 0.284465
10 0.159461 0.151495 0.389146

4.2 Model Accuracy

The values of the actual and theoretical water quality parameters were plotted and their

coefficient of determination was determined. The R2 of the developed model were compared

to the published model. For the water quality parameters, temperature, pH and dissolved

oxygen, the highest R-squared value was 0.99514, 0.98654 and 0.98112, respectively. The

simulated results were in good arguments with measured values. The R2 of the simulated data

were compared to the published models and results show that model developed model is in

good fit to the actual data compared to the published model (See Table 13).

49
R2= 0.94974

(a) I1

R2= 0.99514

(b) I2

R2= 0.97082

(c) I3
Figure 7: Theoretical Vs. Actual Temperature for (a) I1 (b) I2 (c) I3.

50
R2= 0.91673

(a) I1

R2= 0.92082

(b) I2

R2= 0.98654

(c) I3
Figure 8: Theoretical vs. Actual pH for (a) I1 (b) I2 (c) I3.

51
R2= 0.89811

(a) I1

R2= 0.98112

(b) I2

R2= 0.89112

(c) I3

Figure 8: Theoretical Vs. Actual DO for (a) I1 (b) I2 (c) I3.

52
Table 13: Comparison of the R2 of the Simulated and Published Models.

Formulated Model (R2) Published Model (R2)


Wear River Nene River Tamar
Temperature Model I1 0.94974
(Smith, 2009) I2 0.99514 0.962 0.976 0.98
I3 0.97082

Formulated Model (R2) Published Model (R2)


Suma River Tigris River
Dissolved Oxygen
I1 0.89811
Model
I2 0.98112 0.963 0.921
(Ahmed, 2014)
I3 0.89112

Formulated Model (R2) Published Model (R2)


Ahoada River
pH Model
I1 0.91673
(Ukpaka & Douglas,
I2 0.92082 0.839
2016)
I3 0.98654

4.3Contour mapping

4.3.1 Temperature

The initial and final values simulated during the water quality sampling for temperature

was mapped as shown in Figure 9. As seen in the figures below, the initial and final temperature

conditions have the same area of the river wherein both maps displays lower temperature on

the left side of the map and higher temperature on the left side. This difference in temperature

is due to the depth of the river for which the deeper the river the lower the temperature.

Moreover, the color of the map shows higher temperature during the final sampling which is

caused by the weather conditions.

53
(a) Initial Temperature (b) Final Temperature
Figure 9: (a) Initial and (b) Final Temperature

4.3.2 Dissolved Oxygen

Water quality contour maps were generated using the simulated initial and final values

of the dissolved oxygen model, as shown in Figure 10. The map shows the changes in the

concentration of the dissolved oxygen at a given distance in the boundary. From the contour

map of dissolved oxygen and temperature the relationship of both parameters are directly

proportional (Addy & Green, 1997). Dissolved oxygen is highest at the source, since colder

water holds more dissolved oxygen than warm water. Very little difference of the initial and

final values of the concentration of dissolved oxygen were observed.

(a) Initial DO (b) Final DO


Figure 10: (a) Initial and (b) Final DO

54
4.3.3 pH

The figures below are the contour maps for the river’s pH with the right one as the

initial condition and the other as the final. They are regular topographic maps but instead of

showing the flatness or steepness of a coordinate’s elevation, it indicates a coordinate’s pH

level.

The two figures show very little difference of pH level trend. They both displayed the

darkest color at areas around the source and the lightest color at the middle of the sinks. These

indicates that the sources, especially at the first one (B4), greatly affects the water’s pH. This

could be due to the content of the sources’ discharge that falls under domestic water waste.

Domestic water wastes usually contains acidic chemical compositions, dissolved components

and complex of detergents that contribute to the decrease of pH (Easa & Abou-Rayan, 2010).

(a) Initial pH (b) Final pH


Figure 11: (a) Initial and (b) Final pH

55
4.4 Prediction of Water Quality Parameters

4.4.1 Case 1: An additional pollutant source is present in the river


4.4.2 Case 2: The classification effluent discharge of Source 1 is at Class B

The effect of Class B effluent discharge into the river was evaluated using the

developed model. Point B4 was changed from its current status which is Class C into Class B.

The selected temperature of the Class B effluent was based on DENR-Administrative Order

No. 2016-08(See Appendix E). Figures 12 shows the changes in temperature of the river when

a Class B effluent was discharged. It is observed that the changed in temperature of the river is

small for I1 and I3 while the predicted I2 temperature ranges from 25.31416 - 27.2513 °C

compared to the actual temperature change range of 23.5 – 30.6 °C (See Appendix A.1).

(a) I1 (b) I2

(c)I3
Figure 12: Temperature Prediction for Case 2.

56
The predicted and actual DO values of I1, I2 and I3 were shown in Figures 13. As can

be seen, I1 and I3 have the smallest change between its predicted and actual values unlike I2

with predicted values that ranges to 6.73-7.61and actual values of 5.8-7.65. Based from the

results, even if Class B effluent was discharged to the river, the condition of the river will

remain at Class C.

(a) I1 (b) I2

(c) I3

Figure 13: Prediction of DO for Case 2.

57
The selected value of pH for Class B effluent was also based from DENR-

Administrative Order No. 2016-08(See Appendix). As compared to the change of pH from

actual to predicted values of each internal nodes (I1, I2 and I3), I2 have the biggest change of

pH with predicted values that ranges from 6.297044 – 6.609495 and actual values that ranges

from 6.8 – 7.65 (See Appendix A.1).

(a) I1 (b) I2

(c) I3
Figure 14: Prediction of pH for Case 2.

58
4.4.3.1 Contour Mapping of Case 2

The figure below shows the comparison between the contoured map of the current

temperature condition of the river from the gathered data and the predicted temperature where

in one of the discharge is changed to Class B. The standard temperature of Class B is 26 °C as

set by the DENR Administrative Order 2016-08-WQG (Water Quality Guidelines) and General

Effluent Standards (GES) (see Appendix E) instead of the current discharge coming from one

of the sources. The colorbar in the figures denotes the temperature condition of the water, from

darkest color (coldest) to lightest color (hottest). The contour map of the predicted temperature

condition of the river displays multiple color gradient as compared to the contour map of the

current temperature condition. The multiple gradient denotes multiple temperature in the

boundary because of the Class B discharge. Based from the colorbars, the current temperature

condition of the river is hotter compared to the predicted temperature condition. Therefore,

changing the one class of the sources to B could contribute to colder temperature in the river.

Actual Predicted

Figure 15: Actual Vs. Predicted Temperature Contour Map

The dissolved oxygen for Class B is 5 mg/L as set by the DENR Administrative Order

2016-08-WQG (Water Quality Guidelines) and General Effluent Standards (GES) (see

Appendix E). Applying the same case for dissolved oxygen, it can be observed from the figures

59
below that the level of dissolved oxygen decreases as the current discharge was changed to

Class B. The prediction shows that due to the continuous Class B discharge in the river the

dissolved oxygen also decreases continuously.

Actual Predicted

Figure 16: Actual Vs. Predicted Dissolved Oxygen Contour Map.

The same case was used for pH wherein one of the discharge was changed to Class B and

the standard pH was set to 6. The predicted pH shows multiple colour gradient which implies

multiple pH level in the boundary as compared to the current pH condition of the river. Based

from the colorbars, the pH from the current condition is more neutral as compared to the

predicted pH of the river. Therefore, the Class B discharge makes some part of the river acidic.

Actual Predicted

Figure 17: Actual vs. Predicted pH Contour Map.

60
4.4.4 Case 3: The classification of effluent discharge of Source 1 is at Class D

The following figures shows the different water quality parameters temperature, pH,

and DO for the Pinacanauan Rivers at its interior nodes I1, I2, and I3. The effect of Class D

effluent discharge into the river was evaluated using the developed model. Point B4 was

changed from its current status which is Class C into Class D. The selected temperature of the

Class D effluent was based on DENR-Administrative Order No. 2016-08(See Appendix). The

continuous lines in the figures represent the graph of the river’s current condition with two

discharges at B2 and B4 of class C. The broken lines on the other hand are the projected water

qualities of the river at its interior nodes if there will be only one sink (B4) and a discharge of

class D.

The set of figures below (Figure 18) show the current and projected water temperature

for the interior nodes. The projected graphs have the same trend as the current graph. This is

especially true to I1 and I3 beginning with a slight increase, followed by a decrease, to another

increase then to a sudden increase before flattening out towards the end. Both graphs have a

lesser maximum and minimum temperature than the current graph. Their temperature ranges

also lessened; I1 originally has a temperature range of 23.5-30.5⁰C while the projected values

ranges 23.74987-30.228954⁰C; and I3 has a current data temperature range of 23-31.3⁰C while

the projected data has 28.82607-30.91033⁰C. At I2 on the other hand, although it has a similar

trend, the projected graph has a wide gap in values with the actual graph. It has a much greater

minimum temperature than the current graph and a slightly greater maximum temperature,

lessening the temperature range from 22.5-30.6⁰C to 23.34844-30.88578⁰C. The overall effect

of having one discharge with a class D to the water instead of two of class C is having a lesser

temperature range.

61
(a)I1 (b)I2

(c)I3

Figure 18: Prediction of Temperature for Case 3.

The water parameter DO for case 3 at the interior nodes are shown below. This water

parameter has a good fit for I1 and I3. The DO for the actual river condition has a range of

2.485-9.03mg/L for I1 while the projected values has a range 4.562447-6.980695mg/L. For I3,

the actual river’s DO ranges from 4.75-7.685mg/L while the projected value has 4.851-

7.648077mg/L range. Unlike the two nodes, I2 has a bad fit. It showed a significant drop in its

DO failing to achieve even a third of the current river’s DO. Although the broken line has the

same trend as the continuous line, its peaks and sinks are not as dramatic as the continuous line.

No point had the two lines managed to intersect. The range for I3’s actual DO is from 5.22-

8.27 mg/L while the projected DO for the river ranged 3.421788-4.374152mg/L. Nonetheless,

62
having one discharge with a class D to the water instead of two of class C is having a smaller

range of DO values.

(a)I1 (b)I2

(c)I3

Figure 19: Prediction of DO for Case 3.

For the projected pH of the river for Case 3, the above figures are shown. The same as

with temperature, the trend of the pH graphs of the projected water qualities is follows the

trends of the current water qualities. The best fit among the three is in I1 followed by I3 and

the least is I2. Because the graphs of the current river pH have very high and low peaks, the

one with the least pH range is I2, followed by I3, then I1. In I1, the current river pH range was

4.365-7.15 while the projected pH range was only 5.09313-6.980695. In R2, the current data

has 5.5-7.65 pH range while the predicted pH range was from 5.638497-6.242771. Lastly, the

63
current pH range in I3 was 5.7-7.933 while the projected pH values has a range of 6.041629-

7.842703. All three graphs showed that having one discharge with a class D to the water instead

of two of class C causes a closer pH range.

(a)I1 (b)I2

(c)I3

Figure 20: Prediction of DO for Case 3.

64
4.4.4.1 Contour Mapping of Case 3

The contoured maps for the predicted and the current temperature of the river is shown

in Figure 21. In this case, the discharge coming from one of the sources was changed to Class

D where the temperature was set to 31˚C. The figure shows that both current and predicted

values displays higher temperature at the left side of the boundary as indicated by the color in

the colorbar. It can also be observed from the maps that there was a little change between the

current and predicted temperature.

Actual Predicted

Figure 21: Actual Vs. Predicted Temperature Contour Map.

Applying the same case for dissolved oxygen, the maps show the change in the level of

dissolved oxygen when current discharge was changed to Class D. The dissolved oxygen for

Class D effluent is 3 mg/L as set by the DENR Administrative Order 2016-08-WQG (Water

Quality Guidelines) and General Effluent Standards (GES). The map shows that discharge of

Class D effluent decreases the amount of dissolved oxygen in the river.

65
Actual Predicted
Figure 22: Actual vs. Prediction DO Contour Map.
The comparison between the current and predicted pH of the river is shown in the

Figure 23. The same case was used wherein one of the discharge was changed to Class D and

the pH was set to 5.5 instead of the original effluent coming from one of the sources. Based

from the colorbar, the figure shows higher pH on the current values as compared to the

predicted values. It can also be observed from the figure that blue color appeared on the

predicted pH which indicates that the river becomes more acidic as Class D effluent of 5.5 pH

is discharge in the river.

`
Actual Predicted
Figure 23: Actual vs. Predicted pH Contour Map.

66
CHAPTER 5

SUMMARY, CONCLUSION, AND RECOMMENDATION

5.1 Summary and Conclusion

Water quality parameters such as temperature, dissolved oxygen, and pH of

Pinacanauan de Tuguegarao River were measured. For each parameter, a 2-D mathematical

model was formulated and then discretized using the method finite implicit difference. The

discretized model was then simulated using MATLAB™.

Simulated temperature, dissolved oxygen and pH values were visually and statistically

compared with the measured values. The formulated model proved to be a good tool to predict

the water quality of Pinacanauan de Tuguegarao River.

Results show that there is no significant difference between the actual and theoretical

values since all the calculated P values were greater than 0.05 for each water quality

parameters. The acceptable R-squared value for temperature, dissolved oxygen and pH, was

0.9858, 0.9468 and 0.7207, respectively.

Also, the model was used to predict the amount of dissolved oxygen, temperature, and

pH. The predicted value for DO, temperature and pH was 6.74335, 23.64282, and 7.663018,

respectively.

67
5.2 Recommendations

Developing river quality models needs to consider the following considerations starting

from data collection up to model simulation for better data and results; Testing of water

parameters needs to be at least a year, to account for the two seasons (dry and wet) of the

country, including the natural calamities such as typhoons and El Niño that may affect the

concentration and condition of the river. Also a closer time interval during water sampling for

more accurate and reliable data. Selection of wider boundary for sampling points to avoid

biases in the data collection. Make use of 3 dimensional model for more actual representation

of the river and enables better decisions in water quality assessment. Consideration of more

river parameters in model formulation to account the effect of each parameter to the river

quality. Using higher quality of computer with a bigger storage and faster speed is very

necessary for simulation and prediction of water quality parameters.

68
REFERENCES

(n.d.). Retrieved from UNESCO.org:

http://echo2.epfl.ch/VICAIRE/mod_2/chapt_9/main.htm

(n.d.). Retrieved from https://nptel.ac.in/courses/112104030/pdf/lecture6.pdf

(n.d.). Retrieved from https://nptel.ac.in/courses/112104030/pdf/lecture6.pdf

(n.d.). Retrieved from https://nptel.ac.in/courses/112104030/pdf/lecture6.pdf

Abdullah, N. (2007). A Study of Several Implicit Finite Difference Schemes for the Linear

Convection Equation.

Addy, K., & Green, L. (1997). Dissolved Oxygen and Temperature. Natural Resources Facts.

Aina, & Asedipe. (1996).

Ali, W., & Husnain , H. (2010). Development of Dissolved Oxygen Model for a Highly

Variable Flow River: A Case Study of Ravi River in Pakistan. Research Gate.

Ani, E. C. (2010). Modelling of Pollutant Transport in Rivers: Process Engineering

Approach. PhD Thesis, University of Cluj-Napoca, Faculty of Chemistry and

Chemical Engineering.

Ani, E.-C. (2010). Modelling Of Pollutant Transport in Rivers: Process Engineering

Approach.

Baca, R., & Arnett, R. C. (1976). A limnological model for eutrophic lakes and

impoundments. Battelle, Pacific Northwest Laboratories, forU. SEPA, Office of

Research and Development.

Benedini, M. (2011). Water Quality Models for Rivers and Streams. State of the Art and

Future Perspectives . European Water .

69
Benedini, M., & Tsakiris, G. (2013). Water Quality Modelling for Rivers and Streams. New

York: Springer.

Bowen, I. (1926). The ratio of heat losses by conduction and by evaporation from any water

surface. Physics Review 27, 779.

Bowen, J. D., Perry, D. N., & Bell, C. D. (2014, November). Hydrologic and Water Quality

Model Development Using Simulink. Journal of Maine Science and Engineering,

616-629. doi:10.3390

Bowie, G. L., Mills, W. B., Porcella, D. B., Campbell, C. L., Pagenkopf, J. R., Rupp, G. L., . .

. Gherini, S. A. (1985). Rates, Constant, and kinetics Formulations in Surface Water

Quality Modeling.

Churuksaeva, V., & Starchenko, A. (2015). Mathematical Modeling of a River Stream Based

on a Shallow Water Approach. Procedia Computer Science.

D.M.Causon, & Mingham, C. G. (2010). Introductory Finite Difference Methods for PDES.

Mingham & Ventus Publishing ApS.

Dawood, A. S., Hussain, H. K., & Hassan, M. (2016, October). Modeling of River Water

Quality Parameters Using Artficial Neural Network - A Case Study. International

Journal of Advances in Mechanical and Civil Engineering, III(5), 51-54.

Dayag, C. R., Gazmen, M. N., & Quizon, R. A. (2016). Water Quality Monitoring

Assessment of Pinacanauan de Tuguegarao Rive Using WQI and GIS. Undergraduate

Thesis, CAgayan State University, Chemical Engineering, Tuguegarao.

DENR-EMB. (2014). Natural Water Quality Status Report.

Easa, A., & Abou-Rayan, A. (2010). Domestic Wastewater Effect on the Pollution of the

Groundwater in Rural Areas in Egypt. Fourteenth International Water Technology

70
Conference, IWTC, pp. 909-923. Retrieved from

https://pdfs.semanticscholar.org/4b27/3b40fb9e49934bc0f67073adeff954752c1d.pdf

Edinger, J. (1979). A hydrodynamic two-dimensional reservoir model: development and test

application to Sutton Reservoir Elk River, West Virginia.

Eldho, T. (n.d.). Watershed Management. Retrieved from NPTEL:

https://nptel.ac.in/courses/105101010/downloads/Lecture29.pdf

(2006). EMB National Water Quality Status Report.

Espejo, J., Tungpalan, J., Negi, V., & Alex, S. (2015). Physicochemical and Bacteriological

Analysis of Water in Pinacanauan River Along Barangay Callao, Pataguele, and

Cabbo Penablanca Cagayan.

Flow-3D. (2019). flow3d. Retrieved from https://www.flow3d.com/resources/cfd-

101/numerical-issues/implicit-versus-explicit-numerical-methods/

Fonseca, A. R. (2014). River Water Quality Modelling for River Basin and Water Resources

Management.

Gonçalves, J. C., Silveira, A., Lopes Júnior, G. B., da Luz , M. S., & Simões, A. A. (2017).

Reaeration Coefficient Estimate: New Parameter for Predictive Equations. Springer

International Publishing AG 2017.

Haider, H., & Ali, W. (2010). Development of Dissolved Oxygen Model for a Highly

Variable Flow River: A Case Study of Ravi River in Pakistan. Research Gate.

Herb, W., & Heinz , S. (2008). A flow and temperature model for the Vermillion River, Part

I: Model development and baseflow conditions.

Houcque, D. (2005). Introduction to MATLAB for Engineering Students. Illinois.

71
Hussain, S. A., Atshan, W. G., & Najam, Z. M. (2012, October). Mathematical Model for the

Concentration of Pollutants Dissolved Oxygen in Diwaniya River (Iraq). American

Journal of Scientific Reasearch(78), 33-37.

Introduction to Finite Difference Method and Fundamentals of CFD. (n.d.). Retrieved from

NPTEL: https://nptel.ac.in/courses/112104030/pdf/lecture1.pdf

Jarvie, H. P., Whitton, B., & Neal, C. (1998). Nitrogen and phosphorus s in east coast British

rivers: speciation, sources and biological significance. Science of the Total

Environment, 79–109.

Jolánkai, D. G. (2000). Description of the CAL programme on Water Quality Modelling

Version 2 Baic River and Lake Water Model Quality.

Kang, G. K., Gao, J., & Xie, G. (2017). Data-driven Water Quality Analysis and Prediction:

A Survey. Science Direct.

Kashefipour, S. M., & Roshanfekr, A. (2012). Numerical Modelling of Heavy Metals

Transport Processes in Riverine Basins . In Numerical Modelling . In Tech.

Kaw, A., Nguyen, C., & Snyder, L. (2012, July 17). mathforcollege. Retrieved from

http://nm.mathforcollege.com/:

http://mathforcollege.com/nm/mws/gen/08ode/mws_gen_ode_spe_finitedif.pdf

Knight, A. (2000). Beyond, Basics of MATLAB® and. Washington DC: CRC press LLC.

Ledder, G. (2015). Mathematics for the Life Sciences: Calculus, Modeling, Probability, and

Dynamical Systems. Springer Undergraduate Texts in Mathematics and Technology.

Lindenschmidt, D.-I. K.-E. (2005). River water quality modelling for river basin and water

resources management with a focus on the Saale River, Germany.

72
Livshits, D. I., & Coleman, N. (2008). Mathematical Modeling.

Loucks, D. P., & Beek, E. (2005). Water Resources Systems Planning and Management, An

Introduction to Methods,Models and Applications. UNESCO PUBLISHING.

Loucks, D. P., & Beek, E. (2005). Water Resources Systems Planning and Management, An

Introduction to Methods,Models and Applications. UNESCO PUBLISHING.

Loucks, D. P., & Beek, E. V. (2005). Water Resources Systems Planning and Management.

Makita, S., & Saeki, H. (2006). Method of Water Quality Improvement by Use of Ice Floe

Control Structure. IAHR .

Marion, G. (2008). An Introduction to Mathematical Modelling.

Mirbaghery, S. A., Abaspour, M., & Zamani, K. (2009). Mathematical Modelling of Water

Quality in River Systems. 31-41.

Mulla, R. K., & Bhosale, S. M. (2016, August). Water Quality Analysis and Simulation of

Panchaganga River Using Matlab. International Journal of Engineering Sciences &

Research Technology, 613-620. doi:10.5281/zenodo.60106

multiphysics CYCLOPEDIA. (2015, January 14). Retrieved from COMSOL:

https://www.comsol.com/multiphysics/what-is-mass-transfer

Multiphysics CYCLOPEDIA. (2015, January 15). Retrieved from COMSOL:

https://www.comsol.com/multiphysics/navier-stokes-equations

Nave, R. (n.d.). Heat Transfer. Retrieved from Hyperphysics: http://hyperphysics.phy-

astr.gsu.edu/hbase/thermo/heatra.html

Nave, R. (n.d.). Hyperphysics. Retrieved from Conservation Laws: http://hyperphysics.phy-

astr.gsu.edu/hbase/index.html

73
Nikishkov, G. P. (2004). INTRODUCTION TO THE FINITE.

Orlob, G. T. (1983). Mathematical modelling of water quality: Streams, Lakes, and

Reservoirs. A Wiley-Interscience Publication.

Orlob, G. T., , Bruce Beck, M., Harleman, D. F., Jacquet, J., Jorgesnen, S. E., . . . Watanabe,

M. (1983). Mathematical Modeling of Water Quality: Streams, Lakes, and Reservoirs.

(G. T. ORLOB, Ed.) Benicia, California: A Wiley-Interscience Publication.

Quarteroni, A. (2009). Mathematical Models in Science and Engineering. 56, 1.

Raterman, B., Schaars, F. W., & Griffioen, M. (2000). GIS and MATLAB Integrated

Groundwater Modelling.

Ruzgas, Inga Ruzgiene, & Tomas. (2014). MATHEMATICAL MODELING OF WATER

QUALITY CHANGE IN EASTERN EUROPEAN RIVER. International Journal of

Science, Environment and Technology.

Ruzgiene, I., & Ruzgas, T. (2014). MATHEMATICAL MODELING OF WATER

QUALITY CHANGE IN EASTERN EUROPEAN RIVER. International Journal of

Science, Environment and Technology.

Ryan, P., & Harleman, D. R. (1973). An analytical and experimental study of transient

cooling pond behavior.

S. A. Mirbagheri, M. A. (2009). Mathematical modeling of water quality in river systems.

EWRA, 31-41.

Samalerk, P., & Pochai, N. (2018). Numerical Simulation of a One-Dimensional Water-

Quality Model in a Stream Using a Saulyev Technique with Quadratic Interpolated

Initial-Boundary Conditions. Hindawi.

74
Serway, R. A., Faughn, J. S., Vuille, C., & Bennett, C. A. (2006). College Physics (7th ed.).

U.S.A.: Thomson Books/Cole.

Sileika, A. S. (1996). Agriculture Nitrogens Impact on Water Quality in Lithuanian Rivers.

Environmental Research, Engineering and Management.

Skorzinski, E., Shacham, M., & Brauner, N. (2009). A Simulation Program for Modelling

Pollutant Dispersion for Educaional Applications. Elsevier, 1233-1238.

Subklay, K., & Pochai, N. (2017). Numerical Simulations of a Water Quality Model in a

Flooding Stream Due to Dam-break Problem Using Implicit and Explicit Methods.

Journal of Interdisciplinary Mathematics.

Swinbank, W. (1963). Long wave radiation from clear skies. Quarterly Journal of the Royal

Meteorological Society 89, 339-348.

Tetra Tech, I. (1983). The Integrated Lake-Watershed Acidification Study, Volume 1: Model

Principles and Application Procedures. . Electric Power Research Institute.

The University of Iowa. (n.d.). Retrieved from

http://www2.physics.uiowa.edu/~rmerlino/1701_F_16/1701_conservation_laws.pdf

Thomann, R. (1975). Mathematical modeling of phytoplankton in Lake Ontario.

Ukpaka, C., & Douglas, I. E. (2016). Model Development for pH, Salinity and Conductivity

Monitoring and Predicting the Diffusion Concentration in Stagnant Water. Chemical

Sciences Journal.

Verwer, J. (1998, July). Numerical Algorithms for Air and Surface Water Quality Modelling.

ERCM.

75
Wageningen-Kessels van, F., Lint, H. v., Hoogendoorn, S. P., & Vuik, K. (2008). Implicit

and Explicit Numerical Methods for Macroscopic Traffic Flow Models.

Weisstein, E. W. (2018). MathWorld: Finite Volume Method.

76
APPENDIX A

Water Quality Parameters, River Geometry, and Meteorological Data

A.1 Actual Data

First Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 6.85 23.75 7.86
B2 6.75 23.5 7.645
B3 6.8 23.5 7.505
B4 6.7 23.5 7.58
B5 6.8 23.5 7.62
B6 6.55 23.75 7.675
B7 6.75 24.0 7.755
I1 6.8 23.5 7.665
12 6.85 23.5 7.685
13 6.8 23.5 7.685

Second Sampling
Dissolve Oxygen
pH Temperature
(mg/L)
B1 7.0 22.75 5.54
B2 6.8 22.75 4.785
B3 7.25 23.0 5.365
B4 6.75 23.25 0.83
B5 6.9 23.75 5.245
B6 7.1 22.75 5.8
B7 7.2 22.75 6.24
I1 6.9 23.5 6.41
12 7.2 22.5 3.95
13 7.2 23.0 6.1

Third Sampling
Dissolve Oxygen
pH Temperature
(mg/L)
B1 6.9 24 8.4
B2 5.6 23.5 7.87
B3 5.65 24.0 8.22
B4 5.6 24.0 8.25
B5 6.9 24.3 8.45
B6 6.85 24.5 8.72
B7 6.9 24.75 8.48
I1 6.0 24.5 9.03
12 5.8 24.5 8.27
13 6.05 25.0 8.16

77
Fourth Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 5.4 22.75 7.61
B2 5.25 23.0 8.0
B3 6.7 23.0 8.045
B4 5.55 23.0 8.465
B5 5.2 22.75 8.195
B6 5.0 23.0 7.955
B7 5.4 23.75 7.995
I1 5.7 22.5 8.24
12 6.2 22.75 8.19
13 5.7 23.0 7.56

Fifth Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 6.95 26.0 7.445
B2 6.85 25.95 7.05
B3 6.85 26.1 7.365
B4 7.15 26.25 7.525
B5 6.85 26.35 8.2
B6 6.9 26.0 7.765
B7 6.8 26.8 7.64
I1 5.8 26.25 8.23
12 6.85 25.95 7.525
13 6.9 26.05 7.335

Sixth Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 6.86 27.0 6.35
B2 3.315 27.0 6.6
B3 5.64 26.75 6.25
B4 2.79 27.5 7.15
B5 3.755 26.0 6.9
B6 6.245 27.0 6.4
B7 7.07 27.75 6.3
I1 5.1 26.0 6.95
12 5.25 26.5 7.05
13 5.0 26.5 6.3

78
Seventh Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 7.0 26.5 6.49
B2 6.9 27.0 4.165
B3 6.9 27.0 5.73
B4 7.2 27.0 4.68
B5 6.95 26.75 5.855
B6 7.0 26.5 6.52
B7 7.05 26.0 6.59
I1 7.15 27.0 5.36
12 6.95 26.75 5.22
13 6.95 27.0 5.05

Eight Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 6.25 30.0 4.735
B2 6.15 29.0 3.74
B3 6.3 29.25 4.545
B4 7.0 28.75 2.585
B5 6.9 28.5 2.765
B6 6.9 29.25 2.745
B7 6.85 30.0 3.24
I1 6.9 29.0 4.25
12 6.5 29.0 4.1
13 6.4 29.5 4.75

Ninth Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 7.0 30.75 7.685
B2 6.95 30.75 7.175
B3 6.95 30.5 7.525
B4 7.05 31.0 7.315
B5 7.0 30.25 7.43
B6 7.0 31.0 7.56
B7 7.0 31.75 7.635
I1 7.05 30.5 7.39
12 7.0 30.5 7.345
13 7.05 30.5 7.555

79
Tenth Sampling
Dissolve Oxygen
pH Temperature(˚C)
(mg/L)
B1 7.9 31.35 6.77
B2 7.9 30.65 6.02
B3 7.9 30.7 6.21
B4 7.05 30.35 6.19
B5 6.95 30.2 6.225
B6 7.9 30.55 6.685
B7 7.6 31 6.565
I1 6.9 30.25 30.25
12 7.75 30.6 30.6
13 7.633 31.3 7.003

A.2 Average Height of the River

Day Average Height (m)


Day 1 1.173333
Day 2 6.039467
Day 3 1.076667
Day 4 1.2
Day 5 0.683333
Day 6 1.393333
Day 7 0.923333
Day 8 0.38
Day 9 0.826667
Day 10 1.95
Average: 1.56461

A.3 Average Velocity

Velocity (m/s)
v_1 0.205432
v_2 0.533079
v_3 0.569175
v_4 0.15232
v_5 0.070872
Average 0.306176

A.4 Slope of the River

Elevation Difference
Slope river 
Length of River

80
Length of river 200 m.
Minimum Elevation 18 m.
Maximum Elevation 27 m.
Elevation Difference 9 m.
Slope of river 0.045

A. 5 Meteorological Data

December January February March


2018 2019 2019 2019
Dry Bulb Temp. (°C) 24.9 23.6 24.9 33.5
Wet Bulb Temp(°C) 22.5 21.6 21.1 22.5
Station Press. (hPa) 1008 1010.2 1009.7 1006.9
Mean Dew Point (°C) 22.2 20.6 19.5 20.8
Mean Relative Humidity 84% 83% 71% 70%
Wind Ave. Speed (m/s) 2 2 1 1
Mean Cloudiness (Oktas) 6 0 4 4
Vapor Pressure (mmHg) 26.42 24.86 23.37 24.86
Source: Philippine Atmospheric, Geophysical and Astronomical Services Administration
(PAGASA)-Tuguegarao City

Clear Sky Solar Radiation


(kW-hr/m^2/day)
December, 2018 2.9225
January, 2019 3.974839
February, 2019 5.573
March, 2019 5.702903
April, 2019 -130.954
Source: https://power.larc.nasa.gov/data-access-viewer/

81
APPENDIX B

Model Discretization and Calculation of Sources/Sinks

B.1 Discretization of Formulated Model

B.1.1 Dissolved Oxygen Model

The formulated model for dissolved oxygen is:

C C C  2C  2C
u v  Dx 2  D y 2  k a (C s  C )  k d L
t x y x y

and it was discretized, the equation becomes

Ci , j ,t 1  Ci , j ,t u Ci , j ,t  Ci  j , j ,t  u Ci , j ,t  Ci , j 1,t  Dx Ci 1, j ,t  2Ci , j ,t  Ci 1, j ,t  D y Ci , j 1,t  2Ci , j ,t  Ci , j 1,t 
   
t x y x 2 y 2
 k a C sat  Ci , j ,t   k d L

Ci , j ,t 1  Ci , j ,t Dx Ci 1, j ,t  2Ci , j ,t  Ci 1, j ,t  D y Ci , j 1,t  2Ci , j ,t  Ci , j 1,t 


  
t x 2 y 2
u Ci , j ,t  Ci  j , j ,t  u Ci , j ,t  Ci , j 1,t 
  k a C sat  Ci , j ,t   k d L
x y

 Dx Ci 1, j ,t  2Ci , j ,t  Ci 1, j ,t  D y Ci , j 1,t  2Ci , j ,t  Ci , j 1,t  


  
 x 2
 y 2
 t  C
 u Ci , j ,t  Ci  j , j ,t  u Ci , j ,t  Ci , j 1,t 
Ci , j ,t 1
 i , j ,t

   k C  C   k L 
x y
a sat i , j ,t d
 

B.1.2 Temperature Model

The advection-dispersion model with sink or source terms to prevent physical processes:

T  T T    T    T  H
  u v    D x    D y  0
t  x y  x  x  y  y  Pc p

The solution for the discretization of the model is

T   T    T   T T  H
  Dx    D y    u v  0
t x  x  y  y   x y  Pc p

Assume u = v

82
T  2T  2T T T H
 Dx 2  D y u u  0
t x y 2
x y Pc p

Ti , j ,t 1  Ti , j ,t  Ti 1, j ,t  2Ti , j ,t  Ti 1, j ,t  T  2Ti , j ,t  Ti , j 1,t 


 D x    D y  i , j 1,t 
t  x 2
  y 2 
 Ti , j ,t  Ti 1, j ,t   Ti , j ,t  Ti , j 1,t  H
- u   u  
 x   y  Pc p

  Ti 1, j ,t  2Ti , j ,t  Ti 1, j ,t  T  2Ti , j ,t  Ti , j 1,t 


 Dx    D y  i , j 1,t 
  x 2
  y 2 
Ti , j ,t 1  t    Ti , j ,t
T  Ti 1, j ,t   Ti , j ,t  Ti , j 1,t  H
 u i , j ,t   u   

  x   y  Pc p 

B.1.3 pH Model

The pH model was based on the two-dimensional advection-dispersion model and represented

as:

C C C  2C  2C
u v  Dx 2  D y 2  k p
t x y x y

and it was discretized, the equation becomes

C i , j ,t 1  C i , j ,t u C i , j ,t  C i  j , j ,t  u C i , j ,t  C i , j 1,t  D x C i 1, j ,t  2C i , j ,t  Ci 1, j ,t 


  
t x y x 2
D y C i , j 1,t  2C i , j ,t  C i , j 1,t 
  kp
y 2

Ci , j ,t 1  Ci , j ,t Dx Ci 1, j ,t  2Ci , j ,t  Ci 1, j ,t  D y Ci , j 1,t  2Ci , j ,t  Ci , j 1,t 


  
t x 2 y 2
u Ci , j ,t  Ci  j , j ,t  u Ci , j ,t  Ci , j 1,t 
  kp
x y

83
 Dx Ci 1, j ,t  2Ci , j ,t  Ci 1, j ,t  D y Ci , j 1,t  2Ci , j ,t  Ci , j 1,t  
  
 x 2
y 2
 t  C
 u Ci , j ,t  Ci  j , j ,t  u Ci , j ,t  Ci , j 1,t 
Ci , j ,t 1
 i , j ,t

   kp 
 x y 

B.2 Calculation of the Sources/Sinks

B.2.1 Dissolved Oxygen

S  k a (C s  C )  k d L

5V 50.30618
k a (20C )    0.72599
h 5/3
1.564615 / 3
For the calibration of reaeration rate ka:

k a  k a (20C ) x1.024 (T 20)

k a  0.72599 x1.02426.434520

1
k a  0.84568
day

B.2.2 Temperature model

H
S
Pc p

The net external heat flux can be

H  H S  H SR  H A  H AR  H BR  H E  H C

Net Short Wave Solar Radiation H SN 

H SN  H S  H SR  0.94 H SC 1  0.65SK 2  

 0.94 779.091 1  0.650.414
2

 650.7868275 W/m 2

Net atmospheric radiation H AN 

H AN  H A - H AR  5.16432 10 13
1  0.17 SK  TA  273.166

84
H AN  H A - H AR  5.16432  10 1  0.17 SK  TA  273.166
13

 5.16432  10 -13
1  0.17  0.414 27.26  273.166
 392.1994804 W / m 2

Long Wave Back radiation H BR 

H BR  TS
4

 
H BR  0.97  5.670  10 -8 26.4507  273.15
4

H BR  0.4431248322 W / m 2

Evaporative Heat Flux H E 

H E  W L a  bW  es - ea 

H E  W L a  bW  es - ea 

L = (597 - 0.57 × TS )

= (597 - 0.57 × 26.4507) (4184)

= 2343.766255 W / m 2

eS = a j + b jTs

= (- 22.29) + (2.151) (26.4507)


= 34.6054557

4157
e a = 2.171 × 108 e
Td + 239.09

= 24.51048738

 
H E  997.05  2343.766255 0  1  10 -9  2 34.6054558 - 24.51048738
 0.04901276095 W / m 2

Convective heat flux H C 

T -T 
 
H C  H E 6.19  10 8 p  S A 
 e S - ea 

85

H C  H E 6.19  10 -4 p  TS - TA
e S - ea


 0.04901276095 6.19  10 -4 1008.7   26.4507 - 20.775
34.6054558 - 24.51048738
 1.47205857  10 -5 W / m 2

Calculation for

H  QS QSR  Q A Q AR QBR QE  QC
 -650.7868275  392.1994804 - 0.4431248322 - 0.04901276095  1.47205857  10 -5
 -259.049483 W/m 2

H - 259.049483 W/m 2

hcp
1.56461 m  997.05 kg3  4182 J
m kg
 0.00005575964433

B.2.3 pH Model

Henry’s Law Equilibrium

CO2 ,sat  k H PCO2

Henry’s constant for CO2 can be calculated using

At Tave = 26.4507 + 273.15 = 299.6007 K

k H  M CO2 10 ( 2385.73 / TK )14.01840.0152642TK 

 2385.73 
 299.600714.0184 0.0152642 299.6007
k H  44,000mg / mol   10  

mg
k H  1449.605441
L.atm

 mg 
CO2,sat  1449.605441 0.00033atm
 L.atm 

From the reactions, the equilibrium constants are:

 3404.71 
14.84350.032786 299.6007 299.6007 
k1  10  

mg
k1  4.53557571x10 7
L

86
 2902.39 
 6.4980.02379299.6007 299.6007 
k2  10  

mg
k 2  4.819166316 x10 11
L

B.3 Diffusion Coefficient

B.3.1 Coefficient of horizontal diffusion

Dx  cL4 / 3

Dx  0.01200 
4/3

2
cm 2  1m 
Dx  11.69607095  
sec  100cm 
m2
Dx  1.169607095 x10 3
sec
B.3.2 Coefficient of vertical diffusion

D y  0.067 u* H
D y  0.067 H gRh S

m
Dy  (0.067)(1.56461m)  (9.81 )(1.56461m)(0.045m)
s2
m2
Dy  0.08712
sec

87
APPENDIX C

MATLAB™ CODES

C.1 Program Codes for Model Validation

clear all
close all
clc

%Initialized matrix
Temp(1:121,1:200,1:2) = 23.642857;
pH(1:121,1:200,1:2) = 6.72857;
DO(1:121,1:200,1:2) = 7.662857;

dx = 1;
dy = 1;
dt = 1;

t_end = 10*14*3600*24;
t_inst =0;

u = 1:200;
v = 1:121;
x = 1:200;
y = 1:121;

i = 2;
t = 1;

m = (2:199);
n = (2:120);
p = (120:199);
a = 0.306176; %velocitY
ka = 0.84568./(24*3600);
kd = 0.671940043./(24*3600);
kp = 0.00000045355757; %rate constant due to reaction
L = 1; %BOD
d = 0.000000146219647;
Dx = 0.001169607095; %longitudinal diffusion constant
Dy = 0.08712; %vertical diffusion constant
A = -0.01289651149;
Ey = 1.171645495;
ky = 4169663.1;
Cp = 4182;
r = 997.05; %density
K = 0.6096866667; %thermal conductivity

while t_inst <= t_end

%update boundary conditions

if t_inst == 0*3600*24

Temp(1,u,t) = 23.5;
Temp(1,v,t) = 23.5;

88
Temp(121,x,t) = 0.0025.*x + 23.625;
Temp(200,y,t) = 23.75;

pH(1,u,t) = -0.00001.*x.^2 + 0.0024.*x + 6.6976;


pH(1,v,t) = 6.8;
pH(121,x,t) = 0.002.*x + 6.45;
pH(200,y,t) = 6.85;

DO(1,u,t) = 0.00002.*x.^2 - 0.0032.*x + 7.5831;


DO(1,v,t) = 7.58;
DO(121,x,t) = 0.0008.*x + 7.635;
DO(200,y,t) = 7.86;

elseif t_inst == 14*3600*24

Temp(1,u,t) = -0.00002.*x.^2 -0.008.*x + 23.251;


Temp(1,v,t) = 23.75;
Temp(121,x,t) = 22.75;
Temp(200,y,t) = 22.75;

pH(1,u,t) = -0.00009.*x.^2 + 0.0146.*x + 6.7355;


pH(1,v,t) = 6.9;
pH(121,x,t) = 0.001.*x + 7.05;
pH(200,y,t) = 7;

DO(1,u,t) = -0.0004.*x.^2 + 0.0847.*x + 0.7457;


DO(1,v,t) = 5.245;
DO(121,x,t) = 0.0044.*x + 5.58;
DO(200,y,t) = 5.54;

elseif t_inst == 28*3600*24

Temp(1,u,t) = -0.00007.*x.^2 + 0.0068.*x + 23.993;


Temp(1,v,t) = 24.3;
Temp(121,x,t) = 0.0025.*x + 24.375;
Temp(200,y,t) = 24;

pH(1,u,t) = -0.00001.*x.^2 + 0.0015.*x + 5.5985;


pH(1,v,t) = 6.9;
pH(121,x,t) = 0.0005.*x + 6.825;
pH(200,y,t) = 6.9;

DO(1,u,t) = -0.00004.*x.^2 + 0.0042.*x + 8.2458;


DO(1,v,t) = 8.45;
DO(121,x,t) = -0.0024.*x + 8.84;
DO(200,y,t) = 8.4;

elseif t_inst == 42*3600*24

Temp(1,u,t) = 23;
Temp(1,v,t) = 22.75;
Temp(121,x,t) = 0.0075.*x + 22.625;
Temp(200,y,t) = 22.75;

pH(1,u,t) = -0.0003.*x.^2 + 0.0391.*x + 5.5111;


pH(1,v,t) = 5.2;
pH(121,x,t) = 0.019.*x + 4.05;
pH(200,y,t) = 5.4;

89
DO(1,u,t) = 0.00002.*x.^2 - 0.0065.*x + 8.4715;
DO(1,v,t) = 8.195;
DO(121,x,t) = 0.0004.*x + 7.935;
DO(200,y,t) = 7.61;

elseif t_inst == 56*3600*24

Temp(1,u,t) = -0.00001.*x.^2 -0.0005.*x + 26.251;


Temp(1,v,t) = 26.35;
Temp(121,x,t) = 0.008.*x + 25.6;
Temp(200,y,t) = 26;

pH(1,u,t) = 0.00002.*x.^2 - 0.0051.*x + 7.1551;


pH(1,v,t) = 6.85;
pH(121,x,t) = -0.001.*x + 6.95;
pH(200,y,t) = 6.95;

DO(1,u,t) = -0.00003.*x.^2 + 0.0016.*x + 7.5235;


DO(1,v,t) = 8.2;
DO(121,x,t) = -0.0013.*x + 7.8275;
DO(200,y,t) = 7.445;

elseif t_inst == 70*3600*24

Temp(1,u,t) = 0.00008.*x.^2 - 0.0161.*x + 27.516;


Temp(1,v,t) = 26;
Temp(121,x,t) = 0.0075.*x + 26.625;
Temp(200,y,t) = 27;

pH(1,u,t) = -0.0005.*x.^2 + 0.0798.*x + 2.7107;


pH(1,v,t) = 3.755;
pH(121,x,t) = 0.0082.*x + 5.8325;
pH(200,y,t) = 6.86;

DO(1,u,t) = 0.0001.*x.^2 - 0.02.*x + 7.1699;


DO(1,v,t) = 6.9;
DO(121,x,t) = -0.001.*x + 6.45;
DO(200,y,t) = 6.35;

elseif t_inst == 84*3600*24

Temp(1,u,t) = 27;
Temp(1,v,t) = 26.75;
Temp(121,x,t) = -0.005.*x + 26.75;
Temp(200,y,t) = 26.5;

pH(1,u,t) = 0.00002.*x.^2 - 0.0051.*x + 7.2051;


pH(1,v,t) = 6.95;
pH(121,x,t) = 0.0005.*x + 6.975;
pH(200,y,t) = 7;

DO(1,u,t) = -0.0003.*x.^2 + 0.039.*x + 4.6413;


DO(1,v,t) = 5.855;
DO(121,x,t) = 0.0007.*x + 6.485;
DO(200,y,t) = 6.49;

elseif t_inst == 98*3600*24

90
Temp(1,u,t) = -0.00007.*x.^2 + 0.0119.*x + 28.738;
Temp(1,v,t) = 28.5;
Temp(121,x,t) = 0.0075.*x + 28.875;
Temp(200,y,t) = 30;

pH(1,u,t) = 0.00003.*x.^2 - 0.0098.*x + 7.0098;


pH(1,v,t) = 6.9;
pH(121,x,t) = -0.0005.*x + 6.925;
pH(200,y,t) = 6.25;

DO(1,u,t) = -0.0002.*x.^2 + 0.0441.*x + 2.5411;


DO(1,v,t) = 2.765;
DO(121,x,t) = 0.005.*x + 2.4975;
DO(200,y,t) = 4.735;

elseif t_inst == 112*3600*24

Temp(1,u,t) = 0.00007.*x.^2 - 0.0119.*x + 31.012;


Temp(1,v,t) = 30.25;
Temp(121,x,t) = 0.0075.*x + 30.625;
Temp(200,y,t) = 30.75;

pH(1,u,t) = 0.000007.*x.^2 - 0.0017.*x + 7.0517;


pH(1,v,t) = 7;
pH(121,x,t) = 7;
pH(200,y,t) = 7;

DO(1,u,t) = -0.00006.*x.^2 + 0.0083.*x + 7.3068;


DO(1,v,t) = 7.43;
DO(121,x,t) = 0.0008.*x + 7.5225;
DO(200,y,t) = 7.685;

elseif t_inst == 126*3600*24

Temp(1,u,t) = -0.00003.*x.^2 + 0.0066.*x + 30.343;


Temp(1,v,t) = 30.2;
Temp(121,x,t) = 0.0045.*x + 30.325;
Temp(200,y,t) = 31.35;

pH(1,u,t) = -0.00006.*x.^2 + 0.0144.*x + 7.0357;


pH(1,v,t) = 6.95;
pH(121,x,t) = -0.003.*x + 8.05;
pH(200,y,t) = 7.9;

DO(1,u,t) = -0.00003.*x.^2 + 0.0029.*x + 6.1871;


DO(1,v,t) = 6.225;
DO(121,x,t) = -0.0012.*x + 6.505;
DO(200,y,t) = 6.77;

end

%discretized codes

%Temperature Model
%Interior Nodes
Temp(n,m,t+1) = ( dt.*((Dx.*(Temp(n-1,m,t)-
(2.*Temp(n,m,t))+Temp(n+1,m,t))./(dx.^2))+ (Dy.*(Temp(n,m-1,t)-

91
(2.*Temp(n,m,t))+ Temp(n,m+1,t))./(dy.^2))-((a.*(Temp(n,m,t)-Temp(n-
1,m,t)))./(dx))-((a.*(Temp(n,m,t)-Temp(n,m-1,t)))./(dy)))-
0.00003974749081)+ (Temp(n,m,t));

%pH Model
%Interior Nodes
pH(n,m,t+1) = ( dt.*((Dx.*(pH(n-1,m,t)-
(2.*pH(n,m,t))+pH(n+1,m,t))./(dx.^2))+ (Dy.*(pH(n,m-1,t)-(2.*pH(n,m,t))+
pH(n,m+1,t))./(dy.^2))-((a.*(pH(n,m,t)-pH(n-1,m,t)))./(dx))-
((a.*(pH(n,m,t)-pH(n,m-1,t)))./(dy)))+kp)+ (pH(n,m,t));

%DO Model
%Interior Nodes
DO(n,m,t+1)=( dt.*((Dx.*(DO(n-1,m,t)-
(2.*DO(n,m,t))+DO(n+1,m,t))./(dx.^2))+ (Dy.*(DO(n,m-1,t)-(2.*DO(n,m,t))+
DO(n,m+1,t))./(dy.^2))-((a.*(DO(n,m,t)-DO(n-1,m,t)))./(dx))-
((a.*(DO(n,m,t)-DO(n,m-1,t)))./(dy))+(ka.*(Csat(Temp(n,m,t))-DO(n,m,t)))-
(kd.*L)))+ (DO(n,m,t));

if rem(t_inst,1209600) == 0
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',t_inst,'Simulation Result',strcat('A',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',Temp(60,2,t+1),'Simulation Result',strcat('B',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',Temp(60,100,t+1),'Simulation Result',strcat('C',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',Temp(60,199,t+1),'Simulation Result',strcat('D',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',pH(60,2,t+1),'Simulation Result',strcat('F',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',pH(60,100,t+1),'Simulation Result',strcat('G',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',pH(60,199,t+1),'Simulation Result',strcat('H',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',DO(60,2,t+1),'Simulation Result',strcat('J',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',DO(60,100,t+1),'Simulation Result',strcat('K',int2str(i)))
xlswrite_1('C:\Users\maricel\Documents\Thesis\Simulation Result
2019.xlsx',DO(60,199,t+1),'Simulation Result',strcat('L',int2str(i)))

i = i+1;

end

Temp(n,m,1) = Temp(n,m,2);
pH(n,m,1) = pH(n,m,2);
DO(n,m,1) = DO(n,m,2);

Boundary = DO(60,200,1);
Inside = DO(60,60,1);

t_inst = t_inst + dt

end

92
C.2 Matlab™ Codes for Calculation of R2

function [r2 rmse] = rsquare(y,f,varargin)


% Compute coefficient of determination of data fit model and RMSE
%
% [r2 rmse] = rsquare(y,f)
% [r2 rmse] = rsquare(y,f,c)
%
% RSQUARE computes the coefficient of determination (R-square) value from
% actual data Y and model data F. The code uses a general version of
% R-square, based on comparing the variability of the estimation errors
% with the variability of the original values. RSQUARE also outputs the
% root mean squared error (RMSE) for the user's convenience.
%
% Note: RSQUARE ignores comparisons involving NaN values.
%
% INPUTS
% Y : Actual data
% F : Model fit
%
% OPTION
% C : Constant term in model
% R-square may be a questionable measure of fit when no
% constant term is included in the model.
% [DEFAULT] TRUE : Use traditional R-square computation
% FALSE : Uses alternate R-square computation for model
% without constant term [R2 = 1 - NORM(Y-F)/NORM(Y)]
%
% OUTPUT
% R2 : Coefficient of determination
% RMSE : Root mean squared error
%
% EXAMPLE
% x = 0:0.1:10;
% y = 2.*x + 1 + randn(size(x));
% p = polyfit(x,y,1);
% f = polyval(p,x);
% [r2 rmse] = rsquare(y,f);
% figure; plot(x,y,'b-');
% hold on; plot(x,f,'r-');
% title(strcat(['R2 = ' num2str(r2) '; RMSE = ' num2str(rmse)]))
%
% Jered R Wells
% 11/17/11
% jered [dot] wells [at] duke [dot] edu
%
% v1.2 (02/14/2012)
%
% Thanks to John D'Errico for useful comments and insight which has helped
% to improve this code. His code POLYFITN was consulted in the inclusion of
% the C-option (REF. File ID: #34765).

if isempty(varargin); c = true;
elseif length(varargin)>1; error 'Too many input arguments';
elseif ~islogical(varargin{1}); error 'C must be logical (TRUE||FALSE)'
else c = varargin{1};
end

% Compare inputs
if ~all(size(y)==size(f)); error 'Y and F must be the same size'; end

93
% Check for NaN
tmp = ~or(isnan(y),isnan(f));
y = y(tmp);
f = f(tmp);

if c; r2 = max(0,1 - sum((y(:)-f(:)).^2)/sum((y(:)-mean(y(:))).^2));
else r2 = 1 - sum((y(:)-f(:)).^2)/sum((y(:)).^2);
if r2<0
% http://web.maths.unsw.edu.au/~adelle/Garvan/Assays/GoodnessOfFit.html
warning('Consider adding a constant term to your model')
%#ok<WNTAG>
r2 = 0;
end
end

rmse = sqrt(mean((y(:) - f(:)).^2));

94
APPENDIX D

Simulation Results and Statistical Analysis

D.1 Simulation Results

Time Temp 1 Temp 2 Temp 3


0 23.58306 23.64282 23.65483
1209600 23.60445 23.49234 23.44924
2419200 23.97994 22.87967 22.1495
3628800 23.65148 24.13597 23.54031
4838400 24.25581 22.99172 23.2918
6048000 26.20346 26.20466 26.09612
7257600 26.31361 26.99176 26.81986
8467200 27.48192 26.99172 27.25281
9676800 29.23192 29.08876 29.36588
10886400 30.22895 30.64344 30.7923
12096000 30.19987 30.55036 30.85068

Time pH 1 pH 2 pH 3
0 6.758943 6.729063 6.74268
1209600 6.843442 6.872851 6.926767
2419200 6.901611 7.263789 7.065241
3628800 6.190473 5.739827 5.858941
4838400 5.891832 6.655944 5.416848
6048000 5.556923 7.07706 6.926402
7257600 5.09313 5.159399 4.886551
8467200 6.930695 7.127184 6.90239
9676800 6.943442 6.757937 6.390641
10886400 6.980695 7.089762 7.13565
12096000 6.951611 7.610443 7.946445

Time DO 1 DO 2 DO 3
0 7.628197 7.662857 7.684965
1209600 6.603236 7.489097 7.35746
2419200 6.58578 3.501366 5.26473
3628800 8.343301 8.343418 8.053624
4838400 8.197079 8.240218 7.845481
6048000 7.656159 7.535051 7.113582
7257600 6.462873 6.534535 6.359633
8467200 4.562447 5.693666 4.625674
9676800 4.716579 3.987134 5.09569
10886400 6.925908 7.535377 7.292036
12096000 6.225017 6.251743 6.210554

95
Temperature

pH

96
D.2 Statistical Analysis Using Paired t-Test in Excel

D.2.1. Temperature

t-Test: Paired Two Sample for Means (Day 1)


Actual Theoretical
Mean 23.5 23.515343
Variance 0 0.0064194
Observations 3 3
Pearson Correlation #DIV/0!
Hypothesized Mean Difference 0
df 2
t Stat -0.33169
P(T<=t) one-tail 0.385828
t Critical one-tail 2.919986
P(T<=t) two-tail 0.771656
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 2)


Actual Theoretical
Mean 23 23.00304
Variance 0.25 0.849042
Observations 3 3
Pearson Correlation 0.597042
Hypothesized Mean Difference 0
df 2
t Stat -0.0071
P(T<=t) one-tail 0.49749
t Critical one-tail 2.919986
P(T<=t) two-tail 0.99498
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 3)


Actual Theoretical
Mean 24.66667 23.77592
Variance 0.083333 0.1003167
Observations 3 3
Pearson Correlation -0.64423
Hypothesized Mean Difference 0
df 2
t Stat 2.809982
P(T<=t) one-tail 0.053374
t Critical one-tail 2.919986
P(T<=t) two-tail 0.106749
t Critical two-tail 4.302653

97
t-Test: Paired Two Sample for Means (Day 4)
Actual Theoretical
Mean 22.75 23.51311
Variance 0.0625 0.436214
Observations 3 3
Pearson Correlation -0.7298
Hypothesized Mean 0
Difference
df 2
t Stat -1.53679
P(T<=t) one-tail 0.132078
t Critical one-tail 2.919986
P(T<=t) two-tail 0.264156
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means ( Day 5)


Actual Theoretical
Mean 26.08333 26.16808
Variance 0.023333 0.003884
Observations 3 3
Pearson Correlation 0.17952
Hypothesized Mean Difference 0
df 2
t Stat -0.95148
P(T<=t) one-tail 0.220891
t Critical one-tail 2.919986
P(T<=t) two-tail 0.441782
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 6)


Actual Theoretical
Mean 26.66667 26.70841
Variance 0.333333 0.124288
Observations 3 3
Pearson Correlation 0.969826
Hypothesized Mean 0
Difference
df 2
t Stat -0.28847
P(T<=t) one-tail 0.400069
t Critical one-tail 2.919986
P(T<=t) two-tail 0.800139
t Critical two-tail 4.302653

98
t-Test: Paired Two Sample for Means (Day 7)
Actual Theoretical
Mean 27 27.24215
Variance 0.25 0.060159
Observations 3 3
Pearson Correlation 0.999291
Hypothesized Mean 0
Difference
df 2
t Stat -1.64434
P(T<=t) one-tail 0.120917
t Critical one-tail 2.919986
P(T<=t) two-tail 0.241834
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 8)


Actual Theoretical
Mean 29.16667 969644.9
Variance 0.083333 2.82E+12
Observations 3 3
Pearson Correlation -0.5
Hypothesized Mean 0
Difference
df 2
t Stat -1
P(T<=t) one-tail 0.211325
t Critical one-tail 2.919986
P(T<=t) two-tail 0.42265
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 9)


Actual Theoretical
Mean 30.5 30.5549
Variance 0 0.085221
Observations 3 3
Pearson Correlation #DIV/0!
Hypothesized Mean Difference 0
df 2
t Stat -0.32571
P(T<=t) one-tail 0.387781
t Critical one-tail 2.919986
P(T<=t) two-tail 0.775562
t Critical two-tail 4.302653

99
t-Test: Paired Two Sample for Means (Day 10)
Actual Theoretical
Mean 30.71667 30.53364
Variance 0.285833 0.106098
Observations 3 3
Pearson Correlation 0.972607
Hypothesized Mean 0
Difference
df 2
t Stat 1.374666
P(T<=t) one-tail 0.151495
t Critical one-tail 2.919986
P(T<=t) two-tail 0.30299
t Critical two-tail 4.302653

D.2.2 Dissolved Oxygen

t-Test: Paired Two Sample for Means (Day 1)


Actual Theoretical
Mean 7.678333 7.149931
Variance 0.000133 0.228489
Observations 3 3
Pearson Correlation 0.990475
Hypothesized Mean 0
Difference
df 2
t Stat 1.961589
P(T<=t) one-tail 0.094416
t Critical one-tail 2.919986
P(T<=t) two-tail 0.188832
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 2)


Actual Theoretical
Mean 6.155 5.117292
Variance 0.054025 2.394706
Observations 3 3
Pearson Correlation 0.958531
Hypothesized Mean 0
Difference
df 2
t Stat 1.355125
P(T<=t) one-tail 0.154069
t Critical one-tail 2.919986
P(T<=t) two-tail 0.308138
t Critical two-tail 4.302653

100
t-Test: Paired Two Sample for Means (Day 3)
Actual Theoretical
Mean 8.486667 8.246781
Variance 0.224433 0.027982
Observations 3 3
Pearson Correlation 0.596881
Hypothesized Mean 0
Difference
df 2
t Stat 1.045908
P(T<=t) one-tail 0.202691
t Critical one-tail 2.919986
P(T<=t) two-tail 0.405381
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 4)


Actual Theoretical
Mean 7.996667 8.094259
Variance 0.143633 0.046883
Observations 3 3
Pearson Correlation 0.986288
Hypothesized Mean 0
Difference
df 2
t Stat -0.99874
P(T<=t) one-tail 0.211568
t Critical one-tail 2.919986
P(T<=t) two-tail 0.423136
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 5)


Actual Theoretical
Mean 7.696667 7.434931
Variance 0.222358 0.081116
Observations 3 3
Pearson Correlation 0.807971
Hypothesized Mean 0
Difference
df 2
t Stat 1.541834
P(T<=t) one-tail 0.131526
t Critical one-tail 2.919986
P(T<=t) two-tail 0.263052
t Critical two-tail 4.302653

101
t-Test: Paired Two Sample for Means (Day 6)
Actual Theoretical
Mean 6.583333 6.452347
Variance 0.110833 0.007731
Observations 3 3
Pearson Correlation 0.397646
Hypothesized Mean 0
Difference
df 2
t Stat 0.73498
P(T<=t) one-tail 0.269425
t Critical one-tail 2.919986
P(T<=t) two-tail 0.538851
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 7)


Actual Theoretical
Mean 5.731667 4.960596
Variance 0.590108 0.404043
Observations 3 3
Pearson Correlation -0.5355
Hypothesized Mean 0
Difference
df 2
t Stat 1.084293
P(T<=t) one-tail 0.195773
t Critical one-tail 2.919986
P(T<=t) two-tail 0.391546
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 8)


Actual Theoretical
Mean 4.288333 4.599801
Variance 2.632608 0.317452
Observations 3 3
Pearson Correlation -0.43955
Hypothesized Mean 0
Difference
df 2
t Stat -0.27845
P(T<=t) one-tail 0.403408
t Critical one-tail 2.919986
P(T<=t) two-tail 0.806817
t Critical two-tail 4.302653

102
t-Test: Paired Two Sample for Means (Day 9)
Actual Theoretical
Mean 7.43 7.251107
Variance 0.012225 0.09412
Observations 3 3
Pearson Correlation -0.08901
Hypothesized Mean 0
Difference
df 2
t Stat 0.924279
P(T<=t) one-tail 0.226458
t Critical one-tail 2.919986
P(T<=t) two-tail 0.452916
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 10)


Actual Theoretical
Mean 6.544333 6.229105
Variance 0.158406 0.000437
Observations 3 3
Pearson Correlation -0.80745
Hypothesized Mean 0
Difference
df 2
t Stat 1.315456
P(T<=t) one-tail 0.159461
t Critical one-tail 2.919986
P(T<=t) two-tail 0.318921
t Critical two-tail 4.302653

D.2.3 pH

t-Test: Paired Two Sample for Means (Day 1)


Actual Theoretical
Mean 6.816667 6.88102
Variance 0.000833 0.001786
Observations 3 3
Pearson Correlation -0.16741
Hypothesized Mean 0
Difference
df 2
t Stat -2.02574
P(T<=t) one-tail 0.090023
t Critical one-tail 2.919986
P(T<=t) two-tail 0.180046
t Critical two-tail 4.302653

103
t-Test: Paired Two Sample for Means (Day 2)
Actual Theoretical
Mean 7.1 7.07688
Variance 0.03 0.032895
Observations 3 3
Pearson Correlation 0.836898
Hypothesized Mean 0
Difference
df 2
t Stat 0.394301
P(T<=t) one-tail 0.365715
t Critical one-tail 2.919986
P(T<=t) two-tail 0.731431
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 3)


Actual Theoretical
Mean 5.95 5.929747
Variance 0.0175 0.054531
Observations 3 3
Pearson Correlation 0.557495
Hypothesized Mean 0
Difference
df 2
t Stat 0.180939
P(T<=t) one-tail 0.436546
t Critical one-tail 2.919986
P(T<=t) two-tail 0.873091
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 4)


Actual Theoretical
Mean 5.866667 5.988208
Variance 0.083333 0.390806
Observations 3 3
Pearson Correlation 0.925028
Hypothesized Mean 0
Difference
df 2
t Stat -0.56208
P(T<=t) one-tail 0.315326
t Critical one-tail 2.919986
P(T<=t) two-tail 0.630651
t Critical two-tail 4.302653

104
t-Test: Paired Two Sample for Means (Day 5)
Actual Theoretical
Mean 6.516667 6.520128
Variance 0.385833 0.701498
Observations 3 3
Pearson Correlation 0.99152
Hypothesized Mean 0
Difference
df 2
t Stat -0.02542
P(T<=t) one-tail 0.491016
t Critical one-tail 2.919986
P(T<=t) two-tail 0.982031
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 6)


Actual Theoretical
Mean 5.116667 5.04636
Variance 0.015833 0.020252
Observations 3 3
Pearson Correlation 0.919665
Hypothesized Mean 0
Difference
df 2
t Stat 2.17017
P(T<=t) one-tail 0.081096
t Critical one-tail 2.919986
P(T<=t) two-tail 0.162192
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 7)


Actual Theoretical
Mean 7.016667 6.986756
Variance 0.013333 0.01499
Observations 3 3
Pearson Correlation -0.39654
Hypothesized Mean 0
Difference
df 2
t Stat 0.260547
P(T<=t) one-tail 0.409407
t Critical one-tail 2.919986
P(T<=t) two-tail 0.818815
t Critical two-tail 4.302653

105
t-Test: Paired Two Sample for Means (Day 8)
Actual Theoretical
Mean 6.6 6.69734
Variance 0.07 0.079151
Observations 3 3
Pearson Correlation 0.86727
Hypothesized Mean 0
Difference
df 2
t Stat -1.19096
P(T<=t) one-tail 0.177925
t Critical one-tail 2.919986
P(T<=t) two-tail 0.35585
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 9)


Actual Theoretical
Mean 7.033333 7.068702
Variance 0.000833 0.006335
Observations 3 3
Pearson Correlation -0.22914
Hypothesized Mean 0
Difference
df 2
t Stat -0.67562
P(T<=t) one-tail 0.284465
t Critical one-tail 2.919986
P(T<=t) two-tail 0.568931
t Critical two-tail 4.302653

t-Test: Paired Two Sample for Means (Day 10)


Actual Theoretical
Mean 7.494333 7.502833
Variance 0.284946 0.256109
Observations 3 3
Pearson Correlation 0.997544
Hypothesized Mean 0
Difference
df 2
t Stat -0.32154
P(T<=t) one-tail 0.389146
t Critical one-tail 2.919986
P(T<=t) two-tail 0.778292
t Critical two-tail 4.302653

106
APPENDIX E

DENR- Administrative Order No. 2016-08

Effluent Standards

Parameter Unit Water Body Classification


AA A B C D SA SB SC SD
Ammonia as NH3-N mg/L NDA 0.5 0.5 0.5 0.75 NDA 0.5 0.5 7.5
BOD mg/L NDA 20 30 50 120 NDA 30 100 150
Boron mg/L NDA 2 2 3 12 NDA 2 20 80
Chloride mg/L NDA 350 350 450 500 NDA n/a n/a n/a
COD mg/L NDA 60 60 100 200 NDA 60 200 300
Color TCU NDA 100 100 150 300 NDA 100 150 300
Cyanide as Free Cyanide mg/L NDA 0.14 0.14 0.2 0.4 NDA 0.04 0.2 0.4
Fluoride mg/L NDA 2 2 2 4 NDA 3 3 6
Nitrate as NO3-N mg/L NDA 14 14 14 30 NDA 20 20 30
pH(Range) mg/L NDA 6.0-9.0 6.0-9.0 6.0-9.5 5.5-9.5 NDA 6.5-9.0 6.0-9.0 5.5-9.5
Phosphate mg/L NDA 1 1 1 10 NDA 1 1 10
Selenium mg/L NDA 0.02 0.02 0.04 0.08 NDA 0.02 0.2 0.4
Sulfate mg/L NDA 500 500 550 1000 NDA 500 550 1000
Surfactants (MBAS) mg/L NDA 2 3 15 30 NDA 3 15 30
Temperature °C Change NDA 3 3 3 3 NDA 3 3 3
Total Suspended Solids mg/L NDA 70 85 100 150 NDA 70 100 150

107
APPENDIX F

LETTERS

108
109
110
APPENDIX F

DOCUMENTATION

Figure 24: First discharge for the chosen boundary. A continuous flowing water coming from the residential
houses.

Figure 25: Second discharge located upstream. A pipe projected directly to the river coming from residential
houses which produces a dark fluid with an awlful smell.

Figure 26: A photo of the group measuring the width of the river (left side) and the its length on the land area
(right side).

111
Figure 27: Labelled plastic bottles for the sample collection. From boundary 1 to boundary 7
and inner boundary 1 to inner boundary 3 with two replicates.

Figure 28: Sample collection from the chosen sampling points. The sampling bottles was
cupped under water to prevent air bubbles.

Figure 29: Analysing the samples using chemical test for the parameters pH and DO. Photo
taken at Bureau of Fisheries and Aquatic Resources (BFAR) laboratory.

112
Figure 30: On-site water analysis using the equipment devices (Thermometer, pH meter, and
DO meter).

Figure 31: On-site chemical testing of pH at different sampling points.

Figure 32: Measuring of water depth at different points.

113
Figure 33: Setting up for the Measuring of velocity using a table tennis ball and timer.

Figure 34: On-site sampling at the center of the river.

Figure 35: Photo taken during the last data collection with the boat owner Lyafayeth Tasi.

114
Figure 36: Photo taken at the Laboratory of BFAR with ma'am Divine.

115