• ## Outreach

From: Maria Pikoula (maria.pikoula_at_eng.ox.ac.uk)
Date: Sat Mar 08 2014 - 05:51:44 CST

Dear all,

I have been attempting to use simultaneously coordinate and velocity information by processing two trajectories (one with coordinates and one with velocities) but with the same topology.

I have tried this in the spirit of this thread: http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/19291.html

When I try to write out all velocities for each selected atom in each frame, the numbers are always 0. Is this something to do with the way numbers are stored in VMD? It seems like a rounding errors may be to blame. I appreciate any feedback.

##################################
Here are the TCL commands:

set sel_vel [atomselect 1 "water and name O"] #selects coordinates

set sel_coor [atomselect 0 "water and name O"] #selects corresponding velocities

set n [molinfo 1 get numframes]

# here I assign the velocity information to a variable in the coordinate selection

for {set i 0} {\$i < \$n} {incr i} {
\$sel_coor frame \$i
\$sel_vel frame \$i
\$sel_coor set {vx vy vz} [\$sel_vel get {x y z}]
}

#commands to write out the velocity information for vx

set file [open xO_avg_velx_all.txt w]
puts \$file "all vx"
for { set i 0 } { \$i < \$n } { incr i } {
set sum 0
\$sel_coor frame \$i
\$sel_coor update
foreach xcoord [\$sel_coor get {vx}] {
set sum1 [expr \$xcoord + \$sum]}
puts \$file "\$sum [\$sel_coor num]"
}

####################################

Many thanks,

Maria

Maria Pikoula
Doctoral Candidate in Centre for Doctoral Training in Healthcare Innovation
Institute of Biomedical Engineering
Department of Engineering Science
University of Oxford
maria.pikoula_at_eng.ox.ac.uk