Maximum Distance CV

189 views
Skip to first unread message

Francois Sicard

unread,
Oct 11, 2013, 8:56:18 AM10/11/13
to plumed...@googlegroups.com
Dear Plumed users,
Is it possible to define a "maximum distance" CV with PLUMED as it is already done with minimum distance?
Sincerely

F.S.

Davide Provasi

unread,
Oct 11, 2013, 11:27:36 AM10/11/13
to plumed...@googlegroups.com, francois.si...@gmail.com
Using a negative beta in mindist might work. have you tried?
Davide




--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at http://groups.google.com/group/plumed-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
Davide Provasi
Dept. of Structural and Chemical Biology
Mount Sinai School of Medicine
Icahn Medical Institute Building
1425 Madison Avenue, Box 1677
New York, NY 10029-6574
Tel.:212-659-8618
Fax: 212-849-2456

Francois Sicard

unread,
Oct 11, 2013, 12:03:02 PM10/11/13
to plumed...@googlegroups.com, francois.si...@gmail.com
Thanks Davide,

however, it seems to me that this modification works only for negative values.
Maybe I'm wrong but if you consider 2 distances x and y with x = y+d > y > 0, the function becomes :

s = x / {1 - (x/beta) * log[ 1 + exp(-beta*d/(x*x-d)) ] }

that gives s(x) = x only for x<0 and x > x_0 with x_0 (if you plot it with gnuplot for example).
Considering the minimum distance already implemented in plumed-1.3, you have s = x for x>0 (which is the desired criterion).

What are you thinking about?
F.

Davide Provasi

unread,
Oct 11, 2013, 4:31:05 PM10/11/13
to plumed...@googlegroups.com, francois.si...@gmail.com
Hi Francois-- I'm not sure I understand your s function.
mindist works by selecting beta so that the sum of the exponentials in the denominator can be approximated by the term corresponding to the smallest value of the distance
(max of beta/x).
Using the same strategy, I would say that maxdist = beta* log(sum(exp(x/beta))
would be a better choice, but you'd have to write new code for it (as far as I know).
however, using a negative beta in  mindist also seems to work.

for instance, if x is all integers between 1 and 40
-5000/log(sum(exp(-5000/x))) =40.01316
.2*log(sum(exp(x/.2))) = 40.00135

I think the two functions have a different range of accuracy for a given beta, so you should experiment with the process you are trying to describe and see which is better for you particular case.

I hope this helps
Davide












--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at http://groups.google.com/group/plumed-users.
For more options, visit https://groups.google.com/groups/opt_out.

Gareth Tribello

unread,
Oct 12, 2013, 5:36:26 AM10/12/13
to plumed...@googlegroups.com
Hello

If you are willing to use plumed 2 you can do the maximum distance function from Davide's email with a small amount of modification.  Download the file that is attached to this email and put it in:

src/vesselbase/

Then you need to open 

src/multicolvar/Distances.cpp

and add the following line of code

keys.use("MAX");

to the routine called 

void Distances::registerKeywords( Keywords& keys )

Once you recompile the code you can run maxdist by doing 

DISTANCES GROUPA=1-10 GROUPB=11-20 MAX={BETA=2} LABEL=d1
PRINT ARG=d1.max FILE=colvar

There is a tutorial in the manual on how to do mindist with plumed 2 (maxdist is similar).


and there is more information on the DISTANCES keyword here:


Have fun
Gareth
Max.cpp

Francois Sicard

unread,
Oct 14, 2013, 5:35:50 AM10/14/13
to plumed...@googlegroups.com
Thanks ;)
Reply all
Reply to author
Forward
0 new messages