PMF calculation floating-point error

From: will (ewlowe_at_mail.usf.edu)
Date: Thu Apr 10 2008 - 08:12:41 CDT

I've finished a set of SMD runs and am trying to
calculate the free energy of binding using the
Jarzynski relationship. I've been using the scripts
in the 10ALA tutorial as a template and successfully
got the PMF curves of Fexp, F1, and F2 for the
different averaging schemes for one set of data.
However, when using the same script modified with only
the correct input.dat for the other data, I'm getting:

floating-point value too small to represent

when doing: source JR.tcl

from vmd. When I call the same script from a terminal
(tclsh8.4 installed), I get:

floating-point value too large to represent
    while executing
"expr - $T * log([expr $texp / 10])"
    ("for" body line 13)
    invoked from within
"for {set i 0} {$i < 10001} {incr i 1} {
   set texp 0
   set t1 0
   set t2 0

The above error is while using the exact script from
the tutorial only changing the number of lines in the
input.dat file in the for loop (20001 -> 10001). I
thought there must have been an error in my script, so
that's why I used to tutorial script as a control.
I'm very new to tcl, and any suggestions/input would
be greatly appreciated. Thank you for your time. Code
from tutorial below:

set Fexp {}
set F1 {}
set F2 {}

for {set i 0} {$i < 10001} {incr i 1} {
   set texp 0
   set t1 0
   set t2 0

   foreach l [array names w] {
   
     set e [lindex $w($l) $i]
     set texp [expr $texp + exp([expr - $e / $T]) ]
     set t1 [expr $t1 + $e]
     set t2 [expr $t2 + $e * $e]
   }
   lappend Fexp [expr - $T * log([expr $texp / 10])]
   lappend F1 [expr $t1 / 10]
   lappend F2 [expr $t1 / 10 - $t2 / 10 + $t1 * $t1
/ 100 ]
}

Will

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:49:22 CST