NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 21, 2020, 05:26:10 am

A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"

 Pages: [1] 2   Go Down
 Author Topic: Brownian Motion  (Read 512847 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: 3086

 « Embed this message on: January 29, 2004, 08:38:56 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 13 translations,
Higher number at the end means more translation been done.
or

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).

Here is a related youtube movie

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 13 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:13:41 am » posted from:,,Satellite Provider

Subject: Brownian motion
Date: Sat, 5 Sep 1998 10:18:45 +0100
From: "Peter Mussard" <p.mussard@sfxavier.ac.uk>
To: <hwang@phy03.phy.ntnu.edu.tw>
The animation is good, but the text 'Green dots are velocity distribution of the
molecules' doesn't make sense.

Peter Mussard

p.mussard@sfxavier.ac.uk
 Logged
Guest
 « Embed this message Reply #2 on: July 11, 2004, 06:46:34 pm »

[quote:f669a5a961="Anonymous"]Subject: Brownian motion
Date: Sat, 5 Sep 1998 10:18:45 +0100
From: "Peter Mussard" <p.mussard@sfxavier.ac.uk>
To: <hwang@phy03.phy.ntnu.edu.tw>
The animation is good, but the text 'Green dots are velocity distribution of the
molecules' doesn't make sense.

Peter Mussard

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?
 Logged
Guest
 « Embed this message Reply #3 on: July 11, 2004, 06:55:58 pm »

sometimes the red ball gets stuck in the top left corner and won't move at all. Why? (i tried noboundary too, but the ball stayed still.)
 Logged
ibum
Newbie

Offline

Posts: 0

 « Embed this message Reply #4 on: July 11, 2004, 07:01:54 pm »

[quote:490d1a9613="Anonymous"][quote:490d1a9613="Anonymous"]Subject: Brownian motion
Date: Sat, 5 Sep 1998 10:18:45 +0100
From: "Peter Mussard" <p.mussard@sfxavier.ac.uk>
To: <hwang@phy03.phy.ntnu.edu.tw>
The animation is good, but the text 'Green dots are velocity distribution of the
molecules' doesn't make sense.

Peter Mussard

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

Offline

Posts: 3086

 « Embed this message Reply #5 on: May 16, 2005, 02:53:33 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

The following is new verision of brownian motion created with EJS.

If you want to know how to process collision between two particles,
please check out EJS version of Collision 2D.

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
kuschei
Newbie

Offline

Posts: 1

 « Embed this message Reply #6 on: July 03, 2005, 05:05:12 pm »

 Logged
Newbie

Offline

Posts: 3

 « Embed this message Reply #7 on: March 22, 2006, 04:11:19 pm »

fine fine fine...
but where is the Applet files of the new verison
i want it :shock:
will you send it to me (email)
thank you
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #8 on: March 05, 2007, 02:40:29 pm » posted from:Taipei,T'ai-pei,Taiwan

 Logged
vvelemir
Newbie

Offline

Posts: 3

 « Embed this message Reply #9 on: April 09, 2007, 11:35:42 pm »

Thank You.
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #10 on: April 25, 2007, 03:14:45 pm »

I am doing alot of research on financial markets. Is it possible to create for this 2 dimensional plot a 1 dimensional brownian function with time on x-axis?

thx a lot
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #11 on: April 26, 2007, 04:09:03 pm »

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

Offline

Posts: 8

 « Embed this message Reply #12 on: May 09, 2007, 03:37:24 pm »

I would like to see somthing like this:

http://www.mscf.uky.edu/~mai/java/stat/brmo.html

on the left the brownian motion and on the right a one dimension plot of it.

thx a lot for your help...

P.S.: I cannot get the source code for the java applet from the other weblink.
I need this applet a little bit larger to see the fine structure.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #13 on: May 11, 2007, 04:51:17 pm »

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.

You can also save the ejs locally.
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #14 on: May 12, 2007, 01:47:25 am »

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.

 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #15 on: May 14, 2007, 03:24:34 pm »

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...

