Introduction

Titration is a method used in many areas of research to determine an unknown compound by using a known compound and analytical analysis. In this report, data was collected from the diprotic acid lab report completed in the lab section of the class. This report shows how we can convert titration data into a binding curve to determine pka1 and pka2 values to compare with experimental and theoretical values of the diprotic acid.

Inputting titration data into R and converting pH and volume data to vectors.

The pH data obtained from titration lab was uploaded into R below:

pH <-read.csv("data3.csv")
pH   
##       V1
## 1   2.17
## 2   2.17
## 3   2.16
## 4   2.16
## 5   2.17
## 6   2.18
## 7   2.21
## 8   2.23
## 9   2.25
## 10  2.28
## 11  2.30
## 12  2.33
## 13  2.36
## 14  2.38
## 15  2.41
## 16  2.45
## 17  2.47
## 18  2.50
## 19  2.54
## 20  2.57
## 21  2.60
## 22  2.64
## 23  2.67
## 24  2.71
## 25  2.74
## 26  2.78
## 27  2.82
## 28  2.86
## 29  2.91
## 30  2.96
## 31  3.00
## 32  3.05
## 33  3.11
## 34  3.17
## 35  3.23
## 36  3.30
## 37  3.38
## 38  3.46
## 39  3.55
## 40  3.66
## 41  3.78
## 42  3.91
## 43  4.05
## 44  4.19
## 45  4.32
## 46  4.43
## 47  4.54
## 48  4.63
## 49  4.71
## 50  4.79
## 51  4.86
## 52  4.92
## 53  4.99
## 54  5.04
## 55  5.10
## 56  5.16
## 57  5.21
## 58  5.25
## 59  5.30
## 60  5.35
## 61  5.40
## 62  5.45
## 63  5.50
## 64  5.54
## 65  5.59
## 66  5.64
## 67  5.69
## 68  5.73
## 69  5.79
## 70  5.84
## 71  5.89
## 72  5.95
## 73  6.02
## 74  6.08
## 75  6.16
## 76  6.24
## 77  6.33
## 78  6.43
## 79  6.54
## 80  6.71
## 81  6.92
## 82  7.18
## 83  7.35
## 84  7.36
## 85  7.75
## 86  7.99
## 87  8.01
## 88  8.12
## 89  8.13
## 90  8.38
## 91  8.49
## 92  8.55
## 93  8.74
## 94  8.76
## 95  8.95
## 96  8.97
## 97  8.99
## 98  9.21
## 99  9.23
## 100 9.24

The uploaded pH data was analyzed to extract a vector from the dataframe column as follows:

pHVect <- pH$V1   # this extracts a vector from dataframe column
pHVect
##   [1] 2.17 2.17 2.16 2.16 2.17 2.18 2.21 2.23 2.25 2.28 2.30 2.33 2.36 2.38 2.41
##  [16] 2.45 2.47 2.50 2.54 2.57 2.60 2.64 2.67 2.71 2.74 2.78 2.82 2.86 2.91 2.96
##  [31] 3.00 3.05 3.11 3.17 3.23 3.30 3.38 3.46 3.55 3.66 3.78 3.91 4.05 4.19 4.32
##  [46] 4.43 4.54 4.63 4.71 4.79 4.86 4.92 4.99 5.04 5.10 5.16 5.21 5.25 5.30 5.35
##  [61] 5.40 5.45 5.50 5.54 5.59 5.64 5.69 5.73 5.79 5.84 5.89 5.95 6.02 6.08 6.16
##  [76] 6.24 6.33 6.43 6.54 6.71 6.92 7.18 7.35 7.36 7.75 7.99 8.01 8.12 8.13 8.38
##  [91] 8.49 8.55 8.74 8.76 8.95 8.97 8.99 9.21 9.23 9.24

The length of the pHvector was determined:

length(pHVect)
## [1] 100

The volume(ml) obtained from the titration lab was also uploaded into R below:

