Qualitative evidence of the microscopic nature of gases is shown by an effect called Brownian motion.This java applet shows Brownian motion for gas molecules.(Gas molecules in a container continually collide with one another and with the walls of the container.

Keep in mind : this is a slow motion and magnified view in a small area.

Please check out Collision 2D for how to process collision between two particles.

Each circle represents a gas molecule.

N is the total number of molecules in the area.

Enter value into the Text Field and press RETURN.

m2/m1 is the mass ratio of red ball to gray ball.

(Try it, and find out the difference)

Press + will have a smaller time interval. (faster motion)

Press - for slower motion.Click trace check box to show the trace for one of the molecules (red).

Click it again to turn it off and clear the screen.

Right Click to stop the animation, click it again to resume. While the animation is stopped, drag the red ball to relocate its position.If you click No boundary checkbox, particles moving to the right edge will appear at left edge again (No collision with the wall).

p.mussard@sfxavier.ac.uk[/quote:f669a5a961]but the text about "the text 'Green dots are velocity distribution of the molecules'doesn't make sense" doesn't make sense. what text about green dots? what tokking u?

p.mussard@sfxavier.ac.uk[/quote:490d1a9613]but the text about "the text 'Green dots are velocity distribution of the molecules'doesn't make sense" doesn't make sense. what text about green dots? what tokking u?[/quote:490d1a9613]what tokking u? sounds like me!and btw, sometimes the red ball gets stuck in the top left corner (as i have said earlier), and sometimes it disappears!

You want the horizontal axis to be time, however, what will be the vertical axis? (Click load ejs as signed applet and make some modifications- add another plotting panel and add some traces , then you will get what you wanted! ).

Tell me in more detail what you want, and I will show you how to do it with ejs.

You can add any diagram easily with ejs.1. Click "loaded ejs as signed applet"2. You will need to give permission for browser to load ejs into your computer (If it is the first time you click that button)3. When EJS is fully loaded (It will take a few minutes for first time user).4. You will find introduction/model/view panels. You can find out how the variables are defined, what kind of equations were used,...etc from model panel. The x,y coordinate for the big particle is defined as px,py in the model. The time is defined as t.5. Click View panel to add a new window to display diagram. 1) add a dialog window (You can adjust the size and location). 2) add a plottingPanel to plot diagram. 3) add a trace element to display trace for (t,py) 4) assign variable t, py as x,y properties for trace. 5. Click run button to create a new simulation with the diagram you want.

I have created a flash motion to demonstrate the above steps. However, the interface were shown in Chinese Because I am running it with my Chinese OS.

Thanks, thanks a lot for your help. I watched your Flash Animation 15 times to set all parameters correctly. But lastly it will not run. I got 100 errors. After playing around with it and tested this applet without modifying anything, it gave me also these errors. What I did was: I loaded the ejs by clicking on the "load ejs as signed applet" button and then hit the right green arrow. The applet was not runnig and I got these Error-Messages in the lower subgraph.Perhaps I have something to change on my computer settings.

Finally its working on my Notebook. Is it possible to create this applet like the original Java Applet with entering the Numbers of Particles and No Boundary on icons. I tried it, but I couldn`t find a solution."Trace" is working fine now...

I should have told you, if you are serious about it. You should download EJS and installed it directly into your computer. Load EJS as a signed applet is a quick way to run EJS inside a browser. Please check out Easy java simulation (Download and related informations)Copy the previous saved source code brownianmotion.xml to EJS/Simulation

Click EjsConsole.jar under EJS. A local EJS version will be ready for you.It will be faster and you can work off-line.

Do you mean you want to change the number of particles shown in the simulation?In the model, number of particle is defined as n(the default value is 800).If you want to change the number of particle in the simulation.I would suggest you go to the model panel.Find out variable n under tab-name (Disks)Left click n, then right click to select "add a variable".Then enter n1 as variable name, set default value to n. (or n/2 or whatever reasonable value),Then switch Constraints tabs.Change all the n in the for loop to n1. (You only need to change two "n" to "n1". So all the calculation are with number of n1 particles)If you want you can also change "n" in initialization page to "n1".Now, it is all done with the model.

We need to change the VIEW. Find ParticleSet and ArrowSet.Change the property "Elements" from "n" to "n1".Add we need to modify GUI to set n1.You can add slider or NumberField for your pourpose.Or if you do not need the "size" slider , just change the property of "Slidersize". 1. change it variable from "sizen" to n1. 2. set minimum to minimun number of particle. 3. set maximum to n. 4. set Format field to something like "n=0" or "n=#"You will see the change at the same time in the editor window.

Run the new simulation and you will be able to get a new simulation you want.

Please take a look at EJS manual or document from EJS's home site.http://fem.um.es/You can download latest version from their web site ,too.

thanks a lot for your help. Yes I downloaded the software and changed already the inputs and I created new icons. Everything is working now. My last question is: Is there a way to get no boundary for the main particle?

The above codes let particle changes direction when it hit the wall. The id for main particle is 0, so change the above code from for i=0 to for i=1Then,main particle will not be bounded to the simulation region.You may add whatever conditions you want into the Constraint page(s).