Collection and analysis of rate data - 2013
Revision as of 00:16, 1 March 2013 by Kevin Dunn (talk | contribs)
Class date(s): | 28 February | ||||
| |||||
- F2011: Chapter 7
- F2006: Chapter 5
28 February 2013 (07C)
R code for the example covered in class:
t <- c(0, 50, 100, 150, 200, 250) # [minutes]
# or you can write t <- seq(0, 250, 50)
CA <- c(154, 114, 87, 76, 70, 58) # [mol/m^3]
# Plot the data first. See the expected trend. It it decreasing nonlinearly, so it is either first or second order (but not zeroth order)
plot(t, CA)
grid()
# Assume it is a first order, rA = -k CA
# So plot log(CA0/CA) against t
plot(t, log(CA[1]/CA))
grid()
# Does not quite look like a straight line, but let us fit a least-squares model anyway
mod.first <- lm( log(CA[1] / CA) ~ t)
summary(mod.first)
#Call:
#lm(formula = log(CA[1]/CA) ~ t)
#
#Residuals:
# 1 2 3 4 5 6
#-0.09425 0.02134 0.10646 0.05647 -0.04646 -0.04357
#
#Coefficients:
# Estimate Std. Error t value Pr(>|t|)
#(Intercept) 0.0942475 0.0604645 1.559 0.194066
#t 0.0037033 0.0003994 9.272 0.000753 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error: 0.08354 on 4 degrees of freedom
#Multiple R-squared: 0.9555, Adjusted R-squared: 0.9444
# Now assume a second order system, rA = -k CA^2
# So plot 1/CA against t
plot(t, 1/CA)
grid()
# Definitely more linear. Let us fit the least squares model to check:
mod.second <- lm( I(1/CA) ~ t)
summary(mod.second)
#Call:
#lm(formula = I(1/CA) ~ t)
#
#Residuals:
# 1 2 3 4 5 6
#-2.751e-04 -5.219e-05 6.146e-04 2.227e-04 -7.051e-04 1.951e-04
#
#Coefficients:
# Estimate Std. Error t value Pr(>|t|)
#(Intercept) 6.769e-03 3.692e-04 18.33 5.21e-05 ***
#t 4.111e-05 2.439e-06 16.86 7.26e-05 ***
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#Residual standard error: 0.0005101 on 4 degrees of freedom
#Multiple R-squared: 0.9861, Adjusted R-squared: 0.9826
#F-statistic: 284.2 on 1 and 4 DF, p-value: 7.259e-05
So we got a higher \(R^2\) on the second order model. The reaction rate can be considered second order. What is the reaction rate constant, \(k_A\) for this system?