Be the first to rate this file! 25 Downloads (last 30 days) File Size: 3.56 KB File ID: #31353

Two point correlation function of a finite 2D lattice

by

 

06 May 2011 (Updated )

Compute the two point correlation function of a finite 2D lattice.

| Watch this File

File Information
Description

Computes the distance 2-point correlation function of a finite 2D lattice. The functions is:
[ coorfun r rw] = twopointcorr(x,y,dr,blksize,verbose)

Where x is the list of x coordinates of lattice points. y is the list of y coordinates of the lattice points,and dr is the binning length for the correlation function. blksize is the number of points processed at a time. verbose is a boolean on whether to display current progress.

The outputs are coorfun, r, and rw. Coorfun is a vector of normalized correlation function values for distances recorded in the r vector. rw is the weight (number of points) contributing to corrfun calculation at a particular r. Low rw means that corrfun at that r value is unreliable.

This function has been fully vectorized to improve performance.

MATLAB release MATLAB 7.11 (R2010b)
Other requirements Tested on 20010b but should operate at earlier versions as well.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
09 May 2011

There was a minor error in normalization which resulted in the entire function being divided by the number of particles an extra time.

09 May 2011

Some performance improvements.

09 Jan 2013

Improved vectorization. Removed bias due to finite size of lattice.

10 Jan 2013

Added blksize and verbose optional arguments. blksize allows to consider the data in blocks thus reducing memory requirements/out of memory errors. Verbose allows the function to output in display how much progress has been achieved.

22 Apr 2014

Solved a bug where (x,y) were not column vectors. Updated the description.

Contact us