How to simulate pressure in an ideal gas simulation

Click For Summary

Discussion Overview

The discussion revolves around simulating pressure in a 2D ideal gas simulation, particularly how to implement pressure changes exerted by a piston on gas particles within a box. The scope includes theoretical considerations of ideal gas behavior, simulation mechanics, and the implications of elastic collisions among particles.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant describes a simulation of a 2D ideal gas with elastic collisions and seeks guidance on simulating pressure changes due to a piston.
  • Another participant asserts that in an ideal gas, one cannot control temperature, pressure, volume, and particle number simultaneously, referencing the ideal gas equation PV = nRT.
  • A participant acknowledges the limitations of controlling all four variables and suggests that changing temperature while keeping particle number constant will affect pressure and volume accordingly.
  • There is a question regarding the implications of elastic collisions on the ideal gas assumptions, particularly concerning particle interactions.
  • A later reply inquires about the method of changing temperature and its effects on pressure, suggesting that controlling temperature can indirectly control pressure at constant volume.

Areas of Agreement / Disagreement

Participants generally agree on the constraints imposed by the ideal gas law but express differing views on the implications of elastic collisions and the methods for controlling pressure in the simulation. The discussion remains unresolved regarding the best approach to simulate pressure changes.

Contextual Notes

Participants note the dependency on the ideal gas equation and the implications of elastic collisions, which may not align with the assumptions of an ideal gas. There is also uncertainty about how to implement sudden changes in temperature and their effects on pressure.

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 5 ·
Replies
5
Views
2K
Replies
6
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 11 ·
Replies
11
Views
7K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 35 ·
2
Replies
35
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 24 ·
Replies
24
Views
6K