How to simulate pressure in an ideal gas simulation

AI Thread Summary
To simulate pressure in a 2D ideal gas, it's essential to understand the relationship dictated by the ideal gas law (PV = nRT), which limits control over temperature, pressure, volume, and particle number. While the simulation involves elastic collisions, this introduces complexities as ideal gas behavior assumes non-interacting particles. The discussion highlights that adjusting temperature can influence pressure if volume remains constant, but pressure cannot be changed independently without affecting other variables. The key takeaway is that to manipulate pressure, one must adjust temperature while keeping other parameters constant. Understanding these relationships is crucial for accurate simulations of gas behavior.
leibo
Messages
11
Reaction score
1
Hello

I wrote a simple simulation of an 2D ideal gas, with elastic collisions. I wonder how should I simulate the pressure that is implemented on the particles in the box, by a piston with certain weight. it's easy to adjust the area of the box and the temperature of the particles which is proportional to the velocity squared, but I don't know how to change the pressure directly.

Thanks!
 
Physics news on Phys.org
If the gas is ideal then you don't have the freedom to simultaneously control the temperature, pressure, volume and particle number- you may dictate three parameters, and the fourth will then be fixed according to the ideal gas equation: PV = nRT. In short, you can't arbitrarily change the pressure without losing control of one of the other variables.

Having said that, I'm intrigued about your simulation- surely if the gas particles are colliding elastically, then that breaks one of the ideal gas conditions: that the particles are non-interacting.
 
MikeyW said:
If the gas is ideal then you don't have the freedom to simultaneously control the temperature, pressure, volume and particle number- you may dictate three parameters, and the fourth will then be fixed according to the ideal gas equation: PV = nRT. In short, you can't arbitrarily change the pressure without losing control of one of the other variables.

Having said that, I'm intrigued about your simulation- surely if the gas particles are colliding elastically, then that breaks one of the ideal gas conditions: that the particles are non-interacting.

Yes, you are right, it's a simulation of very simple real gas, rather than an ideal gas. I understand I can not decide the values of all 4 variables n,p,V,T. Yet, I can suddenly change T, with constant n, and V,P would change correspondingly to the equation. In the same way I want to be able to change the pressure P.
 
How do you mean "suddenly change T"? Are you arbitrarily changing the average kinetic energy? As a result of this the temperature and pressure will both change (at constant volume). To control the pressure, you can change T and keep everything else constant.
 
Hi there, im studying nanoscience at the university in Basel. Today I looked at the topic of intertial and non-inertial reference frames and the existence of fictitious forces. I understand that you call forces real in physics if they appear in interplay. Meaning that a force is real when there is the "actio" partner to the "reactio" partner. If this condition is not satisfied the force is not real. I also understand that if you specifically look at non-inertial reference frames you can...
I have recently been really interested in the derivation of Hamiltons Principle. On my research I found that with the term ##m \cdot \frac{d}{dt} (\frac{dr}{dt} \cdot \delta r) = 0## (1) one may derivate ##\delta \int (T - V) dt = 0## (2). The derivation itself I understood quiet good, but what I don't understand is where the equation (1) came from, because in my research it was just given and not derived from anywhere. Does anybody know where (1) comes from or why from it the...
Back
Top