# Re: varying two colvar distances simultaneously

From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Fri Mar 25 2016 - 17:22:37 CDT

A harmonic potential will do, but if you have anything more specific you
can always check the manual, including the scriptedColvarForces feature.

On Fri, Mar 25, 2016 at 6:20 PM, Chitrak Gupta <chgupta_at_mix.wvu.edu> wrote:

> I actually have a follow-up question.
>
> When I restrain the difference to 0, do I do this by putting another
> harmonic potential on it, or is there some other way to retrain a colvar?
>
>
> Chitrak.
>
> On Fri, Mar 25, 2016 at 11:58 AM, Chitrak Gupta <chgupta_at_mix.wvu.edu>
> wrote:
>
>> Hi Giacomo,
>>
>> Thanks for the input. I do not need the distances to be exactly equal, so
>> this should solve my problem.
>>
>>
>> Regards,
>> Chitrak.
>>
>> On Thu, Mar 24, 2016 at 5:53 PM, Giacomo Fiorin <giacomo.fiorin_at_gmail.com
>> > wrote:
>>
>>> Hello Chitrak, you could define a variable as the difference between two
>>> distances (there is an example in the manual) and restrain the difference
>>> near zero.
>>>
>>> Note that an exact equality will not be possible, because that would
>>> require a constraint solver.
>>>
>>> On Thu, Mar 24, 2016 at 5:49 PM, Chitrak Gupta <chgupta_at_mix.wvu.edu>
>>> wrote:
>>>
>>>> Hello!
>>>>
>>>> I am newly using the colvars module. Is there a way to vary two
>>>> different colvars distance in a way that they are always equal to each
>>>> other? Basically, I want to vary two distances simultaneously, resulting in
>>>> only one dimension. Is that possible?
>>>>
>>>>
>>>> Regards,
>>>> Chitrak.
>>>>
>>>
>>>
>>>
>>> --
>>> Giacomo Fiorin
>>> Assistant Professor of Research
>>> Institute for Computational Molecular Science (ICMS)
>>> College of Science and Technology, Temple University
>>> 1925 North 12th Street (035-07), Room 704D
>>> Phone: +1-215-204-4213
>>>
>>> Scholar: http://goo.gl/Q3TBQU
>>> Personal: http://giacomofiorin.github.io/
>>> Lab page: https://icms.cst.temple.edu/members.html
>>>
>>> *"As computer programmers we have a responsibility to make sure that we
>>> run the computers instead of the computers running us."* - Steve
>>> Oualline
>>>
>>>
>>>
>>
>

```--
Giacomo Fiorin
Assistant Professor of Research
Institute for Computational Molecular Science (ICMS)
College of Science and Technology, Temple University
1925 North 12th Street (035-07), Room 704D