
Overview
This section explains the analyse_histogram utility program. This program is designed for use in conjunction with the towhee_histogram files and is
used to analyze the histogram data generated by the grand canonical ensemble.
Compiling
analyse_histogram.F is a stand alone utility program that may be compiled using the Utility Makefile
 cd /towheebase/Utils
 make analyse_histogram
This will create the analyse_histogram executable which can then be run from the command line. In order to successfully run analyse_histogram,
two sources of input are required. The first is an input file named 'input_analyse_histogram', which contains parameters that define what analysis
you would like to perform. These parameters will be defined in the following section. The second input is the histogram files which are generated
by performing simulations of the grand canonical ensemble in towhee (towhee_histogram).
Features
Run the analyse_histogram utility routine by calling the routine from a directory that contains towhee_histogram output files from a MCCCS Towhee
simulation run and a copy of the input_analyse_histogram which is setup so that your desired calculations will be performed. Below is a list of
the calculations that analyse_histogram can perform and the representative file names that will contain the results.
 histogram reweighting (lweight is .true.): this computes the weights for the histograms using the
method of Ferrenberg and Swendsen 1989
The weights are output into a file called towhee_weights, which can be used as input in the lold option.
Also, converge.dat, which contains the number of iterations and the deviation, is outputted during these
calculations so that you can see how well the algorithm is converging.
 phase coexistence calculations (lphase is .true.): this computes the phase coexistence for binary
mixtures using Newton's method. The phase coexistence data is output in 'phase_coex.dat.' The distribution
of the number of each component n at each temperature t is output in a file called
'phasecompntempt.dat.'
 pvt calculations (lpvt is .true.): calculates ln Z vs. n (number of molecules) data so
that the constant in 'pv/T = ln xi + constant' may be found. The lnZ and n data is
output in a file called 'pvt.dat'. Also, the distribution of each component n at each temperature
t is output in a file called 'pvtcompntempt.dat.'
Parameter explanations for input_analyse_histogram
 ncomp (integer)
 The number of components in the system (Note: only the weight calculation feature of this code has been tested for systems with more than
3 components)
 volume (double precision)
 The volume of the box in nm^3. (Note: these are the units it is output in the standard Towhee output at the end of a simulation.)
 lweight (logical)
 .true. :weights for the histograms are computed and the following variable is read from this file.
 ndump (integer)
 The frequency that the iteration and weights are outputted during the iteration process
 .false. if weights have alread been calculated for the histograms and do not want to recompute them
 lphase (logical)
 .true. : the phase coexistence is calculated and the following variables are read from a file named 'file_phase'. In this case you
also need the following variables.
 chempot1 (double precision)
 An initial guess for the chemical potential for component 1
 Number Entries (integer)
 The number of temperatures at which phase coexistence is to be calculated.
 The following section is repeated once for each value of Number Entries.
[Note: If ncomp = 1, then only entries for Temperature , midpt and slope are required.]
 Temperature (double precision)
 The temperature in Kelvin.
 midpt (double precision)
 A variable used to split the integratation used for the Newton's Method.
 slope (double precision)
 The slope is used to split the peaks of the coexistence behavior correctly.
An initial guess of 0.0 is okay, and if the phase data looks okay then it should be fine.
 If ncomp = 1 , then this is the end of the section repeated once for each value of Number of Entries.
If ncomp = 2, then each of the following values will also need to be included.
 chempot2min (double precision)
 The minimum that the chemical potential of component 2 would be.
 chempot2max (double precision)
 The maximum that the chemical potential of component 2 would be.
 chempot2incr (double precision)
 The increment at which to investigate the range of chempot2min to chempot2max
 If ncomp = 2 , this is the end of the section repeated once for each value of Number Entries
 .false. : phase coexistence is not calculated
 lpvt (logical)
 .true. :pvt calculations are performed and the following variables are read from a file named 'file_pvt'. In this case you also need the
following variables.
 Number of entries
 The number of entries at which pvt calculations are to be conducted,
 The following section is repeated once for each value of Number of entries
 Temperature (double precision)
 The temperature in Kelvin.
 Chemical potential (double precision)
 The chemical potential of each component of the system is given one after another.
 End of the section that is repeated once for each value of Number of entries
 .false. if pvt calculations are not to be performed
 lold (logical)
 .true. if you are including histograms which have already had their weights determined once before. In that case the following variables
must be listed in this file
 noldfiles (integer)
 The number of histograms that are included for which the weights have already been included.
 file_old (character)
 The name of the data file of the old runs weights and other needed information. This is the same as the towhee_weights file which is
ouputted during the weight calculation. So can just copy this file into a new file and use it. ( Note: You must list the filename of
the histogram for the low density reference state first.)
 .false. if you have no histograms which already have had their weights determined
 lnew (logical)
 .true. if you are including histograms which still need to have their weights determined. In that case the following variables must be listed
in this file.
 nfiles (integer)
 The number of histograms that still need their weights to be determined.
 The following section is repeated once for each value of nfiles
 filename (character)
 The name of the file containing the histogram data (towhee_histogram) which is output by Towhee. ( Note: If you do not have old
histograms, you must list the filename of the histogram for the low density reference state first.)
 number of entries (integer)
 The number of entries in the histogram data file.
 End of the section that is repeated once for each value of nfiles
 .false. if you are not including any histograms which still need to have their weights determined
Return to the Utility Summary page
