6 import matplotlib.pyplot as plt
8 from scipy.optimize import curve_fit
14 aa=np.float128(10**(-gg-2)*a)
15 Tr=np.float128(t_bath)
16 return np.exp( np.log(aa) + (gg-2)/2*np.log(x) - gg*x/(2*Tr) )
17 # return aa * ( x**((gg-2)/2) * np.exp( -gg*x/(2*Tr) ) )
19 #x,y= np.loadtxt('1L2Y_L_GB000.stat',usecols=(0,10),skiprows=30,unpack=True)
20 #x,y= np.loadtxt('1L2Y_NH_GB000.stat',usecols=(0,11),skiprows=10000,unpack=True)
21 #x,y= np.loadtxt('1L2Y_B_GB000.stat',usecols=(0,10),skiprows=30,unpack=True)
23 t_bath=float(sys.argv[2])
24 with open('md.stat','r') as f:
27 ncolumns=len(line.split())
30 x,y= np.loadtxt('md.stat',usecols=(0,10),skiprows=10,unpack=True)
31 x1,e,r,gy,nc= np.loadtxt('md.stat',usecols=(0,3,5,12,6),skiprows=0,unpack=True)
33 x,y= np.loadtxt('md.stat',usecols=(0,6),skiprows=10,unpack=True)
34 x1,e,gy= np.loadtxt('md.stat',usecols=(0,3,8),skiprows=0,unpack=True)
36 h,bin=np.histogram(y,bins=50,density=True)
38 plt.bar(bin[:-1], h, width = bin[2]-bin[1])
39 plt.xlim(min(bin), max(bin))
41 plt.ylabel('probality')
42 plt.xlabel('temperature')
44 center = (bin[:-1] + bin[1:]) / 2
47 popt, pcov = curve_fit(prob_T, center, h)
48 xfine = np.linspace(min(bin), max(bin), 100)
51 chi_squared = np.sum((prob_T(center, *popt)-h)**2)
52 print '%15.10f' % chi_squared
55 #print prob_T(xfine,popt[0])
56 plt.plot(xfine,prob_T(xfine,popt[0]),'-',c='red')
57 plt.savefig('temp_hist.png')
62 plt.ylabel('potential energy')
64 plt.savefig('md_ene.png')
68 plt.ylabel('radius of gyration')
70 plt.savefig('md_gyr.png')
77 plt.savefig('md_rms.png')
81 plt.ylabel('fraction of native side-chain concacts')
83 plt.savefig('md_fracn.png')