Ideal Gas Simulation: Troubleshooting Pressure and Gas Constant in 2D Model

In summary, the conversation discusses a 2D simulation of an ideal gas with elastic collisions between hard spheres. The speaker has encountered two problems, including getting higher values for pressure compared to theoretical values and adjusting the gas constant for units of pixels and pixels/iteration. The discussion also touches on the assumptions of the ideal gas model and the role of area in 2D simulations. The speaker mentions the possibility of unit conversion errors and the simplicity of the simulation's model.
  • #1
leibo
11
1
Hi

I built with Python a simulation of an ideal gas in 2D, treating the molecules as hard spheres with elastic collisions. I am trying to test the experimental values of P,T etc. in the simulation versus the theoretical values. however, I have two problems:

1) when comparing the pressure in the simulation to the pressure predicted from P=NmVx^2/a^2 (when N in number of molecules, m is the mass of each molecule and a^2 is the area of the box) I consistently get approximately the right values, but they are higher by a factor of 1000. What can be the reason?

2) I wonder how should I adjust the value of the gas constant R to the fact that in the simulation distances and velocities are measured with unites of pixels and pixels/iteration rather than by meters and meters/sec?

Thanks in advance and sorry for my poor english
 
Physics news on Phys.org
  • #2
leibo said:
I built with Python a simulation of an ideal gas in 2D, treating the molecules as hard spheres with elastic collisions.

An ideal gas is composed of point masses with no interaction (except gravity).

leibo said:
when comparing the pressure in the simulation to the pressure predicted from P=NmVx^2/a^2 (when N in number of molecules, m is the mass of each molecule and a^2 is the area of the box) I consistently get approximately the right values, but they are higher by a factor of 1000. What can be the reason?

In a 2D simulation the walls are 1D and therefore have no area but a length only.

leibo said:
I wonder how should I adjust the value of the gas constant R to the fact that in the simulation distances and velocities are measured with unites of pixels and pixels/iteration rather than by meters and meters/sec?

Just define the size of a pixel in meters and the length of an iteration step in seconds.
 
  • #3
Molecules of an ideal gas do interact through elastic collisions. They do not interact through electric attraction forces. according to Wikipedia: "the ideal gas model depends on the following assumptions...All collisions are elastic and all motion is frictionless (no energy loss in motion or collision)...There are no attractive or repulsive forces between the molecules or the surroundings".

I did not say the walls have area, I said the box has area.

Thank you for the second answer.
 
  • #4
A factor of 1000 looks like some error in unit conversions - kg to g, m to mm or whatever.
 
  • #5
leibo said:
Molecules of an ideal gas do interact through elastic collisions.

With the walls but not with each other. Points are simply to small for local interactions. By using elastic spheres instead of points you created a very simple real gas model.

leibo said:
I did not say the walls have area, I said the box has area.

In a 2D simulation the area of the box is irrelevant for the pressure. It plays the same role as the volume in 3D.
 

1. What is an ideal gas simulation?

An ideal gas simulation is a computer program or mathematical model that simulates the behavior of an ideal gas. It is based on the ideal gas law, which describes the relationship between pressure, volume, temperature, and number of moles of an ideal gas.

2. Why do scientists use ideal gas simulations?

Scientists use ideal gas simulations to better understand the behavior of gases in different conditions. This can help in the development of new technologies and processes, as well as in predicting and explaining real-world phenomena.

3. How accurate are ideal gas simulations?

Ideal gas simulations are not 100% accurate as they are based on idealized assumptions and do not account for all real-world factors such as intermolecular interactions. However, they can provide valuable insights and predictions that are close to real-world observations.

4. What types of systems can be simulated using ideal gas simulations?

Ideal gas simulations can be used to simulate a wide range of systems, including closed systems, open systems, and even mixtures of ideal gases. They can also be used to study phase transitions and chemical reactions involving gases.

5. Are ideal gas simulations only used in chemistry?

No, ideal gas simulations are used in various fields such as physics, engineering, and materials science. They are also used in industries such as aerospace, where understanding the behavior of gases is crucial for designing and testing aircraft and spacecraft.

Similar threads

Replies
2
Views
568
Replies
18
Views
1K
Replies
2
Views
1K
Replies
6
Views
1K
Replies
56
Views
3K
  • Classical Physics
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
946
  • Introductory Physics Homework Help
Replies
2
Views
534
  • Mechanical Engineering
Replies
3
Views
946
  • Thermodynamics
Replies
20
Views
2K
Back
Top