srand in a tclforces script

From: Vlad Cojocaru (
Date: Thu Dec 11 2008 - 06:55:53 CST

Dear NAMD users,

I have a tclforces script in which I need to intialize a random unit
vector. I use the tcl "rand" function twice for that purpose (to
generate the spherical coordinates theta and psi).

However, If I run a simulation twice using the same "seed" parameter in
the NAMD configuration file I still get different results between the 2

So, I thought to initialize the random number seed before the first
"rand" call in my tcl script using the tcl "srand" function. However,
NAMD complaints and I get an error saying that it is not possible to set
srand in the tclforces script.

Does anyone have any idea what could I do to have exactly the same
results from 2 simulations using this tcl script that calls the "rand"
function twice ?

Thanks for any suggestion !!

Best wishes

Dr. Vlad Cojocaru
EML Research gGmbH
Schloss-Wolfsbrunnenweg 33
69118 Heidelberg
Tel: ++49-6221-533202
Fax: ++49-6221-533298
EML Research gGmbH
Amtgericht Mannheim / HRB 337446
Managing Partner: Dr. h.c. Klaus Tschira
Scientific and Managing Director: Prof. Dr.-Ing. Andreas Reuter

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