<s>
In	O
computational	O
chemistry	O
,	O
a	O
constraint	B-Algorithm
algorithm	I-Algorithm
is	O
a	O
method	O
for	O
satisfying	O
the	O
Newtonian	O
motion	O
of	O
a	O
rigid	O
body	O
which	O
consists	O
of	O
mass	O
points	O
.	O
</s>
<s>
The	O
general	O
steps	O
involved	O
are	O
:	O
(	O
i	O
)	O
choose	O
novel	O
unconstrained	O
coordinates	O
(	O
internal	O
coordinates	O
)	O
,	O
(	O
ii	O
)	O
introduce	O
explicit	O
constraint	B-Algorithm
forces	O
,	O
(	O
iii	O
)	O
minimize	O
constraint	B-Algorithm
forces	O
implicitly	O
by	O
the	O
technique	O
of	O
Lagrange	O
multipliers	O
or	O
projection	O
methods	O
.	O
</s>
<s>
Constraint	B-Algorithm
algorithms	I-Algorithm
are	O
often	O
applied	O
to	O
molecular	O
dynamics	O
simulations	O
.	O
</s>
<s>
Although	O
such	O
simulations	O
are	O
sometimes	O
performed	O
using	O
internal	O
coordinates	O
that	O
automatically	O
satisfy	O
the	O
bond-length	O
,	O
bond-angle	O
and	O
torsion-angle	O
constraints	O
,	O
simulations	O
may	O
also	O
be	O
performed	O
using	O
explicit	O
or	O
implicit	O
constraint	B-Algorithm
forces	O
for	O
these	O
three	O
constraints	O
.	O
</s>
<s>
However	O
,	O
explicit	O
constraint	B-Algorithm
forces	O
give	O
rise	O
to	O
inefficiency	O
;	O
more	O
computational	O
power	O
is	O
required	O
to	O
get	O
a	O
trajectory	O
of	O
a	O
given	O
length	O
.	O
</s>
<s>
Therefore	O
,	O
internal	O
coordinates	O
and	O
implicit-force	O
constraint	B-Algorithm
solvers	O
are	O
generally	O
preferred	O
.	O
</s>
<s>
Constraint	B-Algorithm
algorithms	I-Algorithm
achieve	O
computational	O
efficiency	O
by	O
neglecting	O
motion	O
along	O
some	O
degrees	O
of	O
freedom	O
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
atomistic	O
molecular	O
dynamics	O
,	O
typically	O
the	O
length	O
of	O
covalent	O
bonds	O
to	O
hydrogen	O
are	O
constrained	O
;	O
however	O
,	O
constraint	B-Algorithm
algorithms	I-Algorithm
should	O
not	O
be	O
used	O
if	O
vibrations	O
along	O
these	O
degrees	O
of	O
freedom	O
are	O
important	O
for	O
the	O
phenomenon	O
being	O
studied	O
.	O
</s>
<s>
A	O
second	O
approach	O
is	O
to	O
introduce	O
explicit	O
forces	O
that	O
work	O
to	O
maintain	O
the	O
constraint	B-Algorithm
;	O
for	O
example	O
,	O
one	O
could	O
introduce	O
strong	O
spring	O
forces	O
that	O
enforce	O
the	O
distances	O
among	O
mass	O
points	O
within	O
a	O
"	O
rigid	O
"	O
body	O
.	O
</s>
<s>
A	O
third	O
approach	O
is	O
to	O
use	O
a	O
method	O
such	O
as	O
Lagrange	O
multipliers	O
or	O
projection	O
to	O
the	O
constraint	B-Algorithm
manifold	O
to	O
determine	O
the	O
coordinate	O
adjustments	O
necessary	O
to	O
satisfy	O
the	O
constraints	O
.	O
</s>
<s>
Efficient	O
recursive	O
,	O
internal-coordinate	O
constraint	B-Algorithm
solvers	O
were	O
extended	O
to	O
molecular	O
dynamics	O
.	O
</s>
<s>
In	O
most	O
of	O
molecular	O
dynamics	O
simulations	O
that	O
use	O
constraint	B-Algorithm
algorithms	I-Algorithm
,	O
constraints	O
are	O
enforced	O
using	O
the	O
method	O
of	O
Lagrange	O
multipliers	O
.	O
</s>
<s>
Given	O
a	O
set	O
of	O
n	O
linear	B-Architecture
(	O
holonomic	O
)	O
constraints	O
at	O
the	O
time	O
t	O
,	O
</s>
<s>
where	O
and	O
are	O
the	O
positions	O
of	O
the	O
two	O
particles	O
involved	O
in	O
the	O
kth	O
constraint	B-Algorithm
at	O
the	O
time	O
t	O
and	O
is	O
the	O
prescribed	O
inter-particle	O
distance	O
.	O
</s>
<s>
Adding	O
the	O
constraint	B-Algorithm
forces	O
does	O
not	O
change	O
the	O
total	O
energy	O
,	O
as	O
the	O
net	O
work	O
done	O
by	O
the	O
constraint	B-Algorithm
forces	O
(	O
taken	O
over	O
the	O
set	O
of	O
particles	O
that	O
the	O
constraints	O
act	O
on	O
)	O
is	O
zero	O
.	O
</s>
<s>
Since	O
not	O
all	O
particles	O
contribute	O
to	O
all	O
of	O
constraints	O
,	O
is	O
a	O
block	B-Algorithm
matrix	I-Algorithm
and	O
can	O
be	O
solved	O
individually	O
to	O
block-unit	O
of	O
the	O
matrix	O
.	O
</s>
<s>
Instead	O
of	O
constantly	O
updating	O
the	O
vector	O
,	O
the	O
iteration	B-Algorithm
can	O
be	O
started	O
with	O
,	O
resulting	O
in	O
simpler	O
expressions	O
for	O
and	O
.	O
</s>
<s>
The	O
above	O
procedure	O
is	O
repeated	O
until	O
the	O
solution	O
of	O
constraint	B-Algorithm
equations	O
,	O
,	O
converges	O
to	O
a	O
prescribed	O
tolerance	O
of	O
a	O
numerical	O
error	O
.	O
</s>
<s>
For	O
this	O
methods	O
,	O
quasi-Newton	B-Algorithm
methods	I-Algorithm
are	O
commonly	O
used	O
.	O
</s>
<s>
The	O
SETTLE	O
algorithm	O
solves	O
the	O
system	O
of	O
non-linear	O
equations	O
analytically	O
for	O
constraints	O
in	O
constant	O
time	O
.	O
</s>
<s>
The	O
SHAKE	O
algorithm	O
was	O
first	O
developed	O
for	O
satisfying	O
a	O
bond	O
geometry	O
constraint	B-Algorithm
during	O
molecular	O
dynamics	O
simulations	O
.	O
</s>
<s>
The	O
method	O
was	O
then	O
generalised	O
to	O
handle	O
any	O
holonomic	O
constraint	B-Algorithm
,	O
such	O
as	O
those	O
required	O
to	O
maintain	O
constant	O
bond	O
angles	O
,	O
or	O
molecular	O
rigidity	O
.	O
</s>
<s>
In	O
SHAKE	O
algorithm	O
,	O
the	O
system	O
of	O
non-linear	O
constraint	B-Algorithm
equations	O
is	O
solved	O
using	O
the	O
Gauss	B-Algorithm
–	I-Algorithm
Seidel	I-Algorithm
method	I-Algorithm
which	O
approximates	O
the	O
solution	O
of	O
the	O
linear	B-Architecture
system	O
of	O
equations	O
using	O
the	O
Newton	O
–	O
Raphson	O
method	O
;	O
</s>
<s>
for	O
all	O
iteratively	O
until	O
the	O
constraint	B-Algorithm
equations	O
are	O
solved	O
to	O
a	O
given	O
tolerance	O
.	O
</s>
<s>
The	O
calculation	O
cost	O
of	O
each	O
iteration	B-Algorithm
is	O
,	O
and	O
the	O
iterations	B-Algorithm
themselves	O
converge	O
linearly	O
.	O
</s>
<s>
Although	O
they	O
differ	O
in	O
how	O
they	O
compute	O
or	O
apply	O
the	O
constraints	O
themselves	O
,	O
the	O
constraints	O
are	O
still	O
modelled	O
using	O
Lagrange	O
multipliers	O
which	O
are	O
computed	O
using	O
the	O
Gauss	B-Algorithm
–	I-Algorithm
Seidel	I-Algorithm
method	I-Algorithm
.	O
</s>
<s>
water	O
,	O
benzene	O
and	O
biphenyl	O
)	O
and	O
introduces	O
negligible	O
error	O
or	O
energy	B-Algorithm
drift	I-Algorithm
into	O
a	O
molecular	O
dynamics	O
simulation	O
.	O
</s>
<s>
One	O
issue	O
with	O
SHAKE	O
is	O
that	O
the	O
number	O
of	O
iterations	B-Algorithm
required	O
to	O
reach	O
a	O
certain	O
level	O
of	O
convergence	O
does	O
rise	O
as	O
molecular	O
geometry	O
becomes	O
more	O
complex	O
.	O
</s>
<s>
To	O
reach	O
64	O
bit	O
computer	O
accuracy	O
(	O
a	O
relative	O
tolerance	O
of	O
)	O
in	O
a	O
typical	O
molecular	O
dynamics	O
simulation	O
at	O
a	O
temperature	O
of	O
310K	O
,	O
a	O
3-site	O
water	O
model	O
having	O
3	O
constraints	O
to	O
maintain	O
molecular	O
geometry	O
requires	O
an	O
average	O
of	O
9	O
iterations	B-Algorithm
(	O
which	O
is	O
3	O
per	O
site	O
per	O
time-step	O
)	O
.	O
</s>
<s>
A	O
4-site	O
butane	O
model	O
with	O
5	O
constraints	O
needs	O
17	O
iterations	B-Algorithm
(	O
22	O
per	O
site	O
)	O
,	O
a	O
6-site	O
benzene	O
model	O
with	O
12	O
constraints	O
needs	O
36	O
iterations	B-Algorithm
(	O
72	O
per	O
site	O
)	O
,	O
while	O
a	O
12-site	O
biphenyl	O
model	O
with	O
29	O
constraints	O
requires	O
92	O
iterations	B-Algorithm
(	O
229	O
per	O
site	O
per	O
time-step	O
)	O
.	O
</s>
<s>
It	O
is	O
worth	O
mentioning	O
that	O
MSHAKE	O
computes	O
corrections	O
on	O
the	O
constraint	B-Algorithm
forces	O
,	O
achieving	O
better	O
convergence	O
.	O
</s>
<s>
P-SHAKE	O
computes	O
and	O
updates	O
a	O
pre-conditioner	O
which	O
is	O
applied	O
to	O
the	O
constraint	B-Algorithm
gradients	O
before	O
the	O
SHAKE	O
iteration	B-Algorithm
,	O
causing	O
the	O
Jacobian	O
to	O
become	O
diagonal	O
or	O
strongly	O
diagonally	O
dominant	O
.	O
</s>
<s>
The	O
M-SHAKE	O
algorithm	O
solves	O
the	O
non-linear	O
system	O
of	O
equations	O
using	O
Newton	O
's	O
method	O
directly	O
.	O
</s>
<s>
Each	O
iteration	B-Algorithm
costs	O
operations	O
,	O
yet	O
the	O
solution	O
converges	O
quadratically	O
,	O
requiring	O
fewer	O
iterations	B-Algorithm
than	O
SHAKE	O
.	O
</s>
<s>
This	O
solution	O
was	O
first	O
proposed	O
in	O
1986	O
by	O
Ciccotti	O
and	O
Ryckaert	O
under	O
the	O
title	O
"	O
the	O
matrix	O
method	O
"	O
,	O
yet	O
differed	O
in	O
the	O
solution	O
of	O
the	O
linear	B-Architecture
system	O
of	O
equations	O
.	O
</s>
<s>
Ciccotti	O
and	O
Ryckaert	O
suggest	O
inverting	O
the	O
matrix	O
directly	O
,	O
yet	O
doing	O
so	O
only	O
once	O
,	O
in	O
the	O
first	O
iteration	B-Algorithm
.	O
</s>
<s>
The	O
first	O
iteration	B-Algorithm
then	O
costs	O
operations	O
,	O
whereas	O
the	O
following	O
iterations	B-Algorithm
cost	O
only	O
operations	O
(	O
for	O
the	O
matrix-vector	O
multiplication	O
)	O
.	O
</s>
<s>
This	O
improvement	O
comes	O
at	O
a	O
cost	O
though	O
,	O
since	O
the	O
Jacobian	O
is	O
no	O
longer	O
updated	O
,	O
convergence	O
is	O
only	O
linear	B-Architecture
,	O
albeit	O
at	O
a	O
much	O
faster	O
rate	O
than	O
for	O
the	O
SHAKE	O
algorithm	O
.	O
</s>
<s>
This	O
approach	O
involves	O
a	O
single	O
3×3	O
matrix	O
diagonalization	O
followed	O
by	O
three	O
or	O
four	O
rapid	O
Newton	O
iterations	B-Algorithm
to	O
determine	O
the	O
rotation	O
matrix	O
.	O
</s>
<s>
SHAPE	O
provides	O
the	O
identical	O
trajectory	O
that	O
is	O
provided	O
with	O
fully	O
converged	O
iterative	B-Algorithm
SHAKE	O
,	O
yet	O
it	O
is	O
found	O
to	O
be	O
more	O
efficient	O
and	O
more	O
accurate	O
than	O
SHAKE	O
when	O
applied	O
to	O
systems	O
involving	O
three	O
or	O
more	O
centers	O
.	O
</s>
<s>
It	O
extends	O
the	O
ability	O
of	O
SHAKE	O
like	O
constraints	O
to	O
linear	B-Architecture
systems	O
with	O
three	O
or	O
more	O
atoms	O
,	O
planar	O
systems	O
with	O
four	O
or	O
more	O
atoms	O
,	O
and	O
to	O
significantly	O
larger	O
rigid	O
structures	O
where	O
SHAKE	O
is	O
intractable	O
.	O
</s>
<s>
peptide	O
planes	O
)	O
by	O
solving	O
rigid	O
body	O
constraints	O
iteratively	O
in	O
the	O
same	O
basic	O
manner	O
that	O
SHAKE	O
is	O
used	O
for	O
atoms	O
involving	O
more	O
than	O
one	O
SHAKE	O
constraint	B-Algorithm
.	O
</s>
<s>
An	O
alternative	O
constraint	B-Algorithm
method	O
,	O
LINCS	B-Algorithm
(	O
Linear	B-Architecture
Constraint	B-Algorithm
Solver	O
)	O
was	O
developed	O
in	O
1997	O
by	O
Hess	O
,	O
Bekker	O
,	O
Berendsen	O
and	O
Fraaije	O
,	O
and	O
was	O
based	O
on	O
the	O
1986	O
method	O
of	O
Edberg	O
,	O
Evans	O
and	O
Morriss	O
(	O
EEM	O
)	O
,	O
and	O
a	O
modification	O
thereof	O
by	O
Baranyai	O
and	O
Evans	O
(	O
BE	O
)	O
.	O
</s>
<s>
LINCS	B-Algorithm
applies	O
Lagrange	O
multipliers	O
to	O
the	O
constraint	B-Algorithm
forces	O
and	O
solves	O
for	O
the	O
multipliers	O
by	O
using	O
a	O
series	O
expansion	O
to	O
approximate	O
the	O
inverse	O
of	O
the	O
Jacobian	O
:	O
</s>
<s>
in	O
each	O
step	O
of	O
the	O
Newton	O
iteration	B-Algorithm
.	O
</s>
<s>
This	O
approximation	O
only	O
works	O
for	O
matrices	O
with	O
eigenvalues	O
smaller	O
than	O
1	O
,	O
making	O
the	O
LINCS	B-Algorithm
algorithm	O
suitable	O
only	O
for	O
molecules	O
with	O
low	O
connectivity	O
.	O
</s>
<s>
LINCS	B-Algorithm
has	O
been	O
reported	O
to	O
be	O
3	O
–	O
4	O
times	O
faster	O
than	O
SHAKE	O
.	O
</s>
<s>
Hybrid	O
methods	O
have	O
also	O
been	O
introduced	O
in	O
which	O
the	O
constraints	O
are	O
divided	O
into	O
two	O
groups	O
;	O
the	O
constraints	O
of	O
the	O
first	O
group	O
are	O
solved	O
using	O
internal	O
coordinates	O
whereas	O
those	O
of	O
the	O
second	O
group	O
are	O
solved	O
using	O
constraint	B-Algorithm
forces	O
,	O
e.g.	O
,	O
by	O
a	O
Lagrange	O
multiplier	O
or	O
projection	O
method	O
.	O
</s>
