Here is the missing code :
from math import *
from numpy import *
from random import *
import matplotlib.pyplot as plt
N=4 #number of atoms in the gas
#using natural units
masse=1 #mass of an atom
dt=0.01 #time discretization
re = 2**(1/6) # equilibrum distance of the gas
length = 10 #...
It's just a normal text file.
I am trying what you said :
from math import *
from numpy import *
from random import *
import matplotlib.pyplot as plt
N=4 #number of atoms in the gas
#using natural units
masse=1 #mass of an atom
dt=0.01 #time discretization
re = 2**(1/6) # equilibrum distance...
Yes it should be possible if we consider that the atoms in the box interacts with fictive atoms around the box, who are images of the atoms in the box.
I also plan to modelize the rebounds on the box as you suggest and yes, indeed, working with a circle box is a good idea as it should help to...
Here is my code. I translated almost everything into english but i let some variables in french if they are understandable (like "masse" for mass for example). I tried to make helpful commentaries as well to facilitate your reading of the code but if something is still unclear in my code, please...
Thank you very much DrClaude for your answer.
Sorry, reading your answer, i realize i was not accurate enough describing my code. I effectively use the image of the atoms as you proposed, and calculate the interactions between those atoms and the ones on the box, only if the distance is less...
Thank you for your answer BvU. Yes i am new here, i am not still used to the functioning of the forum: i solemnly promise to read the PF guidelines :smile:
Sorry for the unclearness, i will give more details in my answers to DrClaude if you want to read it.
I already identified a problem...