### Author Topic: Molecular Model for an Ideal Gas  (Read 497529 times)

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Molecular Model for an Ideal Gas
« on: January 29, 2004, 09:41:18 pm »
Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list

Ideal gas law \$PV=N k T\$ :  gas consists of N particle at tempearture T in a container (volume V) with pressure P.
And temperature \$T\$ is proportional to \$V_{avg}^2\$ where \$V_{avg}\$ is the average velocity for all the particles.

This java applet shows a microscopic model for an ideal gas. The pressure that a gas exerts on the walls of its container is a consequence of the collisions of the gas molecules with the walls.
In this model:
1. The molecules obey Newton's law of motion.

2. The molecules move in all direction with equal propability.

3. There is no interactions between molecules (no collisions between molecules).

4. The molecules undergo elastic collisions with the walls.

You can change the following parameters
1. N: Total number of molecules

2. P: The presure of the system

3. v: The velocity of each molecules.

4. The width of the container (Click near the boundary and Drag the mouse)

The volume of the container is adjusted automatically according to the above parameters.
The animation is suspended when you press the mouse button. It is resumed when you release the button.
Try to find out the relations between
1. total number of molecules N ---- volume V

2. the pressure of the system P--- volume V

3. the velocity of the molecules v --- volume V

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list

• Guest
##### topic25
« Reply #1 on: January 30, 2004, 12:40:48 pm »
Subject: model for an idel gas
Date: Mon, 22 Mar 1999 22:44:29 +0100
From: Stefan Berger <averell.bo@cityweb.de>
To: hwang@phy03.phy.ntnu.edu.tw
dear mr. hwang,

i'm a teacher for physics in germany. this is the third time i launched
your site in the internet. but when i try out your applet i get problems
by changing the number of particles. always i'm trying to change this
value it doesn't change the number of particles in the applet. can you
help me?

sincerely, stefan berger, bochum, germany

• Guest
##### topic25
« Reply #2 on: January 30, 2004, 12:42:55 pm »
Subject: Re: model for an idel gas
Date: Tue, 23 Mar 1999 13:40:57 +0100
From: Stefan Berger <averell.bo@cityweb.de>
To: Fu-Kwun Hwang <hwang@phy03.phy.ntnu.edu.tw>
dear mr. hwang

thank you for helping! now it works!

sincerely, stefan berger

#### kristianly

• Newbie
• Posts: 2
##### Changing the shape of the container
« Reply #3 on: September 03, 2004, 10:33:42 am »
Dear Prof Hwang, when I changed the shape of the container, the pressure changes. Shouldn't it remain constant since the gas should react by pushing the ceiling upward to achieve constant pressure. Is the parameter for pressure actually the mass since changing the shape of the container does not change the pressure although area of ceiling is changed.

Thanks, :lol:
Christian Lee
NIE, Singaore

#### narpoodle123

• Newbie
• Posts: 1
##### Email Code
« Reply #4 on: May 23, 2005, 09:50:50 pm »
Could you eamil me the source code that gos with that appelet i want to use it as a physics engine for a little game im making. http://kcgstupy@kc.rr.com

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### topic25
« Reply #5 on: May 24, 2005, 10:31:41 am »
You should have received the source code in your email account now!

#### lopa

• Newbie
• Posts: 5
##### topic25
« Reply #6 on: September 26, 2005, 01:28:57 pm »
sir/mam
Could you eamil me the source code of this appelet .
thanks

#### chfahlke

• Professor of Physiology
• Newbie
• Posts: 2
• Teaching physics to medical students
##### topic25
« Reply #7 on: December 29, 2005, 07:02:27 pm »
Dear Dr Hwang,
I would greatly appreciate to receive the code for the ideal gas java applet.
Thank you very much in advance.
Sincerely yours,
Christoph Fahlke

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### topic25
« Reply #8 on: June 23, 2006, 04:17:30 pm »
Someone send me an email and ask questons related to this applet. Questions and responses are posted for your reference:

We use finite number of particles to simulate the real system.  In the simulation we did not  take into account collisions between  particles. The collision between particles and wall are treated as elastic collision.  Due to the limited number of particle (200 as default),  the simulation will show deviation from equilibrium state.  In the real world, there are 1019 particles cm3. The statistatic error is inverse proportional to squar root of the number of particles.  So we can measure fix number of pressure or volume in real world when the system is in equilibrium.  But we can not reach that goal for a real simulation with only several hundred of particles.

