#define k_B 0.001982923700 // Boltzmann's constant in kcal/mol K //#define k_B 0.0083144621 // Boltzmann's constant kJ/mol-KTo get kJ, you simply remove the "//" from the second line and put it before the first line, and save the file. In principle, you can do just wham or just wham-2d, but I recommend against it for your own sanity. To build the standard 1-D wham code on a machine which has gcc, you should

cd wham make clean make(which will delete all object files and executables, and build the wham executable). By default, the Makefile uses the gcc compiler, but I also have flags present for the Intel compiler, plus the native compilers for Irix and Tru64. The latter two have not been tested recently, but ought to work, since at various times this code has been used successfully on various flavors of linux, MacOS X, AIX, Irix, and Tru64. If you find that you need to do anything special to make it work on your particular system, I'd appreciate it if you could let me know so I can add to the Makefile. To build the 2-D version, say

cd wham-2d make clean makeSeveral other directories are also created (doc/, which you presumably found because you're reading this, and nr/, which contains a couple of files from Numerical Recipes). You don't need to do anything with these directories.

wham [P|Ppi|Pval] hist_min hist_max num_bins tol temperature numpad \ metadatafile freefile [num_MC_trials randSeed]The first (optional) argument specifies the periodicity of the reaction coordinate. For a nonperiodic reaction coordinate (a distance, for example), it should be left out. "P" means that the reaction coordinate has a periodicity of 360, appropriate for angles. "Ppi" specifies a periodicity of 2*pi, appropriate for angles measured in radians. "Pval" specifies periodicty of some arbitrary amount, val, which should be an integer or floating point number. For example, "P180.0" would be appropriate for an angle with twofold symmetry. hist_min and hist_max specify the boundaries of the histogram. As a rule, all data points outside the range (hist_min, hist_max) are silently ignored. The only exception is that if an entire trajectory is outside the range, the program halts with an error message. The solution is to remove that file from the metadata file. hist_min and hist_max should be floating point numbers. num_bins specifies the number of bins in the histogram, and as a result the number of points in the final PMF. It should be an integer. tol is the convergence tolerance for the WHAM calculations. Specifically, the WHAM iteration is considered to be converged when no F

/path/to/timeseries/file loc_win_min spring [correl time] [temperature]This first field is the name of one of the time series files (more on this in a moment). The second field, loc_win_min, is the location of the minimum of the biasing potential for this simulation, a floating point number. The third field, spring, is the spring constant for the biasing potential used in this simulation, assuming the biasing potential is of the format

| (1) |

#Iteration 10: 0.106019 #Iteration 20: 0.062269 #Iteration 30: 0.039890 #Iteration 40: 0.027003This specifies the current iteration number, and the average change in the F values for the current iteration. This number is not used for deciding when the calculation has converged; rather, the maximum change, as opposed to the average, is used. Every 100 iterations, the current version of the PMF is dumped into the output file. These lines look like

-178.000000 0.014212 4909.138943 -174.000000 0.062631 4525.390035 -170.000000 0.227076 3432.434076 -166.000000 0.494262 2190.487110 -162.000000 0.817734 1271.708620The first column is the value of the reaction coordinate, the second is the value of the PMF, and the third is the unnormalized probability distribution. Once the calculation has converged, wham will produce output resembling

# Dumping simulation biases, in the metadata file order # Window F (free energy units) # 0 0.000004 # 1 -4.166136 # 2 -3.241052 # 3 -4.475215 # 4 -6.324340 # 5 -7.128731These are the final F values from the wham calculation, and can be used for computing weighted averages for properties other than the free energy. You may have noticed that all of the lines except the free energies are preceded by "#". This allows you to check convergence of your wham calculation by simply plotting the output file in gnuplot. If the free energy curves have stopped changing, your tolerance is small enough. If you specified a nonzero number of Monte Carlo bootstrap error analysis trials, you will see lines that resemble

#MC trial 0: 990 iterations #MC trial 1: 973 iterations #MC trial 2: 970 iterations #MC trial 3: 981 iterations #MC trial 4: 984 iterationsat the end of the file. The free energy data file is written when the calculation converges, and resembles:

#Coor Free +/- Prob +/- -178.000000 0.014386 0.000098 0.106389 0.000017 -174.000000 0.068560 0.000151 0.097128 0.000025 -170.000000 0.250825 0.000350 0.071496 0.000042 -166.000000 0.523786 0.000294 0.045186 0.000022The first column is the value of the reaction coordinate, the second is the free energy. The third is the statistical uncertainty of the free energy (which is only meaningful if you performed Monte Carlo bootstrapping). The fourth and fifth columns are the probability and it's associated statistical uncertainty. Again, the latter is only meaningful if bootstrapping is performed. See section for further discussion of error estimation.

wham-2d Px[=0|pi|val] hist_min_x hist_max_x num_bins_x \ Py[=0|pi|val] hist_min_y hist_max_y num_bins_y \ tol temperature numpad metadatafile freefile \ use_maskThe command line arguments largely have the same meaning as they do for the one dimensional wham program. The periodicity arguments are not optional. "Px" by itself indicates that the first dimension of the reaction coordinate has a period of 360. "Px=0" turns off periodicity. "Px=pi" specifies a period of 2*pi, and "Px=val" allows you to choose an arbitrary value for the period. hist_min_x, hist_max_x, and num_bins_x behave exactly like hist_min, hist_max, and num_bins do in the 1 dimensional program. Py, hist_min_y, etc., behave the same as Px, hist_min_x, etc., except they control the second coordinate of the PMF. use_mask expects an integer value, and if its values is non-zero turns on the automasking feature, which causes bins for which there is no sample data to be excluded from the wham calculation.

/path/to/timeseries/file loc_win_x loc_win_y spring_x spring_y [correl time] [temp]This first field is the name of one of the time series files. loc_win_x and loc_win_y are the locations of the minimum of the biasing terms in the first and second dimensions of the reaction coordinate. spring_x and spring_y are the spring constants used for the biasing potential in this simulation, assuming the biasing potential is of the format

| (2) |

-172.500000 -172.500000 1.968750 15.394489 -172.500000 -157.500000 2.574512 5.522757 -172.500000 -142.500000 3.147538 2.094142 -172.500000 -127.500000 3.505869 1.141952where the first two columns are the values of the first and second dimensions of the reaction coordinate, the third column is the PMF, and the last column is the unnormalized probability. Once the calculation has converged, wham will produce output resembling

# Dumping simulation biases, in the metadata file order # Window F (free energy units) #0 -0.000004 #1 -0.156869 #2 -0.534845 #3 -2.445469These are the final F values from the wham calculation, and can be used for computing weighted averages for properties other than the free energy. If you specified a nonzero number of Monte Carlo bootstrap error analysis trials, you will see lines that resemble

#MC trial 0: 990 iterations #MC trial 1: 973 iterations #MC trial 2: 970 iterations #MC trial 3: 981 iterations #MC trial 4: 984 iterationsat the end of the file. The free energy data file is written when the calculation converges, and resembles:

-232.500000 -232.500000 4.812986 0.003185 0.000001 0.000000 -232.500000 -217.500000 4.830312 0.003741 0.000001 0.000000 -232.500000 -202.500000 4.898622 0.001009 0.000000 0.000000The first two columns are the locations along the first and second dimensions of the reaction coordinate. The third is the free energy, while the fourth is the statistical uncertainty in the free energy. The fifth and sixth columns are the normalized probability and its statistical uncertainty. The two uncertainty columns will be zero if you did not use Monte Carlo bootstrapping.

- For each simulation window, use the computed cumulant of the histogram to generate a new histogram, with the same number of points.
- Perform WHAM iterations on the set of generated histograms
- Store the average normalized probability and free energy, and their squares for each bin in the histogram

File translated from T

On 15 Nov 2013, 07:40.