setwd("C:/Users/adive/Downloads")
RC_data <- read.csv("PHYS121_RC_circuits_data.csv")
This is a published copy of the R markdown file I used to determine the appropriate value of V_0 to use for my linear regressions. I did research on regression methods for exponential curves of the form found in the charging formula, and found that I could use a regression function from the Rstudio package “drc” (Analysis of Dose-Response Curves) in order to get a proper approximation for the theoretical maximum charge. This is important to my process because I was previously using the 3.061V approximation for the theoretical maximum charge, but it was making the error bounds for the time constant inconsistent with each other between the charging and discharging measurements. Additionally, the lab requires us to obtain error bounds for both the the time constant and the capacitance, which is only possible if we also have an error bound for V_0 (the theoretical maximum charge). The drc package allows us to obtain good approximations of the value and uncertainty of V_0.
soln1<-drm(purp_V_char ~ purp_t_char, data = RC_data, fct = AR.3())
soln1
##
## A 'drc' model.
##
## Call:
## drm(formula = purp_V_char ~ purp_t_char, data = RC_data, fct = AR.3())
##
## Coefficients:
## c:(Intercept) d:(Intercept) e:(Intercept)
## 0.2204 2.9492 70.5913
confint(soln1, level = 0.99)
## 0.5 % 99.5 %
## c:(Intercept) 0.1399257 0.3009577
## d:(Intercept) 2.8914677 3.0069517
## e:(Intercept) 64.9118509 76.2707739
soln2<-drm(brown_V_char ~ brown_t_char, data = RC_data, fct = AR.3())
soln2
##
## A 'drc' model.
##
## Call:
## drm(formula = brown_V_char ~ brown_t_char, data = RC_data, fct = AR.3())
##
## Coefficients:
## c:(Intercept) d:(Intercept) e:(Intercept)
## 0.1265 2.9662 133.4531
confint(soln2, level = 0.99)
## 0.5 % 99.5 %
## c:(Intercept) 0.06353313 0.1894583
## d:(Intercept) 2.92457279 3.0078950
## e:(Intercept) 125.70373545 141.2025558
The value “d” reported by the drm function is the upper asymptote V_0 of the exponential plateau function. We thus have that for the data from the purple resistor circuit while charging, V_0 = 2.9492+-0.0577, and that for the data from the brown resistor circuit while charging, V_0 = 2.9662+-0.0416. We can, similarly to as the lab instructions indicate, sum these errors in quadrature to obtain a pseudo-“pooled error” as a value for the uncertainty of the average of these two V_0. The mean V_0 with pooled uncertainty will be the best estimate of V_0 we can use for our linear regression in the later parts of the lab. Note too that the values for V_0 overlap in their error bounds, indicating we have found an appropriate range of values for V_0.
(2.9492+2.9662)/2
## [1] 2.9577
sqrt(0.0416^2+0.0577^2)
## [1] 0.07113262
Thus the most appropriate estimation of V_0 is 2.9577+-0.0711 Volts.