Nuclei and Nuclear Masses

O2scl

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

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 ten 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) {
  test_mgr t;
  t.set_output_level(1);
  
  cout.setf(ios::scientific);

#ifdef O2SCL_HDF

  // The RMS deviation of the fit
  double res;
  // The mass formula to be fitted
  nucmass_semi_empirical sem;
  // The fitting class
  nucmass_fit mf;

  // Load the experimental data
  nucmass_ame ame;
  o2scl_hdf::ame_load(ame,"12");
  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);

  test_mgr t;
  t.set_output_level(2);

  // ---------------------------------------------------------------
  // The most recent experimental masses from the 2016 AME as a
  // baseline. The flag 'true' at the end ensures only experimentally
  // measured masses are included.

  nucmass_ame ame;
  o2scl_hdf::ame_load(ame,"16",true);

  // ---------------------------------------------------------------
  // Instantiate and load all of the nuclear mass objects. Some of
  // them require a separate HDF5 file

  nucmass_semi_empirical se;
  nucmass_mnmsk mnmsk;
  o2scl_hdf::mnmsk_load(mnmsk);
  nucmass_hfb hfb14;
  o2scl_hdf::hfb_load(hfb14,14);
  nucmass_hfb_sp hfb21;
  o2scl_hdf::hfb_sp_load(hfb21,21);
  nucmass_hfb_sp hfb27;
  o2scl_hdf::hfb_sp_load(hfb27,27);
  nucmass_ame ame03;
  o2scl_hdf::ame_load(ame03,"03",true);
  nucmass_dz_table dz;
  nucmass_ktuy ktuy05;
  ktuy05.load("05");
  nucmass_dvi dvi;
  nucmass_wlw ws32;
  ws32.load("WS3.2");
  nucmass_wlw ws36;
  ws36.load("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;
  nucmass_fit mf;
  // 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

  table_units<> tu;
  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++) {
    vector<double> line;
    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

  hdf_file hf;
  hf.open_or_create("ex_nucmass_table.o2");
  hdf_output(hf,tu,"nuclear_masses");
  hf.close();
 
  t.report();
  return 0;
}
// End of example

se

mnmsk

dz96

ame03

hfb14

hfb21

hfb27

ktuy05

dvi

ws32

ws36