24小时热门版块排行榜    

查看: 1999  |  回复: 15
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

jianchaoyv

金虫 (小有名气)

[交流] 【求助】向bay__gulf求助!! 已有4人参与

目前在做碳纳米管中水的相变,请教一下怎样写.tcl脚本来计算radial density of oxygen 和 orientation distributions of water molecules within CNTs?
虽然这个问题对你可能比较简单,但对我来说却很棘手,望赐教!
同时恭喜bay__gulf发JPCA!
也欢迎其他高手指教!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

雪扬0613

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
1176040楼: Originally posted by bay__gulf at 2012-03-16 08:45:31:
把z轴分成若干小的bin, 然后分段统计就可以了
bin 的大小应合适, 不宜太大,曲线细节不清楚, 也不宜太小,曲线噪音就太大了

谢谢了,也就是将bin的长度稍微大于偶极矩的模长度就可以了,是这么理解的吧
13楼2012-03-16 10:34:15
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 16 个回答

bay__gulf

金虫 (著名写手)

刘苏州

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
jianchaoyv(金币+10):谢谢指点 2010-06-22 18:29:11
ghcacj(金币+10):谢谢 2010-06-22 19:55:31
radial density, 也就是径向分布, 很常用, vmd 也提供了一个工具可以直接计算
就是measure gofr, 参考 http://www.ks.uiuc.edu/Research/vmd/current/ug/node133.html, 以及一个gui 界面, 参考 http://www.ks.uiuc.edu/Research/vmd/plugins/gofrgui/

至于取向分布, 用户较少只能自己写了,
vmd 的强大之处不在于内置了多少工具, 更不是做多漂亮的图形
而是提供了一个原子(集团)为数据结构的编程环境, 可以按照自己的需要实现任意的功能
下面是当时用的代码, 现在看来很幼稚了但拿它入门还是不错的

# count the dipolar-z angle and Legendre 2nd order polynomial in a pore,
# make sure the psf/dcd be the top molecular

set outf [open theta.dat w]

set numFrame [molinfo top get numframes]

set lgd 0
for { set fr 1 } { $fr < $numFrame } {incr fr } {
   set wt [atomselect top "water and name OH2 and z < 7.6 and z > -7.6 " frame $fr]
   set n [$wt num]
   set theta 0

   foreach resid [$wt get resid] {

      set wto  [atomselect top "resid $resid and name OH2" frame $fr]
      set wth1 [atomselect top "resid $resid and name H1" frame $fr]
      set wth2 [atomselect top "resid $resid and name H2" frame $fr]

      set coordo  [measure center  $wto]
      set coordh1 [measure center $wth1]
      set coordh2 [measure center $wth2]

      set coordh  [vecadd $coordh1 $coordh2]
      set coordh  [vecscale 0.5 $coordh]
      set vecd    [vecsub $coordh $coordo]

      set thetai  [expr acos ([expr [lindex $vecd 2] / [veclength $vecd]])]
      set thetai  [expr $thetai * 180.0 / 3.1416]
      set theta   [expr $theta + $thetai]

      $wto  delete
      $wth1 delete
      $wth2 delete
   }

   set theta [expr $theta/$n ]
   set costheta [expr cos ([expr $theta*3.1416/180.0])]
   set lgd [expr $lgd + [expr $costheta * $costheta]]
   puts $fr
   puts $outf [format "%d %f" $fr $theta]

   $wt delete
}
   set lgd [expr $lgd / $numFrame * 1.5 - 0.5]
   puts "3*<(cosθ)^2> - 1 = $lgd"
close $outf
2楼2010-06-22 16:44:02
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jianchaoyv

金虫 (小有名气)

能否具体讲一下两种操作方法的步骤或给一个具体例子?你给的连接看了,但还是不知道怎么去操作。麻烦你帮忙写一个.tcl脚本,谢谢!

[ Last edited by jianchaoyv on 2010-6-22 at 20:24 ]
3楼2010-06-22 19:41:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jianchaoyv

金虫 (小有名气)

请问上面提供的脚本中:
  set coordh  [vecadd $coordh1 $coordh2]
      set coordh  [vecscale 0.5 $coordh]
      set vecd    [vecsub $coordh $coordo]

      set thetai  [expr acos ([expr [lindex $vecd 2] / [veclength $vecd]])]
还有最后set lgd [expr $lgd / $numFrame * 1.5 - 0.5]
这几句看不懂,能不能解释一下?谢谢!

[ Last edited by jianchaoyv on 2010-6-23 at 09:56 ]
4楼2010-06-23 09:50:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见