[1] When we change the width of the chamber we get different volumes even though we are keeping the same values for the variables.  Do you why this would happen?

R: User can drag the boundary to change the boundary for the chamber.  The simulation will move back to new equilibrium condition. As long as "Pressure" and "number of particles" and "average velocity"  are not changed, the volume should return back to the original value. The deviation is due to statistatic error as explained above.

[2] When the piston is near the top or bottom of the chamber the instantaneous volumes shows greater deviations than when the piston is more centered vertically.  Is there a reason for this?
R: The velocity in the simulation is much smaller than that in the real world.  If we put the velocity in the simulation close to the real case, you would not be able to see any of the particles. Because it will be too fast. In real world, the velocity of the particle in room temperature is several hundred meter per second. And the size of the chamber usually are less than meter.  The deviation is due to the velocity is too small.

[3] Sometimes the bottom line of the piston disappears above the top of the chamber and the volume output is essentially constant.  Are the instantaneous volumes collected valid when the piston moves out of sight or have we exceeded the limits of the algorithm?
R: The volume output  should change when the piston move above the top of the simulated region.  It is not a constant.  I do not why you said it is essentially a constant.

[4] Can you tell us the units for the parameters used to calculate the volumes?  Also, are the particles considered to have volumes or are they treated as point particles?
R:  The particles did not considered to have volumes in the simulation. The volume in the simulation is calculated from width* height in unit of pixel divided by  1000.

[5] If the students generate three proportionality constants by varying each parameter individually, would you expect that they could derive a combined proportionality constant that would correctly predict the volume of gas when all three parameters vary?  This would be a constant for the simulation analogous to the ideal gas law constant, R.
R: you will find the volume of the gas is propotional to number of particle, square of velocity  and inverse propertional to pressure.
So Pressure*Volume= N * k * velocity2
You can ask students to find out the constant k.

#### talimu

• Newbie
• Posts: 1
##### Units
« Reply #9 on: July 04, 2007, 02:09:17 am »
Dear mr. Hwang
I'm a student.
I found you application very interesting.
Please help me. How can i know what are the units of pressure volume in Molecular Model for an Ideal Gas  applet.
Thank You
Tali

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Molecular Model for an Ideal Gas
« Reply #10 on: July 10, 2007, 06:20:03 am »
Sorry for the late reply. I was in Greece for Computer Based Learning in Science (CBLIS2007) international conference. when you post the message.
I just came back to Taiwan yesterday afternoon

In real world, you will find 3*1019 particles in one cubic center meter volume.
There is no way the simulation can simulate so many particles.
So the unit in the simulation is a relative scale.

#### jshearman

• Newbie
• Posts: 3
##### Re: Molecular Model for an Ideal Gas
« Reply #11 on: February 16, 2008, 10:04:22 am »
This is a fantastic simulation! My high-school students in Hong Kong LOVE it for its mad behaviour when you change the parameters violently and I love it because it makes the relationship of kinetic theory to the Gas Laws so clear.

Would it be difficult to modify it so that one can control the volume also and, preferably, have a temperature control rather than a velocity control? This would make it more accessible to the students. Ideally, I would like four controls corresponding to p, V, n and T with radio buttons to select which one is going to be controlled by the student and which one is allowed to vary as a result of that change.

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Molecular Model for an Ideal Gas
« Reply #12 on: February 16, 2008, 01:32:35 pm »
Actually, you can change the volume for the above applet.
Just drag near the right edge and move it left/right.

However, I have created another applet due to your request.
I hope the following is what you ask for. Please let me know if you still want more.
User can change Pressure(P), Velocity(v), Temperature (T), number of particle (N) and width of the system.
However, I did not add Volume as an adjustable parameter, because we are simulated an equilibrium state.
The volume of the system is not determined by the gas system itself. And I think we should teach student about this.
(Otherwise, we need to decide which one should be fixed (P or T) when volume is changed).

The applet has been modified to include fixed volume option. 2009/01/19
-*-

#### lookang

• Hero Member
• Posts: 1774
• http://weelookang.blogspot.com
##### Re: Molecular Model for an Ideal Gas
« Reply #13 on: April 11, 2008, 03:33:37 pm »
Hi Prof

The new applet looks like made using EJS, chance to share to source code xml ?