-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3work.py
41 lines (24 loc) · 945 Bytes
/
3work.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
# Script 3/6
######################
## By Megan Stalker ##
######################
# This python script sums the values of the Coulombic and van der Waals energy at each timestep (extracted using extract.sh) to give the instantaneous work of adhesion (in kcalmol-1) and appends to work_adhesion_data.out
###########
# MODULES #
###########
# Imports all the necessary modules
import seaborn as sns
import numpy as np
from pylab import *
####################
# WORK OF ADHESION #
####################
# Extracts the values of the Coulombic and van der Waals energy at each timestep
cou=np.loadtxt('cou_energies.out', dtype=None)
vdw=np.loadtxt('vdw_energies.out', dtype=None)
# Calculates the instantaneous work of adhesion (in kcalmol-1) and appends to work_adhesion_data.out
work_adhesion = []
for i in range(len(cou)):
work_adhesion.append(cou[i]+vdw[i])
np.savetxt('work_adhesion_data.out', work_adhesion)