#  library(read)
data <- read.csv("Autotitration lab.csv")

VolVect <- data$volume 
VolVect
##  [1]  0.000  0.005  0.010  0.023  0.054  0.132  0.328  0.528  0.728  0.928
## [11]  1.128  1.328  1.528  1.728  1.928  2.128  2.328  2.528  2.728  2.928
## [21]  3.129  3.329  3.529  3.729  3.929  4.129  4.329  4.529  4.729  4.929
## [31]  5.129  5.329  5.529  5.729  5.929  6.129  6.329  6.529  6.729  6.929
## [41]  7.129  7.329  7.529  7.729  7.929  8.129  8.329  8.529  8.729  8.929
## [51]  9.129  9.329  9.529  9.730  9.930 10.130 10.330 10.530 10.730 10.930
## [61] 11.130 11.330 11.530 11.730 11.930 12.130 12.330 12.530 12.730 12.930
## [71] 13.130 13.330 13.530 13.730 13.930 14.130 14.330 14.530 14.730 14.930
## [81] 15.130 15.330 15.530 15.730 15.930 16.130 16.330 16.531 16.731 16.931
## [91] 17.074 17.194 17.359 17.484
pHVect <- data$pH
pHVect
##  [1] 2.11 2.11 2.10 2.10 2.10 2.11 2.12 2.15 2.18 2.21 2.24 2.27 2.30 2.33 2.37
## [16] 2.40 2.43 2.46 2.50 2.53 2.57 2.60 2.64 2.67 2.71 2.75 2.79 2.83 2.87 2.91
## [31] 2.95 3.00 3.04 3.10 3.15 3.21 3.26 3.33 3.41 3.49 3.57 3.67 3.78 3.90 4.03
## [46] 4.16 4.29 4.41 4.51 4.61 4.69 4.77 4.84 4.90 4.96 5.02 5.07 5.13 5.18 5.22
## [61] 5.26 5.31 5.35 5.40 5.44 5.48 5.52 5.57 5.61 5.65 5.70 5.74 5.79 5.83 5.88
## [76] 5.93 5.97 6.03 6.09 6.15 6.21 6.27 6.34 6.42 6.51 6.60 6.71 6.84 6.99 7.21
## [91] 7.40 7.54 7.76 8.12
plot(VolVect,pHVect,xlab='Volume (mL)', ylab = 'pH', main= 'Titration Curve')

H <- 10^-(pHVect)
H
##  [1] 7.762471e-03 7.762471e-03 7.943282e-03 7.943282e-03 7.943282e-03
##  [6] 7.762471e-03 7.585776e-03 7.079458e-03 6.606934e-03 6.165950e-03
## [11] 5.754399e-03 5.370318e-03 5.011872e-03 4.677351e-03 4.265795e-03
## [16] 3.981072e-03 3.715352e-03 3.467369e-03 3.162278e-03 2.951209e-03
## [21] 2.691535e-03 2.511886e-03 2.290868e-03 2.137962e-03 1.949845e-03
## [26] 1.778279e-03 1.621810e-03 1.479108e-03 1.348963e-03 1.230269e-03
## [31] 1.122018e-03 1.000000e-03 9.120108e-04 7.943282e-04 7.079458e-04
## [36] 6.165950e-04 5.495409e-04 4.677351e-04 3.890451e-04 3.235937e-04
## [41] 2.691535e-04 2.137962e-04 1.659587e-04 1.258925e-04 9.332543e-05
## [46] 6.918310e-05 5.128614e-05 3.890451e-05 3.090295e-05 2.454709e-05
## [51] 2.041738e-05 1.698244e-05 1.445440e-05 1.258925e-05 1.096478e-05
## [56] 9.549926e-06 8.511380e-06 7.413102e-06 6.606934e-06 6.025596e-06
## [61] 5.495409e-06 4.897788e-06 4.466836e-06 3.981072e-06 3.630781e-06
## [66] 3.311311e-06 3.019952e-06 2.691535e-06 2.454709e-06 2.238721e-06
## [71] 1.995262e-06 1.819701e-06 1.621810e-06 1.479108e-06 1.318257e-06
## [76] 1.174898e-06 1.071519e-06 9.332543e-07 8.128305e-07 7.079458e-07
## [81] 6.165950e-07 5.370318e-07 4.570882e-07 3.801894e-07 3.090295e-07
## [86] 2.511886e-07 1.949845e-07 1.445440e-07 1.023293e-07 6.165950e-08
## [91] 3.981072e-08 2.884032e-08 1.737801e-08 7.585776e-09
VE <- 8.56

