Virial pressure
This is a common method to obtain the pressure from a general simulation (it is best suited for molecular dynamics since forces are evaluated in this case). For central interactions, one has:
where one can recognize an ideal term and another one due to the virial. The underline is an average, which would be a time average in molecular dynamics, or ensamble average in Monte Carlo; is the dimension of the system (3 in actual world). is the force on particle exerted by particle , and is the vector going from to : .