Ts100 = compute_running_average(Ts, 100) p.new(title='Temperature (from t=100)', xlabel='time', ylabel='temperature') p.plot(ts, Ts, label='T') p.plot(ts10, Ts10, label='running av 10') p.plot(ts100, Ts100, label='running av 100') # Pressure #Average Ps10 = compute_running_average(Ps, 10) Ps100 = compute_running_average(Ps, 100) p.new(title='Pressure (from t=100)', xlabel='time', ylabel='pressure') p.plot(ts, Ps, label='P') p.plot(ts10, Ps10, label='running av 10') p.plot(ts100, Ps100, label='running av 100') # RDF #Average l = min(len(traj), 100) m = N * (N - 1) / 2 dist = np.empty(l * m) for i in range(1, l + 1): dist[(i - 1) * m:i * m] = compute_distances(traj[-i]) p.new(title='RDF (last 100 trajectories)', xlabel='distance', ylabel='probability') p.hist(dist, bins=100, range=(0.8, 5), normed=True, log=False, label='RDF') p.make(ncols=2) print "Finished."
p.plot(tpart[-1, 0, n], tpart[-1, 1, n], "o", c=colors[n], alpha=0.8, ms=7, mew=2) # Total energy p.new(xlabel="time", ylabel="energy") p.plot(ts, Es, label="Eges") # Energies p.new(xlabel="time", ylabel="energy") p.plot(ts, Ekins, label="Ekin") p.plot(ts, Es, label="Eges") p.plot(ts, Epots, label="Epot") # Temperature p.new(xlabel="time", ylabel="temperature") p.plot(ts, Ts, label="T") # Pressure p.new(xlabel="time", ylabel="pressure") p.plot(ts, Ps, label="P") # RDF datafile = open(datafilename, "r") ts, Es, Epots, Ekins, Ts, Ps, traj2 = pickle.load(datafile) datafile.close() p.new(xlabel="distance", ylabel="probability") p.hist(compute_distances(traj2[-1]), bins=100, range=(0.8, 5), normed=True, log=False, label="RDF") p.make(ncols=3) print "Finished."
#Average Ts10=compute_running_average(Ts, 10) Ts100=compute_running_average(Ts, 100) p.new(title='Temperature (from t=100)',xlabel='time',ylabel='temperature') p.plot(ts,Ts, label='T') p.plot(ts10,Ts10, label='running av 10') p.plot(ts100,Ts100, label='running av 100') # Pressure #Average Ps10=compute_running_average(Ps, 10) Ps100=compute_running_average(Ps, 100) p.new(title='Pressure (from t=100)', xlabel='time',ylabel='pressure') p.plot(ts,Ps, label='P') p.plot(ts10,Ps10, label='running av 10') p.plot(ts100,Ps100, label='running av 100') # RDF #Average l = min(len(traj),100) m = N*(N-1)/2 dist = np.empty(l*m) for i in range(1,l+1): dist[(i-1)*m:i*m] = compute_distances(traj[-i]) p.new(title='RDF (last 100 trajectories)', xlabel='distance',ylabel='probability') p.hist(dist, bins=100, range=(0.8,5), normed=True, log=False, label='RDF') p.make(ncols= 2) print "Finished."
# Energies p.new(xlabel='time', ylabel='energy') p.plot(ts, Ekins, label='Ekin') p.plot(ts, Es, label='Eges') p.plot(ts, Epots, label='Epot') # Temperature p.new(xlabel='time', ylabel='temperature') p.plot(ts, Ts, label='T') # Pressure p.new(xlabel='time', ylabel='pressure') p.plot(ts, Ps, label='P') # RDF datafile = open(datafilename, 'r') ts, Es, Epots, Ekins, Ts, Ps, traj2 = pickle.load(datafile) datafile.close() p.new(xlabel='distance', ylabel='probability') p.hist(compute_distances(traj2[-1]), bins=100, range=(0.8, 5), normed=True, log=False, label='RDF') p.make(ncols=3) print "Finished."