aver147 PHYSICS121 lab 2

Load libraries

suppressWarnings(library(tidyverse))
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.3     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Create vectors for each set of measurements

# 0.02mm single slit
# for this slit, both measurements are from the central maximum, meaning we
# must divide by 1.5 to obtain the standard fringe spacing

slit02 <- c(57/1.5, 65.5/1.5)
slit04 <- c(17, 18, 27/1.5, 26/1.5, 18, 18)
slit08 <- c(9, 9, 9, 13/1.5, 13/1.5, 9, 9, 9)
slit16 <- c(3, 4, 6/1.5, 7/1.5, 4, 4)
line08 <- c(9,8,12/1.5,13/1.5, 8,9)
hairdiff <- c(9,11,10,9,9,10,10,10,9,10,9,9,10,9)

Create confidence intervals for each mean fringe spacing

# 0.02mm slit spacing confidence interval
# there are too few measurements to use a confidence interval, so we use
# the sum of the individual uncertainties
print("estimate of 0.02mm slit spacing:")
[1] "estimate of 0.02mm slit spacing:"
mean(slit02) + c(-1,1)
[1] 39.83333 41.83333
# 0.04mm slit spacing confidence interval
t.test(slit04, conf.level=0.997)

    One Sample t-test

data:  slit04
t = 97.98, df = 5, p-value = 2.1e-09
alternative hypothesis: true mean is not equal to 0
99.7 percent confidence interval:
 16.74983 18.69462
sample estimates:
mean of x 
 17.72222 
# 0.08mm slit spacing confidence interval
t.test(slit08, conf.level=0.997)

    One Sample t-test

data:  slit08
t = 163.45, df = 7, p-value = 8.469e-14
alternative hypothesis: true mean is not equal to 0
99.7 percent confidence interval:
 8.674329 9.159004
sample estimates:
mean of x 
 8.916667 
# 0.16mm slit spacing confidence interval
t.test(slit16, conf.level=0.997)

    One Sample t-test

data:  slit16
t = 18.092, df = 5, p-value = 9.478e-06
alternative hypothesis: true mean is not equal to 0
99.7 percent confidence interval:
 2.772386 5.116503
sample estimates:
mean of x 
 3.944444 
# 0.08mm opaque line fringe spacing confidence interval
t.test(line08, conf.level=0.997)

    One Sample t-test

data:  line08
t = 41.217, df = 5, p-value = 1.586e-07
alternative hypothesis: true mean is not equal to 0
99.7 percent confidence interval:
 7.343011 9.545878
sample estimates:
mean of x 
 8.444444 
# strand of hair fringe spacing confidence interval
t.test(hairdiff, conf.level=0.997)

    One Sample t-test

data:  hairdiff
t = 55.42, df = 13, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
99.7 percent confidence interval:
  8.942961 10.199896
sample estimates:
mean of x 
 9.571429 

Determine widths with error from experimental values

We know that ∆y = λL/a, and can rearrange to obtain “a” explicitly:

a = λL/∆y

Then, we have that the error of “a” is equal to the relative uncertainties of ∆y and L summed in quadrature, and multiplied by the point estimate of a.

# we now standardize lengths to meters to ensure correct calculations
width02 <- 650e-9*1.00/(40.8e-3)
errorwidth02 <- width02*sqrt((1e-3/40.8e-3)^2+(0.5e-2/1.00)^2)*c(-1,1)

print("the experimentally determined width of the 0.02mm slit is")
[1] "the experimentally determined width of the 0.02mm slit is"
width02
[1] 1.593137e-05
print("with an uncertainty")
[1] "with an uncertainty"
errorwidth02  
[1] -3.98517e-07  3.98517e-07
cat("\n")
width04 <- 650e-9*1.00/(17.7e-3)
errorwidth04 <- width04*sqrt((0.973e-3/17.7e-3)^2+(0.5e-2/1.00)^2)*c(-1,1)

print("the experimentally determined width of the 0.04mm slit is")
[1] "the experimentally determined width of the 0.04mm slit is"
width04
[1] 3.672316e-05
print("with an uncertainty")
[1] "with an uncertainty"
errorwidth04  
[1] -2.02707e-06  2.02707e-06
cat("\n")
width08 <- 650e-9*1.00/(8.92e-3)
errorwidth08 <- width08*sqrt((0.242e-3/8.92e-3)^2+(0.5e-2/1.00)^2)*c(-1,1)

print("the experimentally determined width of the 0.08mm slit is")
[1] "the experimentally determined width of the 0.08mm slit is"
width08
[1] 7.286996e-05
print("with an uncertainty")
[1] "with an uncertainty"
errorwidth08  
[1] -2.010259e-06  2.010259e-06
cat("\n")
width16 <- 650e-9*1.00/(3.94e-3)
errorwidth16 <- width16*sqrt((1.17e-3/3.94e-3)^2+(0.5e-2/1.00)^2)*c(-1,1)

print("the experimentally determined width of the 0.16mm slit is")
[1] "the experimentally determined width of the 0.16mm slit is"
width16
[1] 0.0001649746
print("with an uncertainty")
[1] "with an uncertainty"
errorwidth16  
[1] -4.899687e-05  4.899687e-05
cat("\n")
widthline <- 650e-9*1.00/(8.44e-3)
errorwidthline <- widthline*sqrt((1.10e-3/8.44e-3)^2+(0.5e-2/1.00)^2)*c(-1,1)

print("the experimentally determined width of the 0.08mm opaque line is")
[1] "the experimentally determined width of the 0.08mm opaque line is"
widthline
[1] 7.701422e-05
print("with an uncertainty")
[1] "with an uncertainty"
errorwidthline  
[1] -1.004478e-05  1.004478e-05
cat("\n")
widthhair <- 650e-9*1.09/(9.57e-3)
errorwidthhair <- widthhair*sqrt((0.629e-3/9.57e-3)^2+(0.5e-3/1.09)^2)*c(-1,1)

print("the experimentally determined width of the strand of my hair is")
[1] "the experimentally determined width of the strand of my hair is"
widthhair
[1] 7.403344e-05
print("with an uncertainty")
[1] "with an uncertainty"
errorwidthhair
[1] -4.866057e-06  4.866057e-06

This is super cool, the data predicts that the strand of my hair was roughly 0.074mm, which as detailed by this research (https://pubmed.ncbi.nlm.nih.gov/33905616/) is a fairly average hair diameter, with the caveat that hair is actually elliptical, and has a long or short axis.