You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lars Pastewka edited this page Oct 22, 2015
·
1 revision
Welcome to the matscipy wiki! This page currently contains random code examples.
Radial distribution function
importnumpyasnpfrommatscipy.neighboursimportneighbour_listrdf_cutoff=5.0rdf_nbins=100# Compute neighbor list and histogram of distancesr=neighbour_list('d', a, cutoff=rdf_cutoff)
rdf, bin_edges=np.histogram(r, bins=rdf_nbins, range=(0, rdf_cutoff))
# Normalize by bin volume and total number of atomsrdf=rdf/ (len(a) *4*pi/3* (bin_edges[1:]**3-bin_edges[:-1]**3))
# Normalize by densityrdf/=len(a)/a.get_volume()
bin_centers= (bin_edges[1:]+bin_edges[:-1])/2# RDF is no win bin_centers, rdfpylab.plot(bin_centers, rdf)