PHYSICS 580 Fall 2015 Project #3 due 11:59 pm Monday Oct 19, 2015 Linear least-squared fit – nuclear binding energies and drip lines You have just been received a NASA grant to investigate stellar nucleosynthesis. Among the most important inputs into nucleosynthesis are nuclear binding energies. The binding energy of a nucleus is the amount of energy released when a nucleus is formed from its constituent protons and neutrons, or conversely how much energy could be released if a nucleus were totally disassembled. For a nucleus with Z protons and N neutrons, we define m(Z,N) c2 = Z mp c2 + N mn c2 - BE(Z,N) where mp is the mass of the proton and mn is the mass of the neutron. Luckily for you, tabulation of masses of many nuclides exist. However, there exist short-lived isotopes whose masses are unknown and difficult if not impossible to measure, yet are important for nucleosynthesis. Of particular importance are the neutron and proton drip-lines. A positive binding energy means a nucleus can exist, even if only for a fraction of a second, while a negative binding energy means a nucleus cannot exist. The drip-lines are defined by the last bound nuclides: the neutron drip line is the line where, for each Z, N is the biggest value for which BE(Z,N) > 0, and similarly for the proton drip-line. (Just to make things tough, sometimes a bound nuclide can be isolated, i.e., there could be an unbound nuclide between it and the next bound nuclide.) Fortunately, we can estimate the location of the drip-lines by using the semi-empirical mass formula: 𝐵(𝑍, 𝑁) = 𝑐!"# 𝐴 + 𝑐!"#$ 𝐴!/! + 𝑐!"# 𝑁−𝑍 𝐴 ! + 𝑐!"#$ 𝑍(𝑍 − 1) + 𝑐!"#$ 𝐴!!/! 𝛿(𝑍, 𝑁) 𝐴!/! where A = Z+N is the mass number, and 𝛿(𝑍, 𝑁) = +1 if Z and N are both even, = -1 if Z and N are both odd, and = 0 if A is odd. I will give you data in the form of Z N BE(Z,N) ΔBE(Z,N) where ΔBE(Z,N) is the uncertainty in the binding energy. To find the best coefficient cvol, csurf, etc, which we write in the form 1/3 𝐵𝐸! = ! !!! 𝑐! 𝑔! 𝑍! , 𝑁! where the functions g are (Z+N), (Z+N) , etc. Although in the above K=5, you should not hardcode K=5 as you may need a different K for other projects (for example, the advanced project). To find the coefficients, form the square, K by K matrix PHYS 580 Fall 2015 Project 3 page 2/4 ! !!! 𝑔! 𝐴!" = 𝑍! , 𝑁! 𝑔! 𝑍! , 𝑁! , where M is the number of data points in your set. (You will also want to not hardcode M). Then solve ! ! 𝐴!" 𝑐! = !!! 𝑔! 𝑍! , 𝑁! 𝐵𝐸 𝑍! , 𝑁! !!! by using the LUDCOMP and LUBKSB routines provided on the class webpage. The input files (posted on the class web page) have the following format: 1015 ! # of nuclear binding energies in file, this is M 1 1 2224.2 0.2 ! Z N BE delta BE 1 2 8481.3 0.6 ... etc. All binding energies and their uncertainties are in keV. Your code should do the following: 1. Ask for the name of an input file (see below) 2. Solve for the coefficients cvol etc and print them to screen (and, if useful, to a file) 3. Ask the user for some input Z,N 4. Print out the calculated binding energy for the given Z,N The above is for 2.5 out of 3.0 for the basic project. For an addition 0.5, include the uncertainty (error bars) and compute the uncertainty in the coefficients and in the final binding energy. If σi is the error bar in the ith binding energy (i.e., is ΔBE(Zi,Ni), then the formulas above are modified as follows: ! 𝐴!" = 𝑔! 𝑍! , 𝑁! !!! and ! ! 𝐴!" 𝑐! = !!! 1 𝑔 𝑍 ,𝑁 𝜎!! ! ! ! 𝑔! 𝑍! , 𝑁! !!! 1 𝐵𝐸 𝑍! , 𝑁! 𝜎!! This code should do the following: 1. Ask for the name of an input file (see below) 2. Solve for the coefficients cvol etc and print them to screen (and, if useful, to a file) including the uncertainties 3. Ask the user for some input Z,N 4. Print out the calculated binding energy for the given Z,N, including the uncertainty. The error in in the coefficient ci is given by the diagonal matrix elements of the inverse of A, that is, Δ𝑐!! = 𝐴!! !! PHYS 580 Fall 2015 Project 3 page 3/4 The fundamental formula for propagation of uncertainties is: if f depends upon some parameters ci, then the error in f is 𝜕𝑓 ! ! ! ∆𝑓 = ∆𝑐! 𝜕𝑐! ! For full credit, your program should be well-commented, and input and output clear and easy to use. (A sample input file would be helpful.) You should design how to input the data; the best method is to have the code read in the data file, rather than typing it in by hand. Here is a bit of useful code (you may use this) to read in a file that you name: character*15 filename integer ilast . . . write(6,*)' Enter name of file to be read in' read(5,'(a)')filename ilast = index(filename,' ')-1 open(unit=1,file=filename(1:ilast),status='old') . ********************************************** Submission: To make identification easier for me please use the convention lastname_proj3.f for your program. Be sure to include all the files needed to compile and run. For my convenience, include in your submission the matinv.f file or whatever you use for LU decomposition. Also include: your solutions. You can put this in a file or in your e-mail. You may test your code by swapping data with your fellow students and comparing output. (Indeed, this is probably a good idea.) The project is due Monday, Oct 19 at midnight (11:59 pm). I will send back comments to give you a chance to resubmit. This is the last project with automatic resubmission. Advanced project: physics. Part 1 (worth 0.5) Find the driplines. The driplines are defined by the minimum and maximum values of N which are stable, for a given Z, that is, for which BE(Z,N) > 0. For this advanced project, plot the valley of stability (that is, the isotope or value of N for each Z which has the largest binding energy) and the proton and neutron driplines. It should look qualitatively, though not quantitatively, like this (The convention is to have N along the x-axis and Z along the y-axis; you should follow it too. Your graphs may be slightly less smooth due to the pairing term): PHYS 580 Fall 2015 Project 3 page 4/4 Part II (worth 0.5): Evidence for shell structure. If you compare the experimental binding energies (the input from the data file) with your calculated binding energies, you will find there are significant deviations, much larger than either the experimental errors or your calculated theoretical uncertainties. This is because of systematic variations not included in the semi-empirical formula, namely the existence of shells. Plot the deviation of the theoretical binding energy (include the theoretical error bars) from the experimental binding energy. Do not take the absolute value; the deviations will be both positive and negative. Make two plots: the deviation as a function of Z, and another as a function of N. You will mostly have multiple points for each value of Z and N, and that's okay. You should see deviations peaking around the so-called magic numbers. Super-fun extra credit: (worth 10%) Invent your own term for the semi-empirical formula, some function of Z and N. (Do not copy anyone else's term.) You must use uncertainties. See if it improves the fit by computing the reduced χ2 for your data set, that is, ! ! 𝜒!"# = !!! ! ! !!! !!" ! ! ! 𝐵𝐸!!"#$ − 𝐵𝐸 !"# (𝑍! , 𝑁! ) , where M -K is called the degrees of freedom. Note that in your original fit K=5 but now you will have K=6. Finally, for full credit, plot your new, improved driplines. The person who submits an improved binding energy formula with the best verifiable (by me) improvement in reduced χ2 will get an additional 10% credit! Note: there may be a follow-on project where you reuse your code so document well!