Vol <- read.csv("data4.csv")
Vol    
##         V2
## 1    0.005
## 2    0.010
## 3    0.023
## 4    0.054
## 5    0.132
## 6    0.328
## 7    0.528
## 8    0.728
## 9    0.928
## 10   1.128
## 11   1.328
## 12   1.528
## 13   1.728
## 14   1.928
## 15   2.128
## 16   2.328
## 17   2.528
## 18   2.728
## 19   2.928
## 20   3.129
## 21   3.329
## 22   3.529
## 23   3.729
## 24   3.929
## 25   4.129
## 26   4.329
## 27   4.529
## 28   4.729
## 29   4.929
## 30   5.129
## 31   5.329
## 32   5.529
## 33   5.729
## 34   5.929
## 35   6.129
## 36   6.329
## 37   6.529
## 38   6.729
## 39   6.929
## 40   7.129
## 41   7.329
## 42   7.529
## 43   7.729
## 44   7.929
## 45   8.129
## 46   8.329
## 47   8.529
## 48   8.729
## 49   8.929
## 50   9.129
## 51   9.329
## 52   9.529
## 53   9.730
## 54   9.930
## 55  10.130
## 56  10.330
## 57  10.530
## 58  10.730
## 59  10.930
## 60  11.130
## 61  11.330
## 62  11.530
## 63  11.730
## 64  11.930
## 65  12.130
## 66  12.330
## 67  12.530
## 68  12.730
## 69  12.930
## 70  13.130
## 71  13.330
## 72  13.530
## 73  13.730
## 74  13.930
## 75  14.130
## 76  14.330
## 77  14.530
## 78  14.730
## 79  14.930
## 80  15.130
## 81  15.330
## 82  15.487
## 83  15.554
## 84  15.614
## 85  15.654
## 86  15.755
## 87  15.767
## 88  15.772
## 89  15.785
## 90  15.816
## 91  15.821
## 92  15.826
## 93  15.839
## 94  15.870
## 95  15.875
## 96  15.881
## 97  15.895
## 98  15.930
## 99  15.935
## 100 15.948

The uploaded volume data was analyzed to extract a vector from the dataframe column as follows:

VolVect <- Vol$V2    # this extracts a vector from dataframe column
VolVect
##   [1]  0.005  0.010  0.023  0.054  0.132  0.328  0.528  0.728  0.928  1.128
##  [11]  1.328  1.528  1.728  1.928  2.128  2.328  2.528  2.728  2.928  3.129
##  [21]  3.329  3.529  3.729  3.929  4.129  4.329  4.529  4.729  4.929  5.129
##  [31]  5.329  5.529  5.729  5.929  6.129  6.329  6.529  6.729  6.929  7.129
##  [41]  7.329  7.529  7.729  7.929  8.129  8.329  8.529  8.729  8.929  9.129
##  [51]  9.329  9.529  9.730  9.930 10.130 10.330 10.530 10.730 10.930 11.130
##  [61] 11.330 11.530 11.730 11.930 12.130 12.330 12.530 12.730 12.930 13.130
##  [71] 13.330 13.530 13.730 13.930 14.130 14.330 14.530 14.730 14.930 15.130
##  [81] 15.330 15.487 15.554 15.614 15.654 15.755 15.767 15.772 15.785 15.816
##  [91] 15.821 15.826 15.839 15.870 15.875 15.881 15.895 15.930 15.935 15.948

The length of the volume vector was determined:

length(VolVect)
## [1] 100

Finding the hydrogen ion concentration for each data point

Using the pH data obtained, the hydrogen ion concentration was calculated for every data point as follows:

H <- 10^-(pHVect)        # convert pH  to H+
H
##   [1] 6.760830e-03 6.760830e-03 6.918310e-03 6.918310e-03 6.760830e-03
##   [6] 6.606934e-03 6.165950e-03 5.888437e-03 5.623413e-03 5.248075e-03
##  [11] 5.011872e-03 4.677351e-03 4.365158e-03 4.168694e-03 3.890451e-03
##  [16] 3.548134e-03 3.388442e-03 3.162278e-03 2.884032e-03 2.691535e-03
##  [21] 2.511886e-03 2.290868e-03 2.137962e-03 1.949845e-03 1.819701e-03
##  [26] 1.659587e-03 1.513561e-03 1.380384e-03 1.230269e-03 1.096478e-03
##  [31] 1.000000e-03 8.912509e-04 7.762471e-04 6.760830e-04 5.888437e-04
##  [36] 5.011872e-04 4.168694e-04 3.467369e-04 2.818383e-04 2.187762e-04
##  [41] 1.659587e-04 1.230269e-04 8.912509e-05 6.456542e-05 4.786301e-05
##  [46] 3.715352e-05 2.884032e-05 2.344229e-05 1.949845e-05 1.621810e-05
##  [51] 1.380384e-05 1.202264e-05 1.023293e-05 9.120108e-06 7.943282e-06
##  [56] 6.918310e-06 6.165950e-06 5.623413e-06 5.011872e-06 4.466836e-06
##  [61] 3.981072e-06 3.548134e-06 3.162278e-06 2.884032e-06 2.570396e-06
##  [66] 2.290868e-06 2.041738e-06 1.862087e-06 1.621810e-06 1.445440e-06
##  [71] 1.288250e-06 1.122018e-06 9.549926e-07 8.317638e-07 6.918310e-07
##  [76] 5.754399e-07 4.677351e-07 3.715352e-07 2.884032e-07 1.949845e-07
##  [81] 1.202264e-07 6.606934e-08 4.466836e-08 4.365158e-08 1.778279e-08
##  [86] 1.023293e-08 9.772372e-09 7.585776e-09 7.413102e-09 4.168694e-09
##  [91] 3.235937e-09 2.818383e-09 1.819701e-09 1.737801e-09 1.122018e-09
##  [96] 1.071519e-09 1.023293e-09 6.165950e-10 5.888437e-10 5.754399e-10

The length of the hydrogen ion concentration vector was determined as follows:

length(H)
## [1] 100

Plotting a titration curve

Using all the pH and volume data, a titration curve was plotted as follows:

plot(VolVect,pHVect,main = "Titration curve for Fast Titration ", xlab = "NAOH Volume", ylab = "pH", xlim = c(0,16.0), ylim =c(2,10.0), sub = "Figure 1")

Experimental pka1 and pka2 values:analyzed in the lab

From the titration curve and the 1st and 2nd equivalence point analyzed to be 7.905 and 15.810 respectively, calculations were performed to determine the pka1 and pka2. As such, the experimental pka1 was 2.72 and pka2 was 5.45.

Defining data for conversion of titration data to binding curve

Inorder to create a binding curve equation, the hydrogen ion concentration was renamed as being the ligand to efficiently work well in the binding equation:

L <- H

The Volume added at the 1st endpoint:

VE=7.905
VE
## [1] 7.905

The Initial volume of unknown diprotic acid:

VI=25
VI
## [1] 25

The concentration of the base NaOH:

CB=0.10
CB
## [1] 0.1

VA is the volume added in the titration. Here, we rename the VolVect to VA to use in the binding equation.

VA <- VolVect

Fraction bound calculation

In biochemistry, we learn of the occupancy in regards to a binding curve. The occupancy or fraction bound is the degree to which a binding site is filled. Here we refer to occupancy as fraction bound and we calculate it as follows:

F<-(2-(((VA*CB)+((H)*(VI+VA)))/(VE*CB)))
F
##   [1]  1.7855097432  1.7848344691  1.7780937839  1.7739009090  1.7683577819
##   [6]  1.7468179171  1.7340868158  1.7162584495  1.6981608364  1.6838435253
##  [11]  1.6650821317  1.6497396859  1.6338115729  1.6140991934  1.5972926414
##  [16]  1.5828419949  1.5622049092  1.5439802214  1.5277100167  1.5083995161
##  [21]  1.4888561281  1.4708966942  1.4505736713  1.4316166294  1.4106185119
##  [26]  1.3907981981  1.3705326374  1.3498577561  1.3298915698  1.3093791378
##  [31]  1.2875028463  1.2661492728  1.2450938676  1.2235160400  1.2014799315
##  [36]  1.1795044974  1.1574402596  1.1348493188  1.1120824606  1.0892738022
##  [41]  1.0660780790  1.0425022881  1.0185743514  0.9942744152  0.9696576172
##  [46]  0.9447965974  0.9198393587  0.8947619419  0.8696248415  0.8444610910
##  [51]  0.8192613888  0.7940352563  0.7686838841  0.7434300248  0.7181795730
##  [56]  0.6929229299  0.6676545526  0.6423770720  0.6171030024  0.5918262027
##  [61]  0.5665469547  0.5412655113  0.5159820994  0.4906938554  0.4654074146
##  [66]  0.4401195217  0.4148303271  0.3895379424  0.3642485575  0.3389562117
##  [71]  0.3136630252  0.2883703588  0.2630778155  0.2377831998  0.2124894733
##  [76]  0.1871946464  0.1618994439  0.1366037178  0.1113073802  0.0860116069
##  [81]  0.0607149289  0.0408568312  0.0323822752  0.0247921912  0.0197334308
##  [86]  0.0069570942  0.0054390912  0.0048066929  0.0031621729 -0.0007592285
##  [91] -0.0013916915 -0.0020241810 -0.0036686582 -0.0075902227 -0.0082227019
##  [96] -0.0089817126 -0.0107527411 -0.0151802976 -0.0158128072 -0.0174573353

The length of the fraction bound data set was found as follows:

length(F)
## [1] 100

Binding curve

plot(pHVect,F,main = "Binding curve", xlab = "pH", ylab = "F", xlim = c(2,10.0), ylim =c(-0.1,1.8), sub = "Figure 2")

The main difference between the titration curve and the binding curve is that they are flipped; ka1 and ka2 values are reversed as we will see when doing an nls2 fit.

Performing nls2 to determine pka1 and pka2

library(nls2)
## Loading required package: proto
tryfit <- nls2(F ~ (L/KD1 + 2*L^2/(KD1*KD2))/(1+L/KD1 + L^2/(KD1*KD2) ),
               start = c(KD1 = 0.0001,KD2=0.01))

tryfit
## Nonlinear regression model
##   model: F ~ (L/KD1 + 2 * L^2/(KD1 * KD2))/(1 + L/KD1 + L^2/(KD1 * KD2))
##    data: <environment>
##       KD1       KD2 
## 2.940e-06 2.426e-03 
##  residual sum-of-squares: 0.02522
## 
## Number of iterations to convergence: 7 
## Achieved convergence tolerance: 3.722e-06

Determination of pka1 and pka2 from nls2 summary

pka1 from binding curve:

-log(2.49e-03,base=10)  
## [1] 2.603801

pka2 from binding curve:

-log(2.98e-06,base=10)  
## [1] 5.525784

Theoretical pka1 and pka2 value of the diprotic acid.

The unknown diprotic acid analyzed was identified as malonic acid from calculations of its molecular mass. According to the National Library of medicine,the theoretical pka1 value of malonic acid is 2.8 and it’s pka2 is 5.7.

Creating a table of pka values

data= matrix(c(2.72,2.60381,2.8,5.45,5.525784,5.7), ncol=3, byrow=TRUE)
 
colnames(data) = c('Titration curve','Binding curve','Theoretical values')
rownames(data) <- c('pka1','pka2')
final=as.table(data)
final
##      Titration curve Binding curve Theoretical values
## pka1        2.720000      2.603810           2.800000
## pka2        5.450000      5.525784           5.700000