Thanks a lot for your help.
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #16 on: May 14, 2007, 03:35:02 pm »

After saving the original and my new created applet, I am getting after executing these *xml Files on both the same error. Please try it also.
This creates the Error:

<Name>
N> 5.0
]]>
</Value>
<Type>double</Type>
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #17 on: May 14, 2007, 05:23:44 pm »

Everything is working well now.

The only thing now is to add icons for Number of Particles and No Boundary.

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #18 on: May 15, 2007, 10:10:39 pm »

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.
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/
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #19 on: May 16, 2007, 04:36:01 pm »

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?

thx again for helping me!!!

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #20 on: May 16, 2007, 10:24:46 pm »

You will find the following codes in the Constrain page:

//vdistribution();
for (int i=0; i  double r = diameter/2;
double d = y-ymin-r;
if (vy<0 && d=-vy; }
d = ymax-r-y;
if (vy>0 && d=-vy; }
d = x-xmin-r;
if (vx<0 && d=-vx; }
d = xmax-r-x;
if (vx>0 && d=-vx; }
}

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=1
Then,main particle will not be bounded to the simulation region.
You may add whatever conditions you want into the Constraint page(s).
 Logged
vinduwa
Newbie

Offline

Posts: 1

 « Embed this message Reply #21 on: November 27, 2007, 05:25:48 am »

Prof Hwang;

Could you please send me the source code of Brownian Motion. Thank you..My e-mail is vinduwa@yahoo.com

Vindu Kathriarachchi

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #22 on: November 27, 2007, 08:56:49 am »

Click DOWNLOAD just below EJS simulation, you will get EJS source code.
 Logged
plack
Newbie

Offline

Posts: 1

 « Embed this message Reply #23 on: November 02, 2008, 02:52:20 am »

Very interesting ..Thanks prof.
 Logged
cricky
Newbie

Offline

Posts: 1

 « Embed this message Reply #24 on: July 22, 2009, 11:26:14 pm » posted from:Manila,Manila,Philippines

thanks a lot for the info prof hwang

commission de surendettement
- commission de surendettement, vous pouvez demander un dossier de surendettement.
 Logged
mirlinda
Newbie

Offline

Posts: 3

 « Embed this message Reply #25 on: September 11, 2009, 04:24:42 pm » posted from:Tetovo,Tetovo,Macedonia

Dear Fu-Kwun Hwang,

I am very interested in these java applets for visualizing thermodinamc processes in a gas.

If you don't mind to send me the source codes in java since I want to use this simulations in my classes in a high school, to teach the gas temathic.

but I would like the interface to translate in my lnaguage, so the peupil would undestand what they see.

I would be very gratfull If you send me the source codes.

Any use would be referenced.

my email: m.ebibi@seeu.edu.mk

My best wishes,

Mirlinda
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #26 on: September 11, 2009, 11:55:23 pm » posted from:Taipei,T\'ai-pei,Taiwan

If you just want to translate it into your local language. Please check out Translate Strings into local language format for all the simulations under category : JDK1.0.2 simulations (1996-2001) .

If you really need the source code, just download the attachment file gas2d.java.
However, it was written with JDK1.0.2 more than 10 years ago!
 Logged
Newbie

Offline

Posts: 1

 « Embed this message Reply #27 on: February 01, 2010, 12:16:49 pm » posted from:Karachi,Sindh,Pakistan

Nothing more to say ... just perfect
-*-
 Logged
Doc_B
Newbie

Offline

Posts: 8

 « Embed this message Reply #28 on: November 15, 2010, 05:21:24 pm » posted from:Bremen,Bremen,Germany

Dear Fu-Kwun Hwang,

is it possible to create the brownian path in 3 Dimensions?

I just tried to do it, but it was not very successful.

Maybe anybody can help.

 *** There are 2 more attached files. You need to login to acces it! Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #29 on: November 16, 2010, 04:36:15 pm » posted from:,,Taiwan

It is possible to create the brownian path in 3 Dimensions.
However, you need to process 3D collision.