Question
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
grout.close()
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 binStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started