VI <- 25

BC <- 0.1

F <- (2-((VolVect*BC) + (H) * (VI + VolVect)) / (VE*BC))
tF <- F

plot(pHVect, tF, xlab = 'pH', ylab= 'Fraction Bound', main = "Fraction Bound vs pH")

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


summary (fitline)
## 
## Formula: tF ~ (H/KD1 + 2 * H^2/(KD1 * KD2))/(1 + H/KD1 + H^2/(KD1 * KD2))
## 
## Parameters:
##      Estimate Std. Error t value Pr(>|t|)    
## KD1 2.228e-06  4.937e-08   45.14   <2e-16 ***
## KD2 2.165e-03  4.314e-05   50.18   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02642 on 92 degrees of freedom
## 
## Number of iterations to convergence: 8 
## Achieved convergence tolerance: 1.823e-06
lines (pHVect, predict (fitline), col = "blue")

Abstract

This experiemnt investigated the titration of a diprotic acid, focusing on the determination of its dissociation constants, Ka1 and Ka2, using nonliner least squares (nls) anaylsis. The titration was perfomred by adding a strong base to the diprotic aicd and measuring the pH at varous stages. The observed dtaa was then fit to a theorretical model to estimate the dissociation constants. The nonlinear regression model was employed to find the best fitting values for Ka1 and Ka2, which characterizes the acid’s dissociation behavior.

Introduction

A diprotic acid will dissociate and donate two protons, representing the two dissocation constants Ka1 and Ka2; these value will quantify the the strength of the acid at each dissociation stage. The determination of these constants is crucial for understanding the acid’s behavior in solution, such as its beuffering capacity and pH chnage during titration. The dissociation constants were estimated using nonlinear square regression. This method is advantageous becasue it allows for fitting the observed data to the theoretical model for the dissociation equilibria of a diportic acid, providing accurate values for Ka1 and Ka2.

Discussion

Autotitration Ka1 and Ka2

Ka1 = \(2.24 * 10^-4\) Ka2 = \(2.88 * 10^-8\)

Nls Ka1 and Ka2

Ka1 = \(2.23 * 10^-6\) Ka2= \(2.17 * 10^-3\)

In performing the auto titration in excel, it was found that Ka1 value was \(2.24 * 10^-4\) while the Ka2 value was \(2.88 * 10^-8\). When running the titration on R programming it was found that Ka1 value was \(2.23 * 10^-6\) while Ka2 was \(2.17 * 10^-3\). It is possible to state that the two manners in which the Ka values were calculated are different.

To transform diportic data for a binding curve, you use the following equation to calculate the fraction bound at each pH value, which represents the proportion of the diprotic acid a molecule that has donated one or both portions

Transforming diportic data for a binding curve

To determine the dissocaition constants Ka1 and Ka2 from the titration data we used the nls() function to fit the theoretical model to experimental data.

Fraction Bound Equation for Diprotic Acid: \(Diprotic~ Fration~ Bound~ =~ 2~ - \frac{(BC~ *~ Vadd)~ +~ [H^+](Vi~ +~ Vadd)}{(BC~ *~ Ve)}\)

The output of the R fitting function willl provide the estimated value for Ka1 and Ka2, which are obtained by minimizing the residual sum of squares between the observed and predicted pH values.

Conclusion

From the titration curve and the nls fitting analysis, the dissociation constants of Ka1 and Ka2 were determined for the diprotic acid. The fitted values provided important insights into the acid’s behavior in solution. The two dissociation constants correspond to the expected proton dissociations, and the results indicate the relative strength of the acid at each step. The method of nls fitting was effective in accurately estimating the constants, demonstrating the utility of this technique in titration analysis.