Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103427435
Step2.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Mar 1, 23:59
Size
555 B
Mime Type
text/x-python
Expires
Mon, Mar 3, 23:59 (2 d)
Engine
blob
Format
Raw Data
Handle
24572775
Attached To
rMARAFFO Master-cycle
Step2.py
View Options
import
matplotlib.pyplot
as
plt
from
MD
import
*
nsteps
=
2000
dt
=
0.0046
N
,
L
,
pos
,
vel
=
read_pos_vel
(
'sampleT94.4.dat'
)
# Run MD simulation
output
=
run_NVE
(
pos
,
vel
,
L
,
nsteps
,
N
,
dt
)
# Plot g(r)
plt
.
plot
(
output
[
'gofr'
][
'r'
],
output
[
'gofr'
][
'g'
])
plt
.
show
()
# Plot S(k)
plt
.
plot
(
output
[
'sofk'
][
'k'
],
output
[
'sofk'
][
's'
])
plt
.
show
()
# Write g(k) into a file
np
.
savetxt
(
'gofr.dat'
,
np
.
column_stack
((
output
[
'gofr'
][
'r'
],
output
[
'gofr'
][
'g'
])))
# Write S(k) into a file
np
.
savetxt
(
'sofk.dat'
,
np
.
column_stack
((
output
[
'sofk'
][
'k'
],
output
[
'sofk'
][
's'
])))
Event Timeline
Log In to Comment