[MMTK] Adding displacements to Protein Configuration
khinsen at cea.fr
khinsen at cea.fr
Tue Nov 29 23:40:44 CET 2005
On 29.11.2005, at 22:45, vanitha at cs.wisc.edu wrote:
> Code in SteepestDescent.py:
>
> from MMTK import *
> from MMTK.ForceFields import Amber94ForceField
> from MMTK.ParticleProperties import ParticleVector
>
> def Minimize( universe, maxIter, tolerance):
> # The current configuration of the universe is the initial guess
>
> energy, gradient = universe.energyAndGradients()
>
> iter = 1
>
> while 1:
> direction = ParticleVector( universe, -gradient.array);
gradient already is a ParticleVector, so this should be:
direction = -gradient
> # Update the configuration
> universe.addToConfiguration( universe, direction)
And that should be:
universe.addToConfiguration(direction)
(and probably include some scaling factor to make physical sense -
adding forces to positions is not reasonable).
> 1) Once I find the minimum energy configuration using my code, how
> do I
> update the PDB to reflect the new atomic positions? Some sample
> code will
> be greatly appreciated.
You can write a PDB file at any time using
universe.writeToFile('some_file.pdb')
> 2) Is there any way to just get the gradients without having to get
> the
> energy as well. I'm assuming that function evaluations are not
> cheap and
> I'd like to avoid them if possible.
You always get the energy, as there is nothing to gain by not
calculating it. Most of the computational effort for energy and
gradients is shared, and of the remainder, the gradient takes the
bigger share.
Konrad.
--
------------------------------------------------------------------------
-------
Konrad Hinsen
Laboratoire Leon Brillouin (CEA-CNRS), CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
------------------------------------------------------------------------
-------
More information about the mmtk
mailing list