# Heat capacity in gas simulation

I have a simulation with a bunch of particles with volume bouncing around in a box with no interaction between them, a hard-sphere gas. Initially, they all have the same momentum |p|=√(2⋅m⋅2/3⋅k⋅T) to have the average kinetic energy 3/2⋅k⋅T.

I'm asked to add a constant energy flux to the system (I solved it with a for statement that adds a little p contribution to every particle for each iteration) and to calculate the heat capacity at constant volume cv.

As cv is the partial derivative of <E> respect T I want to try plotting the average energy respect T but how I get the T value? I'm doing it right if I consider kT= <E>⋅2/3 knowing that I'm in an ideal approximation? How I could make it work for and interacting gas like Lennard-Jones?

Andrew Mason
Homework Helper
I have a simulation with a bunch of particles with volume bouncing around in a box with no interaction between them, a hard-sphere gas. Initially, they all have the same momentum |p|=√(2⋅m⋅2/3⋅k⋅T) to have the average kinetic energy 3/2⋅k⋅T.

I'm asked to add a constant energy flux to the system (I solved it with a for statement that adds a little p contribution to every particle for each iteration) and to calculate the heat capacity at constant volume cv.

As cv is the partial derivative of <E> respect T I want to try plotting the average energy respect T but how I get the T value? I'm doing it right if I consider kT= <E>⋅2/3 knowing that I'm in an ideal approximation? How I could make it work for and interacting gas like Lennard-Jones?