Exercise 1: Explore the content of the data and first plot


This represents experimental data from Mr. Marc Horstman used to measure nitrate concentrations in intact sediment taken from the field. In this experiment, 10 cm of water infused with nitrate was circulated at different velocities, and the concentrations of nitrate were measured over time.


data<-read.csv(file="infreq_Exp06_Rep2_U0.csv",header = TRUE) #Reads file into table format
timeday <- data$time/3600/24
conc <- data$conc
xlimtime <- range(0,1)
ylimconc <- range(0,1)
plot(timeday,conc,
     xlim = xlimtime, ylim = ylimconc,
     xlab = "time in days", ylab = "nitrate concentrations (mg N/L)",
     main = "Concentration of Nitrate Over Time",pch = 21, col = "red", bg= "orange")



Exercise 2 : Fitting a first order rate model for nitrate removal in a wetland

The equation to find the final concentration of nitrate is shown below and was fully worked out in lab. This shows the affect of water depth, initial concentration, time, and the mass transfer coefficient on the final concentration.

\[ C(t)=C_0e^{-\frac{\rho}{D}(t-t_0)} \] However, this equation is more difficult to use due to it being exponential, so we can plot it in a way we are more comfortable with by finding ln(Ct/C0).

\[ \ln{\frac{C(t)}{C_0}} = -\frac{\rho}{D}(t-t_0) \]

We can assign new variable to this new efficient equation to get it in a linear form that can be easily plotted.

\[ Z=K*(t-t_0) \] Where: \[ K=-\frac{\rho}{D} \] \[ Z=\ln{\frac{C(t)}{C_0}} \]

data<-read.csv(file="infreq_Exp06_Rep2_U0.csv",header = TRUE) #Reads file into table format
timeday <- data$time/3600/24 -7500/3600/24
conc <- log(data$conc/1.087)
xlimtime <- range(0,1)
ylimconc <- range(conc)
plot(timeday,conc,
     xlim = xlimtime, ylim = ylimconc,
     xlab = "time since beginning in days", ylab = "Natural Log of Co/C",
     main = "ln(Co/C) over time",pch = 21, col = "red", bg= "red")



As can be noted, the graph is mostly linear. In this graph, K would be a constant that helps the equation start at the origin, and makes up for any initial differences between the ln equation and our real-world values.

Exercise 3 : Fitting a first order rate model by calculating mass transfer coefficient

Since the plot that we just found of ln uses K, and in it rho, we can rewrite that equation to solve for the mass transfer coefficient.

\[ \rho=-K*D \]

x=data$time/3600/24 -7500/3600/24
y=log(data$conc/1.087)
plot(x,y)
linreg <- lm(y~x+0)
names(linreg)
##  [1] "coefficients"  "residuals"     "effects"       "rank"         
##  [5] "fitted.values" "assign"        "qr"            "df.residual"  
##  [9] "xlevels"       "call"          "terms"         "model"
##  [1] "coefficients"  "residuals"     "effects"       "rank"         
##  [5] "fitted.values" "assign"        "qr"            "df.residual"  
##  [9] "xlevels"       "call"          "terms"         "model"
linreg$coefficients
##         x 
## -1.599243
abline(linreg)

rho = linreg$coefficients*(-0.1)
print(rho)
##         x 
## 0.1599243
######## Add below 



The value that I calculated for rho is 0.16 m/day.

Exercice 4: Treatment time for stagnant water

To calculate the length of time needed to decrease nitrate concentrations from 7 mg N/L to .3 mg N/L, you would use the equation that we found in the previous example to solve for t. In this example, C(t) is equal to our goal concentration of .3 mg N/L,t0 is equivalent to zero, rho was just solved for and is 0.160, Ci is the inital oncentration 7 mg N/L, and D is the water depth which is 10 cm.

\[ ln{\frac{C(t)}{C_0}}*({-\frac{D}{\rho}})=t-t_0 \]

## [1] 1.968677

If the wetland has stagnant water, it will take 1.97 days for the Nitrogen concentration to go from 7 mg N/L to 0.3 mg N/L.

\[ RP={\frac{C_i-C_f}{C_i}} \]

\[ = \] \[ RP ={\frac{C_0-C_0e^{-\frac{\rho}{D}(t-t_0)}}{C_0}} \]

\[ = \]

\[ RP (percentage) = (1-e^{-\frac{\rho}{D}(t-t_0)})*100 \]

## [1] 79.81033

