# AMBER Archive (2006)Subject: Re: AMBER: applying restraints on pre-defined planes

From: David A. Case (case_at_scripps.edu)
Date: Tue Jul 11 2006 - 18:34:52 CDT

On Tue, Jul 11, 2006, Vlad Cojocaru wrote:
>
> I would like to run some simulations by applying distance and agle
> restraints between 2 defined planes in my system. Does anybody have any
> idea how to define such restraints in Amber8?
>
> Just to make the task more clear: I would like to define 2 planes (each
> defined by the positions of at least 3 atoms) and then run a simulation
> in which to force the 2 planes to have a certain distance and agle
> between each other?
>

Amber doesn't have any built-in support for such constraints. You would have
to program such a function yourself. Below is something that might help
you get started: a subroutine from Amber 6 that computes the normal to the
plane defined by three atoms, and the derivatives of this with respect to the
cartesian coordinates of the atoms. (You need derivatives to construct a
restraint).

...good luck...dac

subroutine plane (i1, i2, i3, x, rn, a, cent)
c
c Subroutine determine PLANE:
c
c --- given three atoms i1,i2 and i3, and coordinates x
c returns rn(i) [i=1,2,3] components of the normalized
c vector normal to the plane containing the three
c points; and a(i,j) [i=1,2,3, j=1..9] which
c are the derivatives of rn(i) with respect to
c the nine cartesian coordinates of points i1,i2,i3.
c Also returns cent[1..3], the center of the three atoms.
c
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
dimension x(*)
dimension a(3,9),rn(9),anx(9),cent(3)
c
i1p = 3*i1-3
i2p = 3*i2-3
i3p = 3*i3-3
c
x1 = x(i1p+1)
y1 = x(i1p+2)
z1 = x(i1p+3)
x2 = x(i2p+1)
y2 = x(i2p+2)
z2 = x(i2p+3)
x3 = x(i3p+1)
y3 = x(i3p+2)
z3 = x(i3p+3)
c
c ----- coefficients of the equation for the plane of atoms 1-3
c
tempa = y1*z2 - y2*z1
tempb = y3*z1 - y1*z3
tempc = y2*z3 - y3*z2
ax = tempa + tempb + tempc
ay = -(x1*z2 - x2*z1 + x3*z1 - x1*z3 + x2*z3 - x3*z2)
az = x1*y2 - x2*y1 + x3*y1 - x1*y3 + x2*y3 - x3*y2
anorm = 1./sqrt(ax*ax + ay*ay + az*az)
c
c ----- normalize to standard form for plane equation (i.e. such
c ----- that length of the vector "a" is unity
c
rn(1) = ax*anorm
rn(2) = ay*anorm
rn(3) = az*anorm
c
c ----- first derivatives of ax,ay,ax w/resp. to coords. of atoms 1-3
c ----- first index holds ax, ay or az;
c ----- second index holds x1,y1...y3,z3
c ----- (note: these are the derivatives of the "unnormalized" a vector)
c
a(1,1) = 0.0
a(1,2) = z2 - z3
a(1,3) = y3 - y2
a(1,4) = 0.0
a(1,5) = z3 - z1
a(1,6) = y1 - y3
a(1,7) = 0.0
a(1,8) = z1 - z2
a(1,9) = y2 - y1
a(2,1) = z3 - z2
a(2,2) = 0.0
a(2,3) = x2 - x3
a(2,4) = z1 - z3
a(2,5) = 0.0
a(2,6) = x3 - x1
a(2,7) = z2 - z1
a(2,8) = 0.0
a(2,9) = x1 - x2
a(3,1) = y2 - y3
a(3,2) = x3 - x2
a(3,3) = 0.0
a(3,4) = y3 - y1
a(3,5) = x1 - x3
a(3,6) = 0.0
a(3,7) = y1 - y2
a(3,8) = x2 - x1
a(3,9) = 0.0
c
c ----- first derivatives of normalization const. w/resp. to atoms 1-3
c
do 20 i=1,9
anx(i) = (ax*a(1,i) + ay*a(2,i) + az*a(3,i))*anorm
20 continue
c
c ---- finally, derivates of normalized vector:
c
do 40 i=1,3
do 30 j=1,9
a(i,j) = (a(i,j) - rn(i)*anx(j))*anorm
30 continue
40 continue
c
cent(1) = (x1+x2+x3)/3.
cent(2) = (y1+y2+y3)/3.
cent(3) = (z1+z2+z3)/3.
c
return
end
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber_at_scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo_at_scripps.edu