计算化学公社

标题: VMD统计一帧中聚合物的二面角求助 [打印本页]

作者
Author:
ZZU_SCU    时间: 2023-2-22 19:53
标题: VMD统计一帧中聚合物的二面角求助
聚合物是该结构,我要统计所有酰胺键的二面角C2-N2-C4-C2。所有红色的碳原子均是C2,酰胺键的碳是C4,酰胺键的氮是N2。为了避免选择错误的C2原子,写的Tcl文件如下。输出结果都是* * * 2的二面角,感觉不对。请大家指导迷津 (, 下载次数 Times of downloads: 16) (, 下载次数 Times of downloads: 7)    (, 下载次数 Times of downloads: 9) 请添加.xyz后缀,接着用VMD打开
  1. set a [atomselect top "name N2"]
  2. set myfile [open Dihedral.dat w]
  3. set l1 [$a get index]
  4. foreach ind $l1 {
  5. set b [atomselect top "name C2 and withinbonds 1 of index $ind"]
  6. set d [atomselect top "name C4 and withinbonds 2 of index $ind"]
  7. set c [atomselect top "name C2 and withinbonds 1 of index $d"]

  8. if {[$b num]==1 && [$c num]==1 && [$d num]==1} {
  9. set l2 [$b get index]
  10. set l3 [$c get index]
  11. set l4 [$d get index]
  12. set tmp [list $l2 $ind $l4 $l3]
  13. set result [measure dihed $tmp]
  14. puts $myfile "$l2 $ind $l4 $l3 $result"
  15. }
  16. }
  17. puts "All Done!"
复制代码








欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3