[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESPResSo] bug in random.tcl in mbtools

From: Tristan Bereau
Subject: Re: [ESPResSo] bug in random.tcl in mbtools
Date: Wed, 18 Mar 2009 10:25:04 -0400

Dear Jacob,

Thanks for pointing this out. However, please keep in mind that the distribution of angles is still not homogeneous: this is effectively mapping a cube onto a sphere, and there will be an overemphasis along the corners of this cube. If you're interested in a more homogeneous distribution, a gaussian distribution may be more suitable.

I've still updated the CVS with your corrected code.



On Mar 17, 2009, at 10:47 AM, Jacob Kirkensgaard wrote:

Hi all mbtools users

In the file random.tcl in the mbtools package the following lines are

        # Now choose a random orientation vector.  Actually it's not
        # strictly random if we do it like this (fix)
        lappend orient [expr [t_random]]
        lappend orient [expr [t_random]]
        lappend orient [expr [t_random]]

I think replacing with these lines should fix it:

        lappend orient [expr 2*[t_random]-1]
        lappend orient [expr 2*[t_random]-1]
        lappend orient [expr 2*[t_random]-1]

This means we are now sampling all directions in space instead of only
the cone consisting of vectors with positive coordinates.

Jacob Kirkensgaard
Copenhagen University

ESPResSo mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]