Adapt to titration data, framed as fraction binding as determined from the endpoint, vs pH (which is actually equilibrium ligand H)
We can transform titration data to a binding curve representation.
For the equilibrium:
\(HA \rightleftharpoons H^+ + A^-\)
\(K_a = \frac{[H^+][A^-]}{[HA]}\)
we are measuring H+ and for a weak base strong acid titration, the fraction bound is fraction of the way to the endpoint.
\(f = \frac{[HA]}{[A^-]+[HA]} = \frac{vol}{vol_t}\)
substituting the equilibrium expressions into this:
$ f = $
\(\frac{1}{\frac{K^a}{[H^+]}+1}\)
\(f = \frac{[H^+]}{[H^+]+K_a}\)
It is useful to note that we are meauring [H^+], so unlike the similar binding equation, there is no approximation of excess “ligand”.
Fraction binding can be estimated from the volome as a ratio to the endpoint volume. 1- (vol/vol endpoint) = f. this assumes complete reaction and no back reaction, which will not be very accurate at lower ph ranges.
This is a very useful way to analyze acid base data to determie \(K_a\) vaues.
Where is the error? The error is in the estimation of the endpoint, which translates into a sytematic error in the fraction bound.
KD <- 1.75 * 10^(-5) # initializing variables
L <- 0.0
y <- 0.0
KD
## [1] 1.75e-05
# A mote carlo determination of sd, consistent with nls
# can use with duplex
pH <- seq(3,6,0.2) # generating a list of values
pH
## [1] 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0
length(pH)
## [1] 16
L <- 10^(-pH)
L
## [1] 1.000000e-03 6.309573e-04 3.981072e-04 2.511886e-04 1.584893e-04
## [6] 1.000000e-04 6.309573e-05 3.981072e-05 2.511886e-05 1.584893e-05
## [11] 1.000000e-05 6.309573e-06 3.981072e-06 2.511886e-06 1.584893e-06
## [16] 1.000000e-06
ra <-rnorm(16,0,0.005) # generate 15 random numbers
length(ra)
## [1] 16
y <- L/(KD+L)
y
## [1] 0.98280098 0.97301287 0.95789293 0.93486885 0.90056215 0.85106383
## [7] 0.78286692 0.69464699 0.58938371 0.47524556 0.36363636 0.26500153
## [13] 0.18532929 0.12551972 0.08304438 0.05405405
y <- L/(KD+L) + ra
y
## [1] 0.97974438 0.96520723 0.96131844 0.94406883 0.90371534 0.84662451
## [7] 0.78402250 0.69201294 0.58848513 0.47254299 0.36808933 0.26252031
## [13] 0.18410828 0.12992979 0.08364103 0.05999275
plot(pH,y)
tryfit <- nls(y ~ L/(KD+L),
start = c(KD = 0.0001))
summary(tryfit)
##
## Formula: y ~ L/(KD + L)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## KD 1.750e-05 1.294e-07 135.2 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.004436 on 15 degrees of freedom
##
## Number of iterations to convergence: 4
## Achieved convergence tolerance: 4.006e-06
plot(pH,y, main = "Acid/Base Binding", xlab = "pH", ylab = "Fractional Binding")
lines(pH,predict(tryfit), col = "blue") # add a line fitted to points
note : k1, k2 are in reverse than normal order in derivation
(albery)
to analyze data in titration of a weak diprotic acid with naoh use
\(f = 2 - (2*vol /vol_{end})\)
\[f =\frac{ \frac{[H^+]}{K_1} + \frac{2[H^+]^2}{K_1K_2} + \frac{3[H^+]^3}{K_1K{_2K_3}}}{1+\frac{[H^+]}{K_1}+\frac{[H^+]^2}{K_1K_2}+\frac{[H^+]^3}{K_1K_2K_3}}\] For a diprotic case, with k1 and k2.
KD1 <- 1 * 10^(-8)
KD2 <- 1 * 10^(-5)
# initializing variables
L <- 0.0
y <- 0.0
pH <- seq(2,10,0.2) # generating a list of values
pH
## [1] 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8
## [16] 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8
## [31] 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0
length(pH)
## [1] 41
L <- 10^(-pH)
L
## [1] 1.000000e-02 6.309573e-03 3.981072e-03 2.511886e-03 1.584893e-03
## [6] 1.000000e-03 6.309573e-04 3.981072e-04 2.511886e-04 1.584893e-04
## [11] 1.000000e-04 6.309573e-05 3.981072e-05 2.511886e-05 1.584893e-05
## [16] 1.000000e-05 6.309573e-06 3.981072e-06 2.511886e-06 1.584893e-06
## [21] 1.000000e-06 6.309573e-07 3.981072e-07 2.511886e-07 1.584893e-07
## [26] 1.000000e-07 6.309573e-08 3.981072e-08 2.511886e-08 1.584893e-08
## [31] 1.000000e-08 6.309573e-09 3.981072e-09 2.511886e-09 1.584893e-09
## [36] 1.000000e-09 6.309573e-10 3.981072e-10 2.511886e-10 1.584893e-10
## [41] 1.000000e-10
ra <-rnorm(41,0,0.005) # generate 15 random numbers
length(ra)
## [1] 41
y <- (L/KD1 + 2*L^2/(KD1*KD2))/(1+L/KD1 + L^2/(KD1*KD2) )
y
## [1] 1.999000997 1.998417610 1.997494395 1.996034683 1.993729909 1.990098813
## [7] 1.984397847 1.975495417 1.961710506 1.940641790 1.909073554 1.863152714
## [13] 1.799149262 1.715058332 1.612743159 1.499250375 1.385516795 1.282443168
## [19] 1.196951511 1.130648944 1.081081081 1.043789829 1.013796079 0.986203921
## [25] 0.956210171 0.918918919 0.869351056 0.803048489 0.717556832 0.614483205
## [31] 0.500749625 0.387256841 0.284941668 0.200850738 0.136847286 0.090926446
## [37] 0.059358210 0.038289494 0.024504583 0.015602153 0.009901187
length(y)
## [1] 41
length(L)
## [1] 41
plot(pH,y)
#tryfit <- nls(y ~ L/(KD+L),
# start = c(KD = 0.0001))
# summary(tryfit)
#plot(pH,y, main = "Acid/Base Binding", xlab = "pH", ylab = #"Fractional Binding")
#lines(pH,predict(tryfit), col = "blue") # add a line fitted to #points
In practice, fraction binding from the titration data is assuming very weak dissociation, so the fraction binding calculation will not be accurate at lower ph values. thus use data starting at the first medpoint.
Could us monte carlo to add error to x values after calculation of theoretical curve & examine validity of fit and error estimates on ka.