Final Upload

Here is a link to my GitHub account where I have depository with my final code and a pdf that explains my code in good detail and another that goes into the details of the development of the code. Also it has plots for what you would expect for running my code for a simple case. Good luck!

https://github.com/mannion9/NeutronDistanceSimulation

Also here is a link to some tutorials I wrote as I was working over the past year or two.

https://github.com/mannion9/Intro-to-Python

Update 2/24/15

Before Andrea left we discussed a flaw with my method of calculating the mean free path. I was using different N (atomic densities) when calculating the mean free path for Carbon and Hydrogen. I have fixed this.

Here are the results of this fix.

EnergyvsDistanceEnergyvsTimeThermalDistance

I have done a few calculations with the update

1) Thermal mean free path

Carbon=4.3 cm  (previously 0.436 cm)

Hydrogen=.6 cm (previously 0.0053cm)

2) Mean thermal walk = 8.4 cm (previously .5 cm)

3) Max Thermal walk = 83 cm

So from these results I am confident this is giving correct results. Andrea mentioned it is observed neutrons in this substance can travel ~70 cm. The first plot shows agreement.

The fact that my code could be showing a larger distance traveled could be due the amount of energy the code says the neutron loses in a collision. The assumptions I have made is that this is a head on inelastic collision with one Carbon or one Hydrogen does not reflect the reality of the situation and must be improved.

Winter Break Summary

Question for Andrea: Which Hydrogen should I use? I am using H_1 in this simulation and assumed that the energy loss was 50%, but the energy loss should be 100% shouldn’t it if it is a perfect elastic collision and the the neuron and hydrogen(proton) have ~ the same mass?

This break I have been working on making a new version of my code that works when the neutron is in a substance containing different elements like the scintillators used in DarkSide. This has taken some time and I have had to restructure much of the code but I learn a lot along the way.

I have produced plots of my first successful run. All the plots are with no varying scattering angle and no thermal walk (so the neutron is assumed to be absorbed immediately once thermal).

I am currently testing/debugging the varying angle and the thermal walk and will be done tonight.

Another issue is the run time. This version of the code takes about 5 minutes to run. This is because I have to choose what atom to collide with at each step. I wrote the code that accomplishes this extremely well, but it takes quite a long time. I am thinking of a better/faster way to do this without losing accuracy.

Something I do like are the trends in the data, they seem to make sense if the order of magnitude were correct. Also I like the the number of collisions are so discontinuous and linear. I expected this linearity from my previous simulation. The discontinuity is less obviously explain, but I believe this has to do with the fact if the neutron collides with H it loses half its energy.

Plan:

1. Debug thermal walk

2. Cut down runtime 

12/1/14 Update

Changed code to only include the one significant resonance at 2 keV.

I also changed it such that the neutron is not always absorbed if it is within a resonance but I choose if it scatters or is absorbed by the cross sections. This was tricky but I made a function that gets the job done correctly and with high precision. Essentially I create a list of just 1’s and 2’s and the number of 1’s or 2’s depends on the weighting of which reaction is more likely to occur. This works, but doing this for ever trial takes a lot of time (~3 minutes for one trial). I can speed it up by lowering the number of decimal points I have for my percentages that tell the weighing of each reaction.

I fit the resonance to a function and calculated the area under the curve, then I compared this to the area under my box approximate. I found that my box’s area was only 60% of the fit’s. So I have decided to just use the fitted curve as it is not very hard to put into code.

Using the one resonance, the cross sectional fit (not the box approximation), and with the choosing if the neutron is absorbed or not, I ran a counting experiment. I did this I found that only 1.6% of neutrons are captured by this resonance. So this resonance is not enormously significant but it was valuable to see this.

I am working on doing the next project which is to have multiple substances.

I have fit the XC data  for the C-12, H-3, H.

