center of mass calculation in the tcl interface

From: Jacqueline Schmidt (
Date: Sun Feb 24 2013 - 13:02:21 CST

Dear NAMD users, I am trying to use Tcl interface to add a steered MD velocity to a peptide. My system is running prior to SMD simulation for equilibration. Then I want to use the last configuration to pull my peptide 10 Ang upward. For that purpose I want to calculate the center of mass of the peptide at the zeroth step of smd simulation (last configuration from the equilibration steps). To do that, I am using a simple command "measure center $sel" at the beginning of my smd.tcl file (see below), but I get an error ** FATAL ERROR: wrong # args  while executing "measure center $a2 weight mass ** can anyone please help me? here is my smd.tcl # defining a group which includes peptide atoms set grp2 {} for {set j 1 } { $j <=104 } {incr j } { lappend grp2 $j } set a2 [addgroup $grp2] # set the output frequency, initialize the time counter set Tclfreq 10 set t 0 # force constant (kcal/mol/A^2) set k 20 # pulling velocity (A/timestep) set v 0.0000025  set outfilename rklpda_smd_tcl.out open $outfilename w ##*******error happens here************** set r20z [ lindex [ meausre center $a2 weight mass ] 2 ] proc calcforces {} {   global Tclfreq t k v a2 r20z  outfilename   loadcoords coordinate      set r2 $coordinate($a2)   set r2z [lindex $r2 2]   set f2x 0   set f2y 0   set f2z [expr $k*($v*$t-$r2z+$r20z)]   lappend f2 $f2x $f2y $f2z   addforce $a2 $f2      set foo [expr $t % $Tclfreq]   if { $foo == 0 } {       set outfile [open $outfilename a]  # calc time in ps       set time [expr $t]       puts $outfile "$time $r2z $f2z"        close $outfile   }       incr t   return }

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:22:58 CST