def quadratic_results():
    
    global EM_par_SM_1, EM_par_SM_2 , EM_par_NM_1 , EM_par_NM_2
    EM_par_SM_1, EM_par_SM_2 , EM_par_NM_1 , EM_par_NM_2 = EM.EM_results()
    
    
    global d,e
    d,e = read_data()
    
 
    global td,te
    td,te = interpolation()
    

    global e_sym2
    e_sym2 = e_sym2_delta()

    global esym2_eta
    esym2_eta,esym4_eta = e_sym2_eta()

    global e_sym2_av,e_sym2_pot_av,e_sym2_pot_eff_av,s
    global e_sym2_eta_av,e_sym2_eta_pot_av,e_sym2_eta_pot_eff_av,s_eta
    e_sym2_av,e_sym2_pot_av,e_sym2_pot_eff_av,s,\
    e_sym2_eta_av,e_sym2_eta_pot_av,e_sym2_eta_pot_eff_av,s_eta = data_preperation()
    

    global f_esym2_c,e_sym2_par,e_sym2_eta_par
    f_esym2_c,e_sym2_par,e_sym2_eta_par = Analyse_e_sym2()
    
    return d,e,td,te,e_sym2,esym2_eta,esym4_eta,e_sym2_av,e_sym2_eta_av,f_esym2_c,e_sym2_par,e_sym2_eta_par
Ejemplo n.º 2
0
def main():

    # Import results from Effective Mass module
    # EM = Effective Mass; par = Best fit parameter values
    # SM = Symmetric matter; NM = Neutron matter
    global EM_par_SM_1, EM_par_NM_1
    EM_par_SM_1, _, EM_par_NM_1, _ = EM.EM_results()

    # Import results from symmetry energy module
    # Refer to this module for explanation of variables
    global te_SM_av, te_NM_av, f_SM, SM3_par, f_NM, NM3_par
    te_SM_av, te_NM_av, f_SM, SM3_par, f_NM, NM3_par = symmetry_energy.e_sym_results(
    )

    # Import results from quadratic_symmetry energy module
    # Refer to this module for explanation of variables
    global d, e, td, te, e_sym2, esym2_eta, esym4_eta, e_sym2_av, e_sym2_eta_av, f_esym2_c, e_sym2_par, e_sym2_eta_par
    d, e, td, te, e_sym2, esym2_eta, esym4_eta, e_sym2_av, e_sym2_eta_av, f_esym2_c, e_sym2_par, e_sym2_eta_par = quadratic_symmetry_energy.quadratic_results(
    )

    # Calculate and plot non-quadratic symmetry energies
    plot_e_symnq()

    # Calculate and plot Final residuals of the fit wrt the data
    plot_residues()

    # Print best fit value of parameters
    print('----------Delta----------')
    print("E_sym,nq = ",
          NM3_par['E_sat+E_sym'] - SM3_par['E_sat'] - e_sym2_par['E_sym2'])
    print("L_sym,nq = ", NM3_par['L_sym'] - e_sym2_par['L_sym2'])
    print("K_sym,nq = ",
          NM3_par['K_sat+K_sym'] - SM3_par['K_sat'] - e_sym2_par['K_sym2'])
    print("Q_sym,nq = ",
          NM3_par['Q_sat+Q_sym'] - SM3_par['Q_sat'] - e_sym2_par['Q_sym2'])
    print("Z_sym,nq = ",
          NM3_par['Z_sat+Z_sym'] - SM3_par['Z_sat'] - e_sym2_par['Z_sym2'])

    print('----------Eta----------')
    print("E_sym,nq = ",
          NM3_par['E_sat+E_sym'] - SM3_par['E_sat'] - e_sym2_eta_par['E_sym2'])
    print("L_sym,nq = ", NM3_par['L_sym'] - e_sym2_eta_par['L_sym2'])
    print("K_sym,nq = ",
          NM3_par['K_sat+K_sym'] - SM3_par['K_sat'] - e_sym2_eta_par['K_sym2'])
    print("Q_sym,nq = ",
          NM3_par['Q_sat+Q_sym'] - SM3_par['Q_sat'] - e_sym2_eta_par['Q_sym2'])
    print("Z_sym,nq = ",
          NM3_par['Z_sat+Z_sym'] - SM3_par['Z_sat'] - e_sym2_eta_par['Z_sym2'])

    print('----------Fit to E_sym4 without meta-model----------')
    e_sym4_eta_par = Fit_e_sym4_eta()
    print(e_sym4_eta_par)
    print('----------Fit to E_symnq without meta-model----------')
    e_symnq_eta_par = Fit_e_symnq_eta()
    print(e_symnq_eta_par)
