source: EXAMPLES/Python/annealing.py@ e40e335

Last change on this file since e40e335 was e40e335, checked in by baerbaer <baerbaer@…>, 16 years ago

Initial import to BerliOS corresponding to 3.0.4

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@1 26dc1dd8-5c4e-0410-9ffe-d298b4865968

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/usr/bin/env python
2# annealing.py
3#
4# Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
5# Jan H. Meinke, Sandipan Mohanty
6#
7"""Minimize the energy of met-enkaphalin starting from a given structure using
8simulated annealing. In simulated annealing the temperature of a Monte Carlo
9simulation is slowly reduced from Tmax to Tmin.
10"""
11# Adds the source directory to Python's search path.
12import sys
13sys.path.append('../..')
14import smmp, universe, protein
15
16# Initialize the Universe to T=300K with the ECEPP/3 force field, no solvent
17# term (st = 0) and the sub directory SMMP/ as library path. Except for the
18# solvent term, these are the default values. Alternatively, we could have
19# written
20# myUniverse = universe.Universe(st=0)
21# to get the same result.
22myUniverse = universe.Universe(T=300, ff = 'ecepp2', st = 0, libdir ='SMMP/')
23# Create a new protein object from the sequence file ../enkefa.seq and
24# set the dihedral angles according to the values given in ../enkefa.var.
25p = protein.Protein('../enkefa.seq', '../enkefa.ann')
26# Make myUniverse aware of p.
27myUniverse.add(p)
28seed = 81236
29smmp.sgrnd(seed)
30
31Tmin = 100
32Tmax = 1000
33equilibrationSweeps = 100
34sweeps = 100000
35measurementInterval = 1000
36randomStart = 1
37smmp.anneal(equilibrationSweeps, sweeps, measurementInterval, Tmax, Tmin, randomStart)
Note: See TracBrowser for help on using the repository browser.