下载此文档

一维分子动力学模拟python代码.pdf


文档分类:IT计算机 | 页数:约4页 举报非法文档有奖
1/4
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/4 下载此文档
文档列表 文档介绍
1 #!/usr/bin/env python3
2
3 # Molecular dynamics in 1D
4
5 # import needed modules
6 import random
7 import math
8 import sys
9
10 # the main loop function
11 def main(md):
12 time = # initialise time
13
14 # open coordinate output files
15 cfile = open("","w")
16 # open temperature output file
17 tfile = open("","w")
18 ("# time temperature\n")
19 # open energy output file
20 efile = open("","w")
21 ("# time energy\n")
22
23 # main MD loop
24 for t in range():
25 print("#---- Time = ",round(time,2)," ---- Steps = ",t,"
----") # python3
26 en = () # calculate forces
27 (t, en) # integrate equations of motion
28 # print current coordinates to file
29 (time, cfile)
30 # print current temperature to file
31 (str(round(time,2))+" "+str()+"\n")
32 # print current energy to file
33 (str(round(time,2))+" "+str()+"\n")
34
35 time += # increase time by dt
36
37 (tfile, efile) # calculate averages, SD, etc
38
39 # clo

一维分子动力学模拟python代码 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数4
  • 收藏数0 收藏
  • 顶次数0
  • 上传人慢慢老师
  • 文件大小114 KB
  • 时间2021-12-11
最近更新