def main():
    
    # Import results from Effective Mass module 
    # EM = Effective Mass; par = Best fit parameter values
    # SM = Symmetric matter; NM = Neutron matter
    # 1 = liner fit; 2 = quadratic fit
    global EM_par_SM_1, EM_par_SM_2 , EM_par_NM_1 , EM_par_NM_2
    EM_par_SM_1, EM_par_SM_2 , EM_par_NM_1 , EM_par_NM_2 = EM.EM_results()
    
    
    # Read input data of energy/particle
    # d =density, e = energy
    global d,e
    d,e = read_data()
    
    # Perform interpolation to go to uniform grid in density
    # td = target density with unifrom grid, te = target energy    
    global td,te
    td,te = interpolation()
    
    
    # Extract e_sym2 from data using delta expansion
    global e_sym2
    e_sym2 = e_sym2_delta()

    # Extract e_sym2 from data using eta expansion
    global esym2_eta
    esym2_eta,_ = e_sym2_eta()


    # Prepare data for fitting and plotting
    # av refers to an average over the 6 Hamiltonians
    # s refers to svd cut imposed to regulate 0 eigenvalues of correlation matrix obtained during the averaging
    # eta refers to the expansion around NM. Absence of eta implies expansion around SM.
    global e_sym2_av,e_sym2_pot_av,e_sym2_pot_eff_av,s
    global e_sym2_eta_av,e_sym2_eta_pot_av,e_sym2_eta_pot_eff_av,s_eta
    e_sym2_av,e_sym2_pot_av,e_sym2_pot_eff_av,s,\
    e_sym2_eta_av,e_sym2_eta_pot_av,e_sym2_eta_pot_eff_av,s_eta = data_preperation()
    
    
    # Fit to e_sym2 obtained above
    # f_esym2_c = Fit function; e_sym2_par = Best Fit parameters for delta expansion
    # e_sym2_eta_par =  Best Fit parameters for eta expansion
    global f_esym2_c,e_sym2_par,e_sym2_eta_par
    f_esym2_c,e_sym2_par,e_sym2_eta_par = Analyse_e_sym2()

    # Plot e_sym2 for the two expansions and also the difference
    plot_e_sym2()
    
    
    # Print best fit parameter values.
    print ('\n','-----Delta----')
    print (e_sym2_par)
    print ('\n','-----Eta-----')
    print (e_sym2_eta_par)
def e_sym_results():
    global EM_par_SM_1, EM_par_SM_2, EM_par_NM_1, EM_par_NM_2
    EM_par_SM_1, EM_par_SM_2, EM_par_NM_1, EM_par_NM_2 = EM.EM_results()

    global e_SM, e_NM, d_SM, d_NM, te_SM, te_NM, td
    e_SM, e_NM, d_SM, d_NM, te_SM, te_NM, td = SM_NM.SM_NM_results()

    global te_SM_av, te_NM_av, ts_SM, ts_NM, te_SM_pot_av
    global te_NM_pot_av, te_SM_pot_eff_av, te_NM_pot_eff_av
    global te_SM_pot_eff_1_av, te_NM_pot_eff_1_av
    te_SM_av,te_NM_av,ts_SM,ts_NM,te_SM_pot_av,\
    te_NM_pot_av,te_SM_pot_eff_av,te_NM_pot_eff_av,\
    te_SM_pot_eff_1_av,te_NM_pot_eff_1_av = data_preparation()

    global f_SM, SM3_par
    f_SM, SM3_par = Analyse_SM()

    global f_NM, NM3_par
    f_NM, NM3_par = Analyse_NM()

    return te_SM_av, te_NM_av, f_SM, SM3_par, f_NM, NM3_par
def main():

    # Import results from Effective Mass module
    # EM = Effective Mass; par = Best fit parameter values
    # SM = Symmetric matter; NM = Neutron matter
    # 1 = liner fit; 2 = quadratic fit
    global EM_par_SM_1, EM_par_SM_2, EM_par_NM_1, EM_par_NM_2
    EM_par_SM_1, EM_par_SM_2, EM_par_NM_1, EM_par_NM_2 = EM.EM_results()

    # Import results from SM_NM module
    # e_SM and e_NM are energy/particle in symmetric and neutron matter
    # d_SM and d_NM are the correspondind densities
    # td = target density with unifrom grid
    # te_SM, te_NM = target energies corresponding to td.
    global e_SM, e_NM, d_SM, d_NM, te_SM, te_NM, td
    e_SM, e_NM, d_SM, d_NM, te_SM, te_NM, td = SM_NM.SM_NM_results()

    # Prepare data for fitting and plotting
    # av refers to an average over the 6 Hamiltonians
    # s refers to svd cut imposed to regulate 0 eigenvalues of correlation matrix obtained during the averaging
    global te_SM_av, te_NM_av, ts_SM, ts_NM, te_SM_pot_av
    global te_NM_pot_av, te_SM_pot_eff_av, te_NM_pot_eff_av
    global te_SM_pot_eff_1_av, te_NM_pot_eff_1_av
    te_SM_av,te_NM_av,ts_SM,ts_NM,te_SM_pot_av,\
    te_NM_pot_av,te_SM_pot_eff_av,te_NM_pot_eff_av,\
    te_SM_pot_eff_1_av,te_NM_pot_eff_1_av = data_preparation()

    # Fit to energy per particle in SM.
    # This performs Scaling 3*
    global f_SM, SM3_par
    f_SM, SM3_par = Analyse_SM()

    # Fit to energy per particle in NM.
    # This performs Scaling 3*
    global f_NM, NM3_par
    f_NM, NM3_par = Analyse_NM()

    # Calculate and plot e_sym
    calculate_and_plot_esym()