NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
July 23, 2019, 08:00:33 am

Give me a standpoint and I will move the earth. ...Archimedes (287-212BC)

 Pages: [1] 2   Go Down
 Author Topic: Molecular Model for an Ideal Gas  (Read 466685 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 : 1 users think this message is good1 Molecular Model for an Ideal Gas « Embed this message on: January 29, 2004, 08:41:18 pm » posted from:,,Satellite Provider

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
There are 27 translations,
Higher number at the end means more translation been done.
or

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
There are 27 translations,
Higher number at the end means more translation been done.
or
 *** There are 1 more attached files. You need to login to acces it! Logged
Guest
 « Embed this message Reply #1 on: January 30, 2004, 11:40:48 am » posted from:,,Satellite Provider

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
 Logged
Guest
 « Embed this message Reply #2 on: January 30, 2004, 11:42:55 am » posted from:,,Satellite Provider

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
 Logged
kristianly
Newbie

Offline

Posts: 2

 « Embed this message Reply #3 on: September 03, 2004, 09: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
 Logged
narpoodle123
Newbie

Offline

Posts: 1

 « Embed this message Reply #4 on: May 23, 2005, 08:50:50 pm » posted from:Shawnee,Kansas,United States

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
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #5 on: May 24, 2005, 09:31:41 am »

You should have received the source code in your email account now!
 Logged
lopa
Newbie

Offline

Posts: 5

 « Embed this message Reply #6 on: September 26, 2005, 12:28:57 pm »

sir/mam
Could you eamil me the source code of this appelet .
thanks
 Logged
chfahlke
Professor of Physiology
Newbie

Offline

Posts: 2

 « Embed this message Reply #7 on: December 29, 2005, 06:02:27 pm » posted from:Hanover,Niedersachsen,Germany

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
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #8 on: June 23, 2006, 03:17:30 pm » posted from:Taipei,T'ai-pei,Taiwan

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.
 Logged
talimu
Newbie

Offline

Posts: 1

 10 Units « Embed this message Reply #9 on: July 04, 2007, 01: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
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #10 on: July 10, 2007, 05: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.
 Logged
jshearman
Newbie

Offline

Posts: 3

 « Embed this message Reply #11 on: February 16, 2008, 09: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.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #12 on: February 16, 2008, 12: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
-*-
 Logged
lookang
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #13 on: April 11, 2008, 02:33:37 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Hi Prof

The new applet looks like made using EJS, chance to share to source code xml ?
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #14 on: April 12, 2008, 12:28:26 am »

It is available now.
 Logged
lookang
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #15 on: April 12, 2008, 09:57:17 am »

thanks!!
 Logged
anaktyl
Newbie

Offline

Posts: 3

 « Embed this message Reply #16 on: January 08, 2009, 09:01:28 pm »

hi Prof

I'm not programmer but chemist,and I have a favour ,Do you have any applet similar above but with constant volume and change mass of particles-choose one of ideal gases.

Thank you very much for help
 « Last Edit: January 08, 2009, 09:06:31 pm by anaktyl » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #17 on: January 09, 2009, 05:48:58 pm » posted from:Taipei,T'ai-pei,Taiwan

Parameters for ideal gas are Pressure P, Volume V, number of particles N and Temperature T.

P*V=N*R*T

You want volume to be kept the same, and change the mass of the particles (different gas).
What else need to be the same? or changed?

If it is the same temperature T and the same number of particles, then pressure will be the same.
Because the same temperature T, means the same average kinetic energy.
So heavy particles will have less average velocity (compared to light particles).
 Logged
anaktyl
Newbie

Offline

Posts: 3

 « Embed this message Reply #18 on: January 09, 2009, 09:33:11 pm »

Hi Prof

Yes I agree with you. PV=NRT

but If we change the volume the pressure will be going up or down P=NRT/V and  the particles will be moving slower or faster, it's similar with changing mass of particles

So I just need very simple animation, where can I change just number of particles, ideal gas(mass of particles), and volume.

Thank you for help
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #19 on: January 10, 2009, 11:09:51 am »

What do you mean by change just number of particles, ideal gas(mass of particles), and volume.
Do you mean change all of the above 3 patrameter at the same time and without changing other parameters?

From P*V=N*R*T:
If you can freely change V and N, there is no way to keep P and T constant (unless V/N is keep as constant,too!)

When you use mouse to change parameters, you can adjust one parameter at a time.
Let me know exactly what you want to do. Please give me an example (in detail) and I will try to find way to help you! O.K.?
 Logged
anaktyl
Newbie

Offline

Posts: 3

 « Embed this message Reply #20 on: January 19, 2009, 03:52:10 am »

Hi

for example on the top you showing how the volume is moving along with pressure (up,down),
I need the animation where volume is constant means you can change using mouse or tape the size, and then tape the number of molecules, and showing how pressure is changing, it makes sense

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #21 on: January 19, 2009, 09:31:02 am »

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

The above simulation was designed for a system with piston so that the volume changed according to external apply modification: change pressure, temperature or number of particles.

I modified another simulation to simulate what you want.
You can select Volume fixed checkbox, then you can change number of particle,temperature and the pressure will change according to your input (you can also change volume,too!).

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
 Logged
descale
Newbie

Offline

Posts: 2

 « Embed this message Reply #22 on: March 01, 2009, 07:49:32 am »

Hello,
this Java Applet is excellent, perfect work! I have few a questions. Can you help me, please?

1) Why are there used Runge Kutta equations?
2) How to calculate the accuracy of volume calculation?
3) Can we find there method Monte Carlo?
4) It is there momentum?