Discussion

When analyzing the table of pka values above, we can see that there is a significant difference among the pka1 and pka2 values. The percentage error between the titration curve pka1 and the theoretical value of pka1 is:

X<-2.72 #Titration curve pka1
Y<-2.8  #Theoretical value pka1
E<-((Y-X)/(Y))*(100)
E
## [1] 2.857143

As we can see from the calculations above, there is a 2.857143% error between titration curve pka1 and the theoretical value of pka1.

The percentage error between the titration curve pka2 and the theoretical value of pka2 is:

X1<-5.45 #Titration curve pka2
Y1<-5.7  #Theoretical value pka2
E1<-((Y1-X1)/(Y1))*(100)
E1
## [1] 4.385965

As we can see from the calculations above, there is a 4.385965% error between the titration curve pka2 and the theoretical value of pka2.

The percentage error between the binding curve pka1 and the theoretical value of pka1 is:

X2<-2.60381 #Binding curve pka1
Y2<-2.8  #Theoretical value pka1
E2<-((Y2-X2)/(Y2))*(100)
E2
## [1] 7.006786

As we can see from the calculations above, there is a 7.006786% error between the binding curve pka1 and the theoretical value of pka1.

The percentage error between the binding curve pka2 and the theoretical value of pka2 is:

X3<-5.7 #Binding curve pka2
Y3<-5.525784  #Theoretical value pka2
E3<-((Y3-X3)/(Y3))*(100)
E3
## [1] -3.152783

As we can see from the calculations above, there is a -3.152783% error between the binding curve pka2 and the theoretical value of pka2.

Summary of percentage error values

data= matrix(c(2.857143,7.006786,4.385965,-3.152783), ncol=2, byrow=TRUE)
colnames(data) = c('Titration error','Binding error')
rownames(data) <- c('pka1','pka2')
final=as.table(data)
final
##      Titration error Binding error
## pka1        2.857143      7.006786
## pka2        4.385965     -3.152783

Table of data values

Below is a table of vaules of all the data obtained and calculated

