blob: 621a4616c35c48ff96b054864fdced9d0126c7c4 [file] [log] [blame]
file_path <- 'data.txt'
xA <- 100
xB <- 500
c <- 299792458 # m/s
h <- 6.62607015e-34 # m^2 kg s^{-1}
data <- read.table(file_path, sep="\t", header=TRUE)
data$TA <- data$VA / data$VSenseMostra
data$TB <- data$VB / data$VSenseMostra
tmaxA <- max(data$TA)
tmaxB <- max(data$TB)
data$AlphaASquared <- ((1/xA)*log(tmaxA/data$TA))^2
data$AlphaBSqrt <- sqrt((1/xB)*log(tmaxB/data$TB))
data$E <- h*c/(data$Longitud * 1e-9) * 6.242e18 # eV
dataFitA = data[16:18,]
dataFitB1 <- data[56:62,]
dataFitB2 <- data[33:55,]
fitA = lm(AlphaASquared~E, data = dataFitA)
summary(fitA)
fitB1 = lm(AlphaBSqrt~E, data = dataFitB1)
summary(fitB1)
fitB2 = lm(AlphaBSqrt~E, data = dataFitB2)
summary(fitB2)
plot(dataFitA$E, dataFitA$AlphaASquared)