The format of the program was was to calculate the cross section at each energy first and then separately calculate the mean free path. This works fine for one material, but if I have multiple materials this does not work because the mean free path depends on the cross section but also the number density of the substance the neutron is colliding with. So I need to somehow relate each cross section data point with what substance that cross section was calculated for. I found a fix where I can create a corresponding list that will tell me what substance the cross section was calculated for, so when I calculate the mean free path I know which number density to use. I am in the process of doing this now.

Update 11/11/2014

****Update 3/24/15 I looked at these plots to remind myself how I fit the XC data and discovered these plots are for reactions (z,anything) where z I believe stands for any incident particle. This would be incorrect because we want to look at reactions with a neutron incoming. I checked this out and these XC’s don’t seem to change when a neutron is incoming. So these plots are correct ******

After speaking with Andrea I decided to take a look at my resonance cross section data. Here is what I found:

Screen Shot 2014-11-11 at 6.55.13 PM

 

In the red is the elastic scattering and in the green is the total cross section. It may be hard to see but these lines overlap almost perfectly, especially at the resonates.  Continue reading “Update 11/11/2014”

Update 11/2/14

I found some interesting results after updating my resonance version of my code code so I can run the simulation N times. (When I did not consider any resonances I could run my simulation N times a long time ago, but when I added resonates I ran into some trouble but I found out how to fix that)

First I found 18-19% are captured. These are the plots produced. Continue reading “Update 11/2/14”

Update 10/20/14

Update:

1)  Code is finished product. Made it as general as possible with 6 inputs + cross section fits and resonates data

2) Installed my program to computer and put user manual

3) Looked at resonance widths made much smaller now only fraction get absorbed at high energy

4) Created method to implement scintillator

5) Question for Andrea: In the scintillator are there compounds or are the elements not bound together? What elements are there exactly? Also what distribution of mean free paths should I use? Gaussian?

Plan:

1) Troubleshoot program on lab computer to fix memory issue

2) Fit cross section data for substances from Andrea (straight forward now that I’ve done this before)

3) If compounds, insert into code a function that adds the cross sections together. If separate elements, insert into code a function which picks if the neutron collides with one or the other, which is weighted towards larger nuclei

4) Add the distribution of mean free paths into code (very easy)

5) Find fraction that are absorbed before thermal on average. Put resonates data into finished code and this should work.

I installed my code along with the user manual to “tchita” (the one next to the mac).

I had an issue running the code that has never occurred on my machine. A memory error was called while putting a value into a list. I will proceed by starting the code with a very small neutron energy (1 ev) and see if the code works. If it does then the machine is the issue, in which case I would need find a more efficient way to store data. If it still does not work then there must be an issue in the code, but I doubt this.

Now when I changed the width of the resonance to .02% of the energy of the resonance and made a varying energy loss I found that only some neutrons get absorbed before thermal energies.

Neutron Absorption Energy (width=.0001) Displacement Absorption (width=.0001) Time Absorption (width=.0001) Number Collsions (width=.0001)

I have been reading up on how to find the mean free path for a compound. From what I can find it seems that I can just sum the cross sections of the individual elements to make a new cross section which is the effective cross section. This approximation causes issues when you consider other reactions, but if you only consider collisions then this should be accurate (which is what I do until the neutron is thermal).

 

 

Update 10/6/14

I spoke with Javier and he will check if there is IDLE installed on any computers for my python code.

I have finished most of the Read Me user manual. I am also cleaning up my code so that it is easily read and that it can be used for different substances. This will take some time just because I have three different versions and I would like to combine them all into one code that will be very easy to use.

Applying my code to any other substance should be relatively easy now that I know how to get the information I need. All that would need to be changed is the atomic density N, the cross section fits, and the resonances. I know where and how to get these values so that it will fit in with my code.

Plan

1) Clean up code so that all three versions are clear

2) Finish READ ME

3) Upload Code to computer after Javier installs IDLE

4) Think on how to amend this code such that it can deal with substances which are not pure (scintillators for dark side)

5) Mean free path has some variance that is described by an exponential, ask Andrea exactly what type of distribution should be used.