Пример #1
0
    cPickle.dump(eos_success_maxmass,f_file)
    f_file.close()
    
    f_file=open(path+dir_name+'/Lambda_hadronic_calculation_eos_flat_logic.dat','wb')
    cPickle.dump(eos_flat_success[eos_success_maxmass[eos_success_logic]],f_file)
    f_file.close()
    
    print('Calculating properities of 1.4 M_sun star...')
    f_onepointfour_result=path+dir_name+'/Lambda_hadronic_calculation_onepointfour.dat'
    Properity_onepointfour=main_parallel(Calculation_onepointfour,eos_flat_success[eos_success_maxmass[eos_success_logic]],f_onepointfour_result,error_log)
    print('properities of 1.4 M_sun star of %d EoS calculated.' %(len(eos_flat_success[eos_success_maxmass[eos_success_logic]])))
    
    print('Calculating mass, compactness and tidal Lambda...')
    f_mass_beta_Lambda_result=path+dir_name+'/Lambda_hadronic_calculation_mass_beta_Lambda.dat'
    mass_beta_Lambda_result=main_parallel(Calculation_mass_beta_Lambda,eos_flat_success[eos_success_maxmass[eos_success_logic]],f_mass_beta_Lambda_result,error_log)
    print('mass, compactness and tidal Lambda of %d EoS calculated.' %(len(eos_flat_success[eos_success_maxmass[eos_success_logic]])))
    
    print('Calculating binary neutron star...')
    f_chirpmass_Lambdabeta6_result=path+dir_name+'/Lambda_hadronic_calculation_chirpmass_Lambdabeta6.dat'
    chirp_q_Lambdabeta6_Lambda1Lambda2=main_parallel(Calculation_chirpmass_Lambdabeta6,np.concatenate((mass_beta_Lambda_result,np.tile(Properity_onepointfour[:,3],(40,1,1)).transpose()),axis=1),f_chirpmass_Lambdabeta6_result,error_log)

    if(show_plot==True):
        import matplotlib.pyplot as plt
        import show_properity
        fig, axes = plt.subplots(1, 1,figsize=(8,6),sharex=True,sharey=True)
        show_properity.show_eos(axes,eos[eos_success],0,5,500,baryon_density_range=[0.01,2,'log'])
    
        from plot_logic import plot_5D_logic
        import matplotlib.pyplot as plt
        plot_5D_logic(np.logical_not(logic_causality_stability[:,:,:,:]),args[:,:,:,:,:],['E','L','$\Lambda$','$\kappa$'],(0,2,1,3),figsize=(16,15))
        plot_5D_logic(np.logical_not(eos_success[:,:,:,:]),args[:,:,:,:,:],['E','L','$\Lambda$','$\kappa$'],(0,2,1,3),figsize=(16,15))
Пример #2
0
Lambda_binary_beta6 = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 2]
Lambda2Lambda1 = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 3]
Lambda2Lambda1q6 = Lambda2Lambda1 * q**6

args_txt = ['E', 'L', '$\Lambda$', '$\kappa$']
args_txt_unit = ['MeV', 'MeV', 'MeV', '']
args_order = (0, 2, 1, 3)
args_show = args[:, :, :, ::5, :]
eos_logic_show = eos_logic[:, :, ::5, :]
eos_success_show = eos_success[:, :, ::5, :]
logic_show = logic[:, :, ::5, :]
from plot_logic import plot_5D_logic

plot_5D_logic(eos_logic_show,
              args_show,
              args_txt,
              args_order,
              figsize=(16, 15))
plot_5D_logic(eos_success_show,
              args_show,
              args_txt,
              args_order,
              figsize=(16, 15))
plot_5D_logic(logic_show, args_show, args_txt, args_order, figsize=(16, 15))

Properity_onepointfour_show = Properity_onepointfour[5, :, :, ::5, :]
maxmass_result_show = maxmass_result[1, :, :, ::5, :]
from plot_contour import plot_5D_contour, reverse_colourmap
from matplotlib import cm

fig1, axis1 = plot_5D_contour(Properity_onepointfour_show,
Пример #3
0
# tmp[eos_logic]=logic_p1_374
# logic_p1_374=tmp
# tmp=np.copy(eos_logic)
# tmp[eos_logic]=logic_p1_85
# logic_p1_85=tmp
# =============================================================================

chirp_mass = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 0]
q = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 1]
Lambda_binary_beta6 = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 2]
Lambda2Lambda1 = chirp_q_Lambdabeta6_Lambda1Lambda2[:, 3]
Lambda2Lambda1q6 = Lambda2Lambda1 * q**6

from plot_logic import plot_5D_logic
plot_5D_logic(np.logical_not(eos_logic[:, ::3, :, ::2]),
              args[:, :, ::3, :, ::2], ['$m_{eff}$', 'J', 'L', '$\zeta$'],
              (1, 3, 2, 0),
              figsize=(16, 15))
