3 import matplotlib.pyplot
as plt
5 fig, ax = plt.subplots(2,1,figsize=(5,5),sharex=
True)
6 plt.subplots_adjust(hspace=0)
7 time,temp,rho = np.loadtxt(
"mainout.dat",unpack=
True,usecols=[1,2,3])
10 ax[0].plot(time-time[0],rho/1e6,color=
"tab:blue",lw=4,alpha=0.7,label=
"WinNet")
11 ax[1].plot(time-time[0],temp,color=
"tab:red",lw=4,alpha=0.7)
17 T9_analytic =
lambda x: 2.4*(R0)**(-3./4.)*np.exp(-x/ (3*(446/np.sqrt(7*rho_0))))
18 rho_analytic =
lambda x: 7*rho_0 *np.exp(-x / (446/np.sqrt(7*rho_0)))
21 ax[0].plot(time-time[0],rho_gridpoint/1e6,ls=
"--",color=
"k",label=
"Analytic")
22 ax[1].plot(time-time[0],T9_gridpoint,ls=
"--",color=
"k")
25 fig2 = plt.figure(figsize=(5,3))
27 A,X = np.loadtxt(
"finabsum.dat",unpack=
True,usecols=[0,2])
32 ax2.set_title(
"Final mass fractions")
33 ax2.set_ylabel(
"Mass fraction X")
34 ax2.set_xlabel(
"Mass number A")
37 ax[0].set_ylabel(
r"$\rho$ [10$^6$ g cm$^{-3}$]")
38 ax[1].set_ylabel(
"T[GK]")
39 ax[1].set_xlabel(
"Time [s]")
42 fig2.savefig(
"final_massfractions.pdf",bbox_inches=
"tight")