Nuclei and nuclear masses

A basic data structure for nuclei, class o2scl::nucleus, is implemented as a child of of o2scl::part.

Nuclear masses are given as children of o2scl::nucmass and are generally of two types: tables of masses (children of o2scl::nucmass_table) or formulas which generate masses from a set of parameters and can be fit to data (o2scl::nucmass_fit).

There are eleven mass table types currently included.

The mass formulas which can be fit to data are

In order to create a set of nuclei stored in a std::vector object, one can use o2scl_part::nucdist_set().

Nuclear mass fit example

/* Example: ex_nucmass_fit.cpp
-------------------------------------------------------------------
*/
#include <iostream>
#include <o2scl/test_mgr.h>
#include <o2scl/nucmass_fit.h>
#ifdef O2SCL_HDF
#include <o2scl/hdf_file.h>
#include <o2scl/hdf_nucmass_io.h>
#endif
using namespace std;
using namespace o2scl;
using namespace o2scl_const;
int main(void) {
cout.setf(ios::scientific);
#ifdef O2SCL_HDF
// The RMS deviation of the fit
double res;
// The mass formula to be fitted
// The fitting class
// Load the experimental data
nucdist_set(mf.dist,ame);
// Perform the fit
mf.fit(sem,res);
// Output the results
cout << sem.B << " " << sem.Sv << " " << sem.Ss << " "
<< sem.Ec << " " << sem.Epair << endl;
cout << res << endl;
t.test_gen(res<4.0,"Successful fit.");
#else
cout << "No fitting was performed because O2scl appears not to have been "
<< "compiled with HDF support." << endl;
#endif
t.report();
return 0;
}
// End of example

Nuclear mass example

/* Example: ex_nucmass.cpp
-------------------------------------------------------------------
Demonstrate nuclear mass formulas by comparing them with
the Audi et al. (2012) atomic mass evaluation. This example
computes the absolute deviation in the mass excess.
*/
#include <iostream>
#include <o2scl/test_mgr.h>
#include <o2scl/table_units.h>
#include <o2scl/hdf_file.h>
#include <o2scl/hdf_io.h>
#include <o2scl/hdf_nucmass_io.h>
#include <o2scl/nucmass.h>
#include <o2scl/nucdist.h>
#include <o2scl/nucmass_fit.h>
#include <o2scl/nucmass_dz.h>
#include <o2scl/nucmass_hfb.h>
#include <o2scl/nucmass_wlw.h>
#include <o2scl/nucmass_ktuy.h>
using namespace std;
using namespace o2scl;
using namespace o2scl_const;
using namespace o2scl_hdf;
int main(void) {
cout.setf(ios::scientific);
// ------------------------------------------------------
// The most recent experimental masses from the 2012 AME as a baseline
// ------------------------------------------------------
// Instantiate and load all of the nuclear mass objects. Some of
// them require a separate HDF5 file
nucmass_hfb hfb14;
o2scl_hdf::ame_load(ame03,"03");
nucmass_ktuy ktuy05;
nucmass_wlw ws32("WS3.2");
nucmass_wlw ws36("WS3.6");
// ------------------------------------------------------
// List of pointers to all masses for convenience
static const size_t n_tables=11;
nucmass *massp[n_tables]={&se,&mnmsk,&hfb14,&hfb21,&hfb27,
&ame03,&dz,&ktuy05,&dvi,&ws32,&ws36};
// ------------------------------------------------------
// Create a list of all of the experimental masses
vector<nucleus> ame_dist;
nucdist_set(ame_dist,ame,"N>7 && Z>7");
// ------------------------------------------------------
// Fit the semi-empirical and DvI (2009) mass formulas to
// the 2012 AME data
static const size_t n_fits=2;
// The default number of trials isn't enough for the DvI
// model, so we increase it
mf.def_mmin.ntrial*=10;
// Use the same list as above
mf.dist=ame_dist;
// The RMS deviation in the mass excess
double res;
// Fit both mass formulas
nucmass_fit_base *fitp[n_fits]={&se,&dvi};
for(size_t i=0;i<n_fits;i++) {
mf.fit(*(fitp[i]),res);
}
// ------------------------------------------------------
// Create a table to store the data
tu.line_of_names(((string)"Z N ame se mnmsk hfb14 hfb21 ")+
"hfb27 ame03 dz96 ktuy05 dvi ws32 ws36");
// ------------------------------------------------------
// Fill the table
for(size_t i=0;i<ame_dist.size();i++) {
line.push_back(ame_dist[i].Z);
line.push_back(ame_dist[i].N);
double ame_mass=ame.mass_excess(ame_dist[i].Z,ame_dist[i].N);
line.push_back(ame_mass);
for(size_t j=0;j<n_tables;j++) {
if (massp[j]->is_included(ame_dist[i].Z,ame_dist[i].N)) {
double val=ame_mass-
massp[j]->mass_excess(ame_dist[i].Z,ame_dist[i].N);
line.push_back(val);
} else {
line.push_back(0.0);
}
}
tu.line_of_data(line);
}
// ------------------------------------------------------
// Output the table to a file
hf.open_or_create("ex_nucmass_table.o2");
hdf_output(hf,tu,"nuclear_masses");
hf.close();
t.report();
return 0;
}
// End of example

ex_nucmass_se.png
ex_nucmass_mnmsk.png
ex_nucmass_dz96.png
ex_nucmass_ame03.png
ex_nucmass_hfb14.png
ex_nucmass_hfb21.png
ex_nucmass_hfb27.png
ex_nucmass_ktuy05.png
ex_nucmass_dvi.png
ex_nucmass_ws32.png
ex_nucmass_ws36.png

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).