plot_5D_logic(np.logical_not(eos_success[:, ::3, :, ::2]),
              args[:, :, ::3, :, ::2], ['$m_{eff}$', 'J', 'L', '$\zeta$'],
              (1, 3, 2, 0),
              figsize=(16, 15))
plot_5D_logic(np.logical_not(logic[:, ::3, :, ::2]),
              args[:, :, ::3, :, ::2], ['$m_{eff}$', 'J', 'L', '$\zeta$'],
              (1, 3, 2, 0),
              figsize=(16, 15))

from plot_contour import plot_5D_contour, reverse_colourmap
from matplotlib import cm
fig1, axis1 = plot_5D_contour(Properity_onepointfour[5, :, ::3, :, ::2],
                              args[:, :, ::3, :, ::2],
                              ['$m_{eff}$', 'J', 'L', '$\zeta$'], (1, 3, 2, 0),
Пример #4
0
    np.array([
        E_L_array_matching_upper[:, 0], E_L_array_matching_upper[:, 1],
        E_L_array_matching_lower_lambda_over_2[:, 1],
        E_L_array_matching_lower[:, 1]
    ]).transpose())
np.savetxt(
    'E_L_absolute_bound.txt',
    np.array(
        [E_L_array_upper[:, 0], E_L_array_upper[:, 1],
         E_L_array_lower[:, 1]]).transpose())

dirctory = 'test_matching/'
import matplotlib.pyplot as plt
from plot_logic import plot_5D_logic
fig = plot_5D_logic(eos_matching_success,
                    args[3:5], ['J', 'L'], (0, 1),
                    figsize=(8, 6))
plt.plot(E_L_array_upper[:, 0],
         E_L_array_upper[:, 1],
         label='MC upper bound',
         lw=3)
plt.plot(E_L_array_lower[:, 0],
         E_L_array_lower[:, 1],
         label='MP lower bound',
         lw=3)
plt.plot(E_L_array_matching_upper[:, 0],
         E_L_array_matching_upper[:, 1],
         label='Matching upper bound',
         lw=3)
plt.plot(E_L_array_matching_lower_lambda_over_2[:, 0],
         E_L_array_matching_lower_lambda_over_2[:, 1],
Пример #5
0
 # 
 # print('Calculating mass, compactness and tidal Lambda...')
 # f_mass_beta_Lambda_result=path+dir_name+'/Lambda_hadronic_calculation_mass_beta_Lambda.dat'
 # mass_beta_Lambda_result=main_parallel(Calculation_mass_beta_Lambda,eos_flat_success[eos_success_maxmass[eos_success_logic]],f_mass_beta_Lambda_result,error_log)
 # print('mass, compactness and tidal Lambda of %d EoS calculated.' %(len(eos_flat_success[eos_success_maxmass[eos_success_logic]])))
 # 
 # print('Calculating binary neutron star...')
 # f_chirpmass_Lambdabeta6_result=path+dir_name+'/Lambda_hadronic_calculation_chirpmass_Lambdabeta6.dat'
 # chirp_q_Lambdabeta6_Lambda1Lambda2=main_parallel(Calculation_chirpmass_Lambdabeta6,np.concatenate((mass_beta_Lambda_result,np.tile(Properity_onepointfour[:,3],(40,1,1)).transpose()),axis=1),f_chirpmass_Lambdabeta6_result,error_log)
 # 
 # 
 # =============================================================================
 if(show_plot==True):
     from plot_logic import plot_5D_logic
     import matplotlib.pyplot as plt
     plot_5D_logic(np.logical_not(eos_args_logic[:,::3,:,::4]),args[:,:,::3,:,::4],['$m_{eff}$','J','L','$\zeta$'],(1,3,2,0),figsize=(16,15))
     plot_5D_logic(np.logical_not((PNM_saturation_logic[:,::3,:,::4])),args[:,:,::3,:,::4],['$m_{eff}$','J','L','$\zeta$'],(1,3,2,0),figsize=(16,15))
     
     
     for L_i_min in [0,2,3]:
         plt.figure(figsize=(10,6))
         plt.plot(PNM_saturation[0,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]],PNM_saturation[1,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]],'.',label='PNM')
         plt.plot((m-BindE+args[1,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]])*baryon_density_s,args[2,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]]*baryon_density_s/3,'.',label='SNM')
         plt.xlabel('$(m-BE+J)n_s$ or $\\varepsilon _s$(MeV fm$^{-3}$)',fontsize=20)
         plt.ylabel('$Ln_s/3$ or $p_s$(MeV fm$^{-3}$)',fontsize=20)
         #plt.xlim(142.5,145)
         #plt.ylim(-4,6)
         plt.title('SNM expansion vs PNM at saturation \n(%.2f MeV<L<%.2f MeV)'%(args[2,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]].min(),args[2,:,:,L_i_min:][PNM_saturation_logic[:,:,L_i_min:]].max()),fontsize=25)
         plt.legend(fontsize=20)