How to simulate pressure in an ideal gas simulation

Click For 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.
 

Similar threads

Replies
3
Views
1K
Replies
5
Views
2K
Replies
6
Views
2K
Replies
15
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 35 ·
2
Replies
35
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
24
Views
6K