Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Test
Views: 115
Kernel: Python 2 (system-wide)

Settings for UCS30

High Voltage: 950 V Coarse Gain: 8 Fine Gain: 1.7

This placed the 662-keV peak of Cs-137 around channel 660

Calibration

Used sources from the Gamma Source Set (Model RSS 8)

Collected data for Cs-137 for 600 s

32-keV peak: channel 34 662-keV peak: channel 654

Collected data for Na-22 for 600 s

511-keV peak: channel 506

Used 3-point energy calibration

Compton Scattering

Used the 37-MBq Cs-137 source

0 deg 600 s 657.91 keV (no target) 30 deg 3600 s (backgrd w/o target for 1147 s) 557 keV 60 deg 36000 s (backgrd w/o target for 3600 s) 399 keV

Data with background subtracted for 60 deg is shown below

from IPython.display import Image Image(filename='Compton-60deg.jpg',width=500)
Image in a Jupyter notebook
from numpy import * from pylab import * mc2 = 511. E0 = 662. #658. th_data = array([0,30,60]) E_data = array([658, 557, 399]) theta = arange(0,181,1) E = E0/(1.0+(E0/mc2)*(1.0-cos(radians(theta)))) figure() plot(theta,E,c='g',label='theory') scatter(th_data,E_data,label='data') xlabel('Angle (degrees)') ylabel('Engergy (keV)') xlim(0,180) ylim(0) legend()
<matplotlib.legend.Legend at 0x7fb089ca1190>
Image in a Jupyter notebook
x=(1.0-cos(radians(th_data))) y=1.0/E_data plot((1.0-cos(radians(theta))),1/E,c='g',label='theory') scatter(x,y,label='data') xlabel(r'$1-cos(\theta)$') ylabel(r'$1/E\ \rm{(keV^{-1})}$') xlim(0,2) ylim(0) legend()
<matplotlib.legend.Legend at 0x7fb0891043d0>
Image in a Jupyter notebook
from pylab import * a = 662./511. thetadeg = linspace(0,180,131) theta = thetadeg*pi/180 dsdth = (1/(1+a*(1-cos(theta)))**2)*(1+(cos(theta))**2 + (a*(1-cos(theta)))**2/(1+a*(1-cos(theta)))) #dsdth *= 0.5 # rescale peak to 1 #print(thetadeg,dsdth) dsdth_Thomson = (1+cos(theta)**2)/2 print(thetadeg,dsdth) figure() plot(thetadeg,dsdth,label="Klein-Nishina") plot(thetadeg,dsdth_Thomson,label='Thomson') xlim(0,180) ylim(0) xlabel('Angle (degrees)') ylabel(r'$d\sigma/d\Omega\ \rm{ (arbitrary)}$') legend()
(array([ 0. , 1.38461538, 2.76923077, 4.15384615, 5.53846154, 6.92307692, 8.30769231, 9.69230769, 11.07692308, 12.46153846, 13.84615385, 15.23076923, 16.61538462, 18. , 19.38461538, 20.76923077, 22.15384615, 23.53846154, 24.92307692, 26.30769231, 27.69230769, 29.07692308, 30.46153846, 31.84615385, 33.23076923, 34.61538462, 36. , 37.38461538, 38.76923077, 40.15384615, 41.53846154, 42.92307692, 44.30769231, 45.69230769, 47.07692308, 48.46153846, 49.84615385, 51.23076923, 52.61538462, 54. , 55.38461538, 56.76923077, 58.15384615, 59.53846154, 60.92307692, 62.30769231, 63.69230769, 65.07692308, 66.46153846, 67.84615385, 69.23076923, 70.61538462, 72. , 73.38461538, 74.76923077, 76.15384615, 77.53846154, 78.92307692, 80.30769231, 81.69230769, 83.07692308, 84.46153846, 85.84615385, 87.23076923, 88.61538462, 90. , 91.38461538, 92.76923077, 94.15384615, 95.53846154, 96.92307692, 98.30769231, 99.69230769, 101.07692308, 102.46153846, 103.84615385, 105.23076923, 106.61538462, 108. , 109.38461538, 110.76923077, 112.15384615, 113.53846154, 114.92307692, 116.30769231, 117.69230769, 119.07692308, 120.46153846, 121.84615385, 123.23076923, 124.61538462, 126. , 127.38461538, 128.76923077, 130.15384615, 131.53846154, 132.92307692, 134.30769231, 135.69230769, 137.07692308, 138.46153846, 139.84615385, 141.23076923, 142.61538462, 144. , 145.38461538, 146.76923077, 148.15384615, 149.53846154, 150.92307692, 152.30769231, 153.69230769, 155.07692308, 156.46153846, 157.84615385, 159.23076923, 160.61538462, 162. , 163.38461538, 164.76923077, 166.15384615, 167.53846154, 168.92307692, 170.30769231, 171.69230769, 173.07692308, 174.46153846, 175.84615385, 177.23076923, 178.61538462, 180. ]), array([2. , 1.99790449, 1.99163745, 1.98125704, 1.96685889, 1.94857435, 1.92656794, 1.90103431, 1.87219477, 1.84029329, 1.80559246, 1.76836911, 1.72891004, 1.68750773, 1.64445633, 1.60004779, 1.55456837, 1.50829556, 1.46149531, 1.4144198 , 1.36730557, 1.32037212, 1.27382089, 1.22783466, 1.18257729, 1.13819375, 1.09481049, 1.05253595, 1.01146136, 0.97166159, 0.93319622, 0.89611061, 0.86043708, 0.826196 , 0.79339707, 0.76204037, 0.73211754, 0.7036128 , 0.67650401, 0.65076355, 0.62635923, 0.60325511, 0.58141219, 0.56078911, 0.54134274, 0.52302867, 0.50580174, 0.4896164 , 0.47442708, 0.46018852, 0.44685597, 0.43438546, 0.42273396, 0.41185953, 0.40172144, 0.39228024, 0.38349788, 0.37533767, 0.3677644 , 0.36074429, 0.35424505, 0.34823581, 0.34268714, 0.33757101, 0.33286077, 0.32853111, 0.32455801, 0.32091872, 0.31759168, 0.31455651, 0.31179393, 0.30928574, 0.30701477, 0.3049648 , 0.30312055, 0.30146764, 0.2999925 , 0.29868237, 0.29752525, 0.29650985, 0.29562554, 0.29486235, 0.29421091, 0.2936624 , 0.29320858, 0.29284166, 0.29255439, 0.29233991, 0.29219183, 0.29210414, 0.2920712 , 0.29208773, 0.29214879, 0.29224975, 0.29238625, 0.29255424, 0.29274991, 0.2929697 , 0.29321028, 0.29346852, 0.29374153, 0.29402656, 0.29432108, 0.29462271, 0.29492923, 0.29523858, 0.29554881, 0.29585814, 0.29616489, 0.2964675 , 0.29676453, 0.29705463, 0.29733656, 0.29760917, 0.29787139, 0.29812225, 0.29836084, 0.29858635, 0.298798 , 0.29899513, 0.2991771 , 0.29934337, 0.29949343, 0.29962684, 0.29974323, 0.29984226, 0.29992365, 0.29998719, 0.3000327 , 0.30006005, 0.30006918]))
<matplotlib.legend.Legend at 0x7fb088e9a690>
Image in a Jupyter notebook
# student data from Fall 2019 theta = array([30,45,60,75,90,105,120]) dsdtexp = array([7.42,5.13,2.14,1.96,1.92,1.64,1.96]) figure() plot(thetadeg,dsdth,label="Klein-Nishina") plot(thetadeg,dsdth_Thomson,label='Thomson') scatter(theta,dsdtexp/5.5,c='k',label="Experiment (divided by 5.5)") xlim(0,180) ylim(0) xlabel('Angle (degrees)') ylabel(r'$d\sigma/d\Omega\ \rm{ (arbitrary)}$') legend()
<matplotlib.legend.Legend at 0x7fb089035890>
Image in a Jupyter notebook
theta = array([30,45,60,75,90,105,120]) dsdtexp = array([7.42,5.13,2.14,1.96,1.92,1.64,1.96]) scale = 5.5 figure() plot(thetadeg,scale*dsdth,label="Klein-Nishina (times 5.5)") plot(thetadeg,scale*dsdth_Thomson,label='Thomson (times 5.5)') scatter(theta,dsdtexp,c='k',label="Experiment") xlim(0,180) ylim(0) xlabel('Angle (degrees)') ylabel(r'$d\sigma/d\Omega\ \rm{ (arbitrary)}$') legend()
<matplotlib.legend.Legend at 0x7fda107b4d50>
Image in a Jupyter notebook
# corrections n = array([0.8286,0.8172,0.8049,0.7917,0.7790,0.7637,0.7607]) e = array([0.6599,0.7086,0.7574,0.8043,0.8517,0.8795,0.8972]) p = array([0.4616,0.5380,0.6341,0.7168,0.7832,0.8496,0.8660]) print(n*e*p) Cot = dsdtexp*n*e*p # remove corrections print(Cot) scale = 1 figure() plot(thetadeg,scale*dsdth,label="Klein-Nishina (times 5.5)") scatter(theta,Cot,c='k',label="Experiment (uncorrected)") xlim(0,180) ylim(0) xlabel('Angle (degrees)') ylabel(r'$d\sigma/d\Omega\ \rm{ (arbitrary)}$') legend()
[0.25239971 0.31153854 0.38656718 0.45643266 0.51963307 0.57065436 0.59104503] [1.87280587 1.59819272 0.82725377 0.89460801 0.9976955 0.93587315 1.15844827]
<matplotlib.legend.Legend at 0x7fda10362290>
Image in a Jupyter notebook
d2 = 0.5*(1+cos(theta)**2)/(1+a*(1-cos(theta)))**2*(1+a**2*(1-cos(theta))**2/(1+cos(theta)**2)/(1+a*(1-cos(theta)))) figure() plot(thetadeg,d2) xlim(0,180) ylim(0)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-12-22c54c289fe7> in <module>() 2 3 figure() ----> 4 plot(thetadeg,d2) 5 xlim(0,180) 6 ylim(0) /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/pyplot.pyc in plot(*args, **kwargs) 3361 mplDeprecation) 3362 try: -> 3363 ret = ax.plot(*args, **kwargs) 3364 finally: 3365 ax._hold = washold /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/__init__.pyc in inner(ax, *args, **kwargs) 1865 "the Matplotlib list!)" % (label_namer, func.__name__), 1866 RuntimeWarning, stacklevel=2) -> 1867 return func(ax, *args, **kwargs) 1868 1869 inner.__doc__ = _add_data_doc(inner.__doc__, /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc in plot(self, *args, **kwargs) 1526 kwargs = cbook.normalize_kwargs(kwargs, _alias_map) 1527 -> 1528 for line in self._get_lines(*args, **kwargs): 1529 self.add_line(line) 1530 lines.append(line) /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _grab_next_args(self, *args, **kwargs) 404 this += args[0], 405 args = args[1:] --> 406 for seg in self._plot_args(this, kwargs): 407 yield seg 408 /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _plot_args(self, tup, kwargs) 381 x, y = index_of(tup[-1]) 382 --> 383 x, y = self._xy_from_xy(x, y) 384 385 if self.command == 'plot': /ext/sage/sage-8.9_1804/local/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in _xy_from_xy(self, x, y) 240 if x.shape[0] != y.shape[0]: 241 raise ValueError("x and y must have same first dimension, but " --> 242 "have shapes {} and {}".format(x.shape, y.shape)) 243 if x.ndim > 2 or y.ndim > 2: 244 raise ValueError("x and y can be no greater than 2-D, but have " ValueError: x and y must have same first dimension, but have shapes (900,) and (7,)
Image in a Jupyter notebook

Student data from Fall 2017

from numpy import * from pylab import * mc2 = 511. E0 = 662. #658. th_data = array([0,15,30,45,60,90,120,180]) E_data = array([661, 641.5, 570, 475.6, 408.6, 287.6, 222.8, 190.8]) theta = arange(0,181,1) E = E0/(1.0+(E0/mc2)*(1.0-cos(radians(theta)))) figure() plot(theta,E,c='g',label='theory') scatter(th_data,E_data,label='data') xlabel('Angle (degrees)') ylabel('Engergy (keV)') xlim(0,180) ylim(0) legend()
<matplotlib.legend.Legend at 0x7fda100ef4d0>
Image in a Jupyter notebook
x=(1.0-cos(radians(th_data))) y=1.0/E_data plot((1.0-cos(radians(theta))),1/E,c='g',label='theory') scatter(x,y,label='data') xlabel(r'$1-cos(\theta)$') ylabel(r'$1/E\ \rm{(keV^{-1})}$') xlim(0,2) ylim(0) legend()
<matplotlib.legend.Legend at 0x7fda1000f8d0>
Image in a Jupyter notebook
from fitting import linear_fit a, b, sa, sb, rchi2, dof = linear_fit(x, y) print('y = ax + b') print('a = ', a, ' +/- ', sa) print('b = ', b, ' +/- ', sb) print(1/a,1/b) #print(sa/a,sb/b)
results of linear_fit: no uncertainties provided, so use with caution reduced chi squared = 4.19466771906766e-09 degrees of freedom = 6 y = ax + b ('a = ', 0.0019096876294054433, ' +/- ', 0.5078589331363685) ('b = ', 0.0015192323556281083, ' +/- ', 0.4951590961873137) (523.645848987008, 658.2271607732855)
def compton(th,A,B): return(A/(1+B*(1-cos(radians(th))))) from fitting import general_fit p0 = [662., 511./662.] popt, punc, rchi2, dof = general_fit(compton, th_data, E_data, p0) print('optimal parameters: ', popt) print('uncertainties of parameters: ', punc) print(popt[0]/popt[1])
results of general_fit: no uncertainties provided, so use with caution degrees of freedom = 6 reduced chi squared = 26.797725895030535 ('optimal parameters: ', array([665.05953214, 1.29269402])) ('uncertainties of parameters: ', array([3.4857686 , 0.02605173])) 514.4755997014257
def compton2(th,B): return(E_data[0]/(1+B*(1-cos(radians(th))))) from fitting import general_fit p0 = [511./662.] popt, punc, rchi2, dof = general_fit(compton2, th_data, E_data, p0) print('optimal parameters: ', popt) print('uncertainties of parameters: ', punc) print(E_data[0]/popt[0])
results of general_fit: no uncertainties provided, so use with caution degrees of freedom = 7 reduced chi squared = 28.17316284822041 ('optimal parameters: ', array([1.27270851])) ('uncertainties of parameters: ', array([0.019842])) 519.3648011208836
E = array([662,511,32]) sE = array([0.01,0.01,0.01]) Ch = array([631,491,80]) sCh = array([0.5,0.5,0.5]) from fitting import linear_fit a, b, sa, sb, rchi2, dof = linear_fit(Ch, E, sE, sCh) print('y = ax + b') print('a = ', a, ' +/- ', sa) print('b = ', b, ' +/- ', sb) print(a*Ch +b) print(sa*Ch + sb) figure() scatter(Ch,E) plot(Ch,a*Ch+b)
results of linear_fit: reduced chi squared = 153.941214659 degrees of freedom = 1 y = ax + b ('a = ', 1.1486412151266823, ' +/- ', 0.017598381552826454) ('b = ', -58.555579034512235, ' +/- ', 8.163851344817177) [666.23702771 505.42725759 33.33571818] [19.2684301 16.80465669 9.57172187]
[<matplotlib.lines.Line2D at 0x7fda09bba790>]
Image in a Jupyter notebook