In this example with 10 cm of stagnant water, using t = 1 day the removal percentage of the wetland is 80 %. This means that in one day, 80% of the Nitrate Concentration in the water is treated. This percentage is expected to be higher if the water had be circulated instead.

Exercise 5: Treatment time for water recirculated at 3 cm/s

data2<-read.csv(file="https://raw.githubusercontent.com/francoisbirgand/BAE204-removal_kinetics_lab/master/Exp03_Rep3_U3.csv",header = TRUE) #Reads file into table format
data2<-read.csv(file="Exp03_Rep3_U3.csv",header = TRUE) #Reads file into table format
timeday2 <- data2$time/(3600*24)
conc2 <- data2$conc
xlimtime2 <- range(timeday2)
ylimconc2 <- range(conc2)
plot(timeday2,conc2,
     xlim = xlimtime2, ylim = ylimconc2,
     xlab = "Time in days", ylab = "Nitrate Concentrations (mg N/L)",
      main = "Concentration of Nitrate Over Time",pch = 21, col = "blue", bg= "blue")

D = 0.1
C_02 = conc2[1]
t_02 = timeday2[1]
x2 <- (timeday2-t_02)
y2 <- log(conc2/C_02)
linreg2 = lm(y2~x2+0)
k2 = linreg2$coefficients
rho2 = -k2*D
plot(x2,y2, abline(linreg2),
     xlab= "Time (Days)", ylab = "ln(concentration)",
         main = "ln(Co/C) over time",pch = 21, col = "green", bg= "green")

print(rho2)
##        x2 
## 0.3702087

If the water was moving at 3 cm/s, the rho value would be 0.37 m/day.

\[ ln{\frac{C(t)}{C_0}}*({-\frac{D}{\rho}})=t-t_0 \]

##        x2 
## 0.8508399

If the water was moving at 3 cm/s, it would take 0.85 days to bring the nitrate concentration from 7 to 0.3 mg N/L.

##       x2 
## 97.53279

When the water is moving at 3cm/s, the removal percentage is 98%.

This study was exploring the effect of velocity on certain qualities of nitrate management in a wetland. By having water move at 3 cm/s, the mass transfer coefficient (rho) more than doubled from its value in stagnant water. Similar equations to before were also used to explore the new amount of time our system could change nitrate concentrations from 7 mg N/L to 0.3 mg N/L. This was found to be less than half of the time that was needed during stagnant water conditions. The removal percentage was found to discover how much existing nitrate can be removed by our system at the velocity, which is 98%.



Exercise 6: Discuss your observations

In this experiment, we used data to measure nitrate concentrations in 10 cm of water over time in stagnant water and water moving at 0.3 cm/s. After testing, we found that the mass transfer coefficient (rho) was 0.16 in stagnant water and 0.37 in water with a velocity of 0.3 cm/s. It also took stagnant water 1.97 days to reduce nitrate concentrations from 7 mg N/L to 0.3 mg N/L, while it only took 0.85 days to reduce the same nitrate concentrations in the moving water. The removal percentages were also different, with an RP value of 80% in stagnant water and 98% in moving water.

When we changed the water from stagnant to having velocity, the nitrate-rich water is constantly moving, subjecting more nitrate to the denitrification process as it churns up soil and creates gradient pumps. This recirculation also ensure that the concentration gradient of nitrate is constant, and nitrate is moved from the water column into the soil at a steady rate. This happens because nitrate is reduced in the anaerobic layer of the soil, turning into dinitrogen which goes back into the atmosphere. This usage of nitrate creates a demand in the anaerobic soil layer, which is supplied by a gradient of nitrate from the water column.

Recirculation increases both Dw and Dn as well, as an increase in the velocity from 0 to 0.3 cm/s increases the amount of nitrate of all forms which gets processed. Because the mass transfer rate (expressed by rho) increases with this amount of circulation, more nitrate will be treated from both the water column and from nitrate that has been previously uptaken by plants in the system. This increase in mass transfer of nitrate means that more nitrate can be reduced in a smaller amount of time, and that the removal percentage for the same amount of time is larger. Recirculation is a very impactful way to make a wetland treatment system more effective and efficient.

When the wetland has water that is recirculated, the first-order kinetics is a decent fit, but not perfect. First-order kinetics assumes the removal rate depends on nitrate concentration, but, in this case, mass transfer plays a big role. This is not full accounted for with a first-order kinetics and can affect the accuracy of our data. This may lead to results that overshoot a wetlands capacity, which is an important error that is often compounded with things like a lack of maintenance, giving a real treatment wetland a much smaller effectiveness than projected.