Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Lennard-Jone(LJ) Monte Carlo and Molecular Dynamics programs are as the below to calculate average energies (the details depend on the program; for example, the

The Lennard-Jone(LJ) Monte Carlo and Molecular Dynamics programs are as the below to calculate average energies (the details depend on the program; for example, the Monte Carlo code calculates only the average potential energy). Modify one of these programs to calculate the average of the so-called virial,

where v(r) is the interparticle interaction potential. Calculate the average viral for a liquid-like state of the Lennard-Jones system and use it to find it to find the pressure. In d = 2, the pressure and the viral are related in the following way,

where is the number density in d = 2.

You should know your work: I would like to see the relevant part of your code, know the state point conditions that you used, see some evidence of equilibration etc.

Here is the Lennard-Jone(LJ) Monte Carlo and Molecular Dynamics programs

image text in transcribedimage text in transcribedgrout.close()

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

import numpy as np import math def potential(d2): if d2 cut2: return 0. eLse return 4.*(di6**2-di6)-shift def distancesqCi,j): distancex = position[i,0]-position [j,0] distancex-= boxl*round(distancex/boxl) distancey -position[i,1]-positionLj,1] distancey -- boxL*round(distancey/boxL) return distancex**2+distancey**2 def gr(hist): for i in range(N) for j in range(i): bin round(math.sqrt(distancesq(i, J))/dr) if bin

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions