Esym(n)

3.3. Esym(n)#

In this tutorial, you will learn how to get Esym(n) from an EsymLsym constraints.


Import the libraries that will be employed in this tutorial.

# Import numpy
import numpy as np
# Import matplotlib
import matplotlib.pyplot as plt
# Import nucleardatapy package
import nucleardatapy as nuda

You can simply print out the properties of the nuda’s function that we will use:

# Explore the nucleardatapy module to find the correct attribute
print(dir(nuda.corr.setupEsymDen))
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'print_outputs']

Get the full list of constraints:

constraints, constraints_lower = nuda.corr.EsymLsym_constraints()
print('constraints:',constraints)
constraints: ['2009-HIC', '2010-RNP', '2012-FRDM', '2013-NS', '2014-IAS', '2014-IAS+RNP', '2015-POL-208Pb', '2015-POL-120Sn', '2015-POL-68Ni', '2017-UG', '2021-PREXII-Reed', '2021-PREXII-Reinhard', '2023-PREXII+CREX-Zhang', '2023-EDF-D4', '2023-EDF-D4-IAS', '2023-EDF-D4-IAS-Rnp']

Fix one model for which we want to extract the constraint:

constraint = '2014-IAS'
el = nuda.corr.setupEsymDen( constraint = constraint )

print the outputs:

el.print_outputs()
   constraint: 2014-IAS
   ref: Danielewicz and Lee, NPA 922, 1 (2014)
   label: IAS-2014
   note: Constraints from IAS.
   plot: True
   den:  [0.1  0.12 0.13 0.15 0.16 0.18 0.2  0.21 0.23 0.24 0.26]
   max:  [36.5  36.77 37.03 37.3  38.33 41.67 45.   48.33 51.67 55.   58.33]
   min:  [15.5  18.83 22.17 25.5  28.07 28.33 28.6  28.87 29.13 29.4  29.67]

plot:


constraints, constraints_lower = nuda.corr.EsymLsym_constraints()
print('constraints:',constraints)
constraints: ['2009-HIC', '2010-RNP', '2012-FRDM', '2013-NS', '2014-IAS', '2014-IAS+RNP', '2015-POL-208Pb', '2015-POL-120Sn', '2015-POL-68Ni', '2017-UG', '2021-PREXII-Reed', '2021-PREXII-Reinhard', '2023-PREXII+CREX-Zhang', '2023-EDF-D4', '2023-EDF-D4-IAS', '2023-EDF-D4-IAS-Rnp']

Ksyms = [ -200.0, 0.0, 200 ]
for Ksym in Ksyms:
    nuda.fig.corr_setupEsymDen_fig( pname=None, constraints = constraints, Ksym = Ksym )
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[7], line 3
      1 Ksyms = [ -200.0, 0.0, 200 ]
      2 for Ksym in Ksyms:
----> 3     nuda.fig.corr_setupEsymDen_fig( pname=None, constraints = constraints, Ksym = Ksym )

TypeError: corr_setupEsymDen_fig() missing 1 required positional argument: 'origine'