Thank you very much. Tomas
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #23 on: March 01, 2009, 08:12:49 am »

1.If the volume is fixed and without consider gravitation effect, you do not need to use Runge-Kutta method.
2. I do not understand the rest of your questions:
Quote
2) How to calculate the accuracy of volume calculation?
3) Can we find there method Monte Carlo?
4) It is there momentum?
e.g. what do you mean by "the accuracy of volume calculation"?
Why you want to find  Monte Carlo method?
momentum??? DO you maen "linear momentum"?
 Logged
descale
Newbie

Offline

Posts: 2

 « Embed this message Reply #24 on: March 01, 2009, 09:10:09 am »

e.g. what do you mean by "the accuracy of volume calculation"?
Why you want to find  Monte Carlo method?

I thought there has been applied method Monte Carlo. And the accuracy of Monte Carlo is 1/sqr(n). That's okay, thank you.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #25 on: March 01, 2009, 11:05:05 am »

The volume of the system was calculated from width/height and display the average( in time).
 Logged
siuchun
Newbie

Offline

Posts: 2

 « Embed this message Reply #26 on: April 06, 2009, 09:23:15 pm »

Dear Prof Hwang,

I have learned your molecular model for an ideal gas in the internet. It's a fantastic simulation.

Now I have a question that if the collision between the partials and walls is not elastic, the wall will occur plastic deformation after collision. Can this model be used to simulate the phenomenon?
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #27 on: April 07, 2009, 08:11:40 am » posted from:Taipei,T\'ai-pei,Taiwan

You need to define the model for your case:
How the wall will be deformed and how much enegy will be loss duing collision and what that will affect later collision.

It will be easier to modify it from EJS version of ideal gas law: PV=nRT
 Logged
siuchun
Newbie

Offline

Posts: 2

 « Embed this message Reply #28 on: April 07, 2009, 10:08:07 am »

In fact, I am not familiar with Java. Can I simulate that plastic collision in MATLAB?
 « Last Edit: April 07, 2009, 10:26:19 am by siuchun » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #29 on: April 07, 2009, 10:12:38 am » posted from:Taipei,T\'ai-pei,Taiwan

I am not familiar with MathLab, but I believe it can be done.
You need to define your model (variables/relations/constraints) and write the code to deal with it.
If you are familiar with MathLab, you should be able to learn EJS very quickly!
You can check out SWF movie show step by step instructions to create java simulation with EJS to know what EJS can help you.
 Logged
 Pages: [1] 2   Go Up
Give me a standpoint and I will move the earth. ...Archimedes (287-212BC)