Xdata <- data.frame(VA,pH,H,F) #converts x and y data to a data frame
knitr::kable(Xdata[,], col.names = c('NAOH Volume','pH','H','F'), caption = 'TITRATION DATA')
TITRATION DATA
NAOH Volume pH H F
0.005 2.17 0.0067608 1.7855097
0.010 2.17 0.0067608 1.7848345
0.023 2.16 0.0069183 1.7780938
0.054 2.16 0.0069183 1.7739009
0.132 2.17 0.0067608 1.7683578
0.328 2.18 0.0066069 1.7468179
0.528 2.21 0.0061660 1.7340868
0.728 2.23 0.0058884 1.7162584
0.928 2.25 0.0056234 1.6981608
1.128 2.28 0.0052481 1.6838435
1.328 2.30 0.0050119 1.6650821
1.528 2.33 0.0046774 1.6497397
1.728 2.36 0.0043652 1.6338116
1.928 2.38 0.0041687 1.6140992
2.128 2.41 0.0038905 1.5972926
2.328 2.45 0.0035481 1.5828420
2.528 2.47 0.0033884 1.5622049
2.728 2.50 0.0031623 1.5439802
2.928 2.54 0.0028840 1.5277100
3.129 2.57 0.0026915 1.5083995
3.329 2.60 0.0025119 1.4888561
3.529 2.64 0.0022909 1.4708967
3.729 2.67 0.0021380 1.4505737
3.929 2.71 0.0019498 1.4316166
4.129 2.74 0.0018197 1.4106185
4.329 2.78 0.0016596 1.3907982
4.529 2.82 0.0015136 1.3705326
4.729 2.86 0.0013804 1.3498578
4.929 2.91 0.0012303 1.3298916
5.129 2.96 0.0010965 1.3093791
5.329 3.00 0.0010000 1.2875028
5.529 3.05 0.0008913 1.2661493
5.729 3.11 0.0007762 1.2450939
5.929 3.17 0.0006761 1.2235160
6.129 3.23 0.0005888 1.2014799
6.329 3.30 0.0005012 1.1795045
6.529 3.38 0.0004169 1.1574403
6.729 3.46 0.0003467 1.1348493
6.929 3.55 0.0002818 1.1120825
7.129 3.66 0.0002188 1.0892738
7.329 3.78 0.0001660 1.0660781
7.529 3.91 0.0001230 1.0425023
7.729 4.05 0.0000891 1.0185744
7.929 4.19 0.0000646 0.9942744
8.129 4.32 0.0000479 0.9696576
8.329 4.43 0.0000372 0.9447966
8.529 4.54 0.0000288 0.9198394
8.729 4.63 0.0000234 0.8947619
8.929 4.71 0.0000195 0.8696248
9.129 4.79 0.0000162 0.8444611
9.329 4.86 0.0000138 0.8192614
9.529 4.92 0.0000120 0.7940353
9.730 4.99 0.0000102 0.7686839
9.930 5.04 0.0000091 0.7434300
10.130 5.10 0.0000079 0.7181796
10.330 5.16 0.0000069 0.6929229
10.530 5.21 0.0000062 0.6676546
10.730 5.25 0.0000056 0.6423771
10.930 5.30 0.0000050 0.6171030
11.130 5.35 0.0000045 0.5918262
11.330 5.40 0.0000040 0.5665470
11.530 5.45 0.0000035 0.5412655
11.730 5.50 0.0000032 0.5159821
11.930 5.54 0.0000029 0.4906939
12.130 5.59 0.0000026 0.4654074
12.330 5.64 0.0000023 0.4401195
12.530 5.69 0.0000020 0.4148303
12.730 5.73 0.0000019 0.3895379
12.930 5.79 0.0000016 0.3642486
13.130 5.84 0.0000014 0.3389562
13.330 5.89 0.0000013 0.3136630
13.530 5.95 0.0000011 0.2883704
13.730 6.02 0.0000010 0.2630778
13.930 6.08 0.0000008 0.2377832
14.130 6.16 0.0000007 0.2124895
14.330 6.24 0.0000006 0.1871946
14.530 6.33 0.0000005 0.1618994
14.730 6.43 0.0000004 0.1366037
14.930 6.54 0.0000003 0.1113074
15.130 6.71 0.0000002 0.0860116
15.330 6.92 0.0000001 0.0607149
15.487 7.18 0.0000001 0.0408568
15.554 7.35 0.0000000 0.0323823
15.614 7.36 0.0000000 0.0247922
15.654 7.75 0.0000000 0.0197334
15.755 7.99 0.0000000 0.0069571
15.767 8.01 0.0000000 0.0054391
15.772 8.12 0.0000000 0.0048067
15.785 8.13 0.0000000 0.0031622
15.816 8.38 0.0000000 -0.0007592
15.821 8.49 0.0000000 -0.0013917
15.826 8.55 0.0000000 -0.0020242
15.839 8.74 0.0000000 -0.0036687
15.870 8.76 0.0000000 -0.0075902
15.875 8.95 0.0000000 -0.0082227
15.881 8.97 0.0000000 -0.0089817
15.895 8.99 0.0000000 -0.0107527
15.930 9.21 0.0000000 -0.0151803
15.935 9.23 0.0000000 -0.0158128
15.948 9.24 0.0000000 -0.0174573

Conclusion

As we can see, the pka values obtained from the binding curve is more accurate with more decimal places. However, when compared to the theoretical pka values, we can see that there still is some deviation between the binding curve and titration curve pka values.

Works cited

  1. https://pubchem.ncbi.nlm.nih.gov/compound/Malonic-acid