From d7740ae32642c1df1ac4a815bbda5ceb6329417e Mon Sep 17 00:00:00 2001 From: caes Date: Fri, 28 Apr 2017 04:25:56 -0400 Subject: [PATCH] finished --- accelerator/notes | 29 +++++++++++++ notes.R | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 accelerator/notes create mode 100644 notes.R diff --git a/accelerator/notes b/accelerator/notes new file mode 100644 index 0000000..54a328a --- /dev/null +++ b/accelerator/notes @@ -0,0 +1,29 @@ +notes: + +from program Sim NRA + +kinematic factor @ 2.000 ±0.001 MeV + +150 degrees + + Cu: 1885.05 ± 0.01 + Si: 1749.21 ± 0.01 + + + +can find a ratio between the lithium and flourine cross-sections + + taking the ratio of the yields and cross-sections allows things like target thickness to drop out + +what you're after: the yield and the cross-section are basically proportional to each other + +in lab write-up + + + +A big danger: + + Flourine curve very sensitive to different in energy of about .1, so this could change your ratio greatly + this would be a systematic error that caused an energy shift to explain wrong values + + \ No newline at end of file diff --git a/notes.R b/notes.R new file mode 100644 index 0000000..a22159c --- /dev/null +++ b/notes.R @@ -0,0 +1,102 @@ +plot(y,xlab="Channel",ylab="Count",lwd=4,pch="-") +lines(v[3]*exp(-1/2*(x-v[1])^2/v[2]^2),col=2,lwd=1.4) +abline(v = 7813.63,col=4,lwd=1) +axis(3,at=7813.63,"5.486 MeV") +dev.print(pdf,"../report/calibration.pdf") + + +Alpha Activity +plot(data_4_2,xlab="Energy [MeV]",ylab="Count [Alpha Particles]",pch=".") +minor.tick(nx=5,ny=2) +abline(v = 5.631,col=2,lwd=1) +axis(3,at=5.631,"5.6") +abline(v = 5.323,col=2,lwd=1) +axis(3,at=5.323,"5.3") +dev.print(pdf,"../report/activity.pdf") + + + +For Gaussian Fits: + +───────────── + +x <- seq_along(y) + +f <- function(par) +{ + m <- par[1] + sd <- par[2] + k <- par[3] + rhat <- k * exp(-0.5 * ((x - m)/sd)^2) + sum((y - rhat)^2) +} + +optim(c(15, 2, 1), f, method="BFGS", control=list(reltol=1e-9)) + +───────────── + +I propose to use non-linear least squares for this analysis. + +# First present the data in a data-frame +tab <- data.frame(x=seq_along(y), y=y) +#Apply function nls +(res <- nls( y ~ k*exp(-1/2*(x-mu)^2/sigma^2), start=c(mu=7500,sigma=50,k=1) , data = tab)) + +And from the output, I was able to obtain the following fitted "Gaussian curve": + +v <- summary(res)$parameters[,"Estimate"] +plot(y~x, data=tab) +plot(function(x) v[3]*exp(-1/2*(x-v[1])^2/v[2]^2),col=2,add=T,xlim=range(tab$x) ) + + + + + + + +Mirror Gumbel Distribution: + + +(res <- nls( y ~ (1/beta)*exp((x-alpha)/beta - exp((x - alpha)/beta)), data=cal,start=c(alpha=7800,beta=1),control=list(minFactor=1/50000,maxiter=1000))) +v <- summary(res)$parameters[,"Estimate"] +plot(function(x) (1/v[2])*exp((x-v[1])/v[2] - exp((x - v[1])/v[2])),col=2,add=T,xlim=range(tab$x)) + + + + +────────────────────────────────────────────────────────────────────────── + +───────────── + +File writing + +write(x, file = "data", + ncolumns = if(is.character(x)) 1 else 5, + append = FALSE, sep = " ") + + +dev.print(pdf,'filename.pdf') + + + + + +────────────────────────────────────────────────────────────────────────── + +───────────── +Axis Formatting + +# Add minor tick marks +library(Hmisc) +minor.tick(nx=n, ny=n, tick.ratio=n) + + + + + + +────────────────────────────────────────────────────────────────────────── + +───────────── +Importing CSV +