blob: 621a4616c35c48ff96b054864fdced9d0126c7c4 [file] [log] [blame]
Adrià Vilanova Martínez5b56f8b2023-03-15 22:25:23 +01001file_path <- 'data.txt'
2
3xA <- 100
4xB <- 500
5
6c <- 299792458 # m/s
7h <- 6.62607015e-34 # m^2 kg s^{-1}
8
9data <- read.table(file_path, sep="\t", header=TRUE)
10data$TA <- data$VA / data$VSenseMostra
11data$TB <- data$VB / data$VSenseMostra
12tmaxA <- max(data$TA)
13tmaxB <- max(data$TB)
14data$AlphaASquared <- ((1/xA)*log(tmaxA/data$TA))^2
15data$AlphaBSqrt <- sqrt((1/xB)*log(tmaxB/data$TB))
16data$E <- h*c/(data$Longitud * 1e-9) * 6.242e18 # eV
17
18dataFitA = data[16:18,]
19dataFitB1 <- data[56:62,]
20dataFitB2 <- data[33:55,]
21
22fitA = lm(AlphaASquared~E, data = dataFitA)
23summary(fitA)
24
25fitB1 = lm(AlphaBSqrt~E, data = dataFitB1)
26summary(fitB1)
27
28fitB2 = lm(AlphaBSqrt~E, data = dataFitB2)
29summary(fitB2)
30
31plot(dataFitA$E, dataFitA$AlphaASquared)
32