knitr::opts_chunk$set(echo = TRUE)
In my lab, I was working with monoprotic acids and I wanted to use my lab data to create a graph for my monoprotic data that would allow me to visualize and understand how the titration of a monoprotic acid looks. In theory, monoprotic acids are acids that only have one proton that they are capable of donating, such as HCl, which has a single proton it can donate. In the titration of these molecules, since they only have one donatable atom, they must also have a single equivalence point.
Mydata <- read.csv("phFrac.csv")
Mydata
## Volume pH X
## 1 0.00 2.972 NA
## 2 3.00 3.937 NA
## 3 6.00 4.324 NA
## 4 9.00 4.590 NA
## 5 11.80 4.845 NA
## 6 15.20 5.176 NA
## 7 17.40 5.488 NA
## 8 18.40 5.716 NA
## 9 18.90 5.870 NA
## 10 19.50 6.177 NA
## 11 20.00 6.748 NA
## 12 20.30 7.990 NA
## 13 20.40 9.900 NA
## 14 20.50 10.181 NA
## 15 20.89 10.860 NA
volume <- Mydata$Volume
pH <- Mydata$pH
volume
## [1] 0.00 3.00 6.00 9.00 11.80 15.20 17.40 18.40 18.90 19.50 20.00 20.30
## [13] 20.40 20.50 20.89
pH
## [1] 2.972 3.937 4.324 4.590 4.845 5.176 5.488 5.716 5.870 6.177
## [11] 6.748 7.990 9.900 10.181 10.860
plot(volume,pH,main="Volume of NaOH vs. pH of Solution",xlab="Volume (mL)",
ylab="pH",xlim=c(0,25),ylim=c(0,12))
H <- 10^(-pH)
tbase <- 0.10
Vini <- 25
Vend <- 21.5
fbound <- 1-(tbase*volume + H*(Vini+Vend))/(tbase*Vend)
fbound
## [1] 0.97693176 0.85796469 0.71990455 0.58083943 0.45085375 0.29287904
## [7] 0.19062736 0.14414445 0.12090106 0.09300887 0.06976358 0.05581373
## [13] 0.05116279 0.04651163 0.02837209
plot(pH,fbound,xlim=c(0,11.59),main="Binding Analysis of Monoprotic Titration")
library(nls2)
## Loading required package: proto
fit <- nls2(fbound ~ H/(KD+H), start=c(KD=0.0001))
summary(fit)
##
## Formula: fbound ~ H/(KD + H)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## KD 1.665e-05 1.313e-06 12.68 4.6e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03891 on 14 degrees of freedom
##
## Number of iterations to convergence: 7
## Achieved convergence tolerance: 2.201e-06
lines(pH,predict(fit), col="red")
Using R programming, I took data from my lab and plotted pH vs. volume of NaOH added for the titration of an acid. I then went on to plot the fractional amount of the acid left as more NaOH was added. The fit of the fractional amount of acid left indicated a strong correlation.
After having plotted my data I went on to attempt to plot the titration of a diprotic acid. The process for plotting diprotic data was similar to the monoprotic titration, however, unlike monoprotic acids, diprotic acids can donate two protons when reacting with bases. They do this by donating one proton first, and then a second one through a two part reaction. When graphed, this results in two equivalence points where the first equivalence point is very subtle while the second equivalence point is significantly more noticeable.
Mydata <- read.csv("diprotic1.csv")
Mydata
## pH Vol
## 1 2.10 0.000
## 2 2.10 0.005
## 3 2.10 0.010
## 4 2.10 0.023
## 5 2.10 0.054
## 6 2.11 0.132
## 7 2.11 0.328
## 8 2.12 0.528
## 9 2.20 0.728
## 10 2.20 0.928
## 11 2.26 1.128
## 12 2.26 1.328
## 13 2.32 1.528
## 14 2.32 1.728
## 15 2.34 1.928
## 16 2.41 2.128
## 17 2.42 2.328
## 18 2.48 2.528
## 19 2.49 2.728
## 20 2.55 2.928
## 21 2.56 3.129
## 22 2.61 3.329
## 23 2.62 3.529
## 24 2.68 3.729
## 25 2.69 3.929
## 26 2.76 4.129
## 27 2.76 4.329
## 28 2.83 4.529
## 29 2.84 4.729
## 30 2.91 4.929
## 31 2.91 5.129
## 32 2.99 5.329
## 33 3.00 5.529
## 34 3.08 5.729
## 35 3.09 5.929
## 36 3.19 6.129
## 37 3.20 6.329
## 38 3.31 6.529
## 39 3.31 6.729
## 40 3.44 6.929
## 41 3.45 7.129
## 42 3.62 7.329
## 43 3.62 7.529
## 44 3.82 7.729
## 45 3.83 7.877
## 46 4.04 8.078
## 47 4.04 8.222
## 48 4.25 8.422
## 49 4.25 8.568
## 50 4.43 8.768
## 51 4.52 8.968
## 52 4.53 9.168
## 53 4.68 9.368
## 54 4.70 9.568
## 55 4.81 9.768
## 56 4.83 9.968
## 57 4.92 10.168
## 58 4.98 10.369
## 59 4.98 10.569
## 60 5.07 10.769
## 61 5.08 10.969
## 62 5.16 11.169
## 63 5.17 11.369
## 64 5.25 11.569
## 65 5.26 11.769
## 66 5.27 11.969
## 67 5.37 12.169
## 68 5.38 12.369
## 69 5.46 12.569
## 70 5.47 12.769
## 71 5.53 12.969
## 72 5.55 13.169
## 73 5.63 13.369
## 74 5.64 13.569
## 75 5.71 13.769
## 76 5.72 13.969
## 77 5.74 14.169
## 78 5.87 14.369
## 79 5.87 14.569
## 80 5.97 14.769
## 81 5.99 14.969
## 82 6.09 15.169
## 83 6.10 15.369
## 84 6.23 15.569
## 85 6.31 15.769
## 86 6.32 15.969
## 87 6.51 16.169
## 88 6.52 16.346
## 89 6.76 16.546
## 90 6.77 16.656
## 91 7.07 16.856
## 92 7.08 16.928
## 93 7.39 17.110
## 94 7.42 17.164
## 95 7.60 17.300
## 96 7.61 17.390
## 97 8.30 17.590
## 98 8.34 17.603
## 99 8.36 17.636
## 100 8.65 17.718
## 101 8.66 17.730
## 102 8.67 17.762
## 103 8.86 17.842
## 104 8.87 17.869
## 105 8.96 17.939
## 106 8.98 18.033
## 107 9.28 18.233
## 108 9.30 18.303
## 109 9.49 18.476
## 110 9.50 18.607
volume <- Mydata$Vol ## Volume vector
pH <- Mydata$pH ## pH vector
plot(volume,pH,main="Volume of NaOH vs. pH of Solution",xlab="Volume (mL)",
ylab="pH")
#It's notable that around a volume of 20 mL, the slope of the titration reaches its steepest point, indicating the equivalence point.
H <- 10^-(pH) ## H+ from pH
Vini <- 25 ## Initial Volume
Vend <- 9.3025 ## Volume added in endpoint
tbase <- 0.10 ## [Base]
Fb <- (2-(((volume*tbase)+((H)*(Vini+volume)))/(Vend*tbase)))
library(nls2)
fit <- nls2(Fb~(H/KD1+2*H^2/(KD1*KD2))/(1+H/KD1+H^2/(KD1*KD2))
,start = c(KD1=0.001,KD2=0.000001))
summary(fit)
##
## Formula: Fb ~ (H/KD1 + 2 * H^2/(KD1 * KD2))/(1 + H/KD1 + H^2/(KD1 * KD2))
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## KD1 1.607e-06 8.623e-08 18.63 <2e-16 ***
## KD2 1.809e-03 8.417e-05 21.50 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06178 on 108 degrees of freedom
##
## Number of iterations to convergence: 16
## Achieved convergence tolerance: 2.269e-06
plot(pH,Fb)
lines(pH,predict(fit),col="hotpink")
Having graphed the data and then finding the fraction bound displays a very good fit. Viewing this graph, it’s easy to notice that there are two equivalence points in the titration, confirming that this was a titration of a diprotic acid. The plot of the fraction bound is a good indicator of the pH at each equivalence point. The first equivalence point is indicated at a pH of 4 where the decrease in acid stops or slows down for a moment and again around pH 8 where the decrease also steadies. This makes sense because at the equivalence point there is a moment of equilibrium achieved that causes the rate of reaction to stagnate for a moment. In addition, data from the lab also indicated an equivalence point at pH 4 and 8. Based on these evidences, it’s obvious that graphing the plot of a diprotic titration using R program can be a significant way to analyze titration data.