NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

JDK1.0.2 simulations (1996-2001) => Thermodynamics => Topic started by: Fu-Kwun Hwang on January 29, 2004, 08:38:56 pm



Title: Brownian Motion
Post by: Fu-Kwun Hwang on January 29, 2004, 08:38:56 pm
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 (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=120.0)  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
[youtube=FAdxd2Iv-UA&hl]


Title: topic24
Post by: on January 30, 2004, 11:13:41 am
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


Title: topic24
Post by: 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?


Title: topic24
Post by: 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.)


Title: topic24
Post by: ibum 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!


Title: EJS verison of Brownian Motion
Post by: Fu-Kwun Hwang on May 16, 2005, 02:53:33 pm
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 (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=120.0).





Title: topic24
Post by: kuschei on July 03, 2005, 05:05:12 pm
:)


Title: very good work
Post by: alphadp 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 :D


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on March 05, 2007, 02:40:29 pm
Just click "download applet files for offline use" button, if you login to the forum.


Title: Re: Brownian Motion
Post by: vvelemir on April 09, 2007, 11:35:42 pm
Thank You. :)


Title: Re: Brownian Motion
Post by: Doc_B 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


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang 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.


Title: Re: Brownian Motion
Post by: Doc_B 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 (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.


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang 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 (http://www.phy.ntnu.edu.tw/ntnujava/javaswf/sample2.swf) 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.


Title: Re: Brownian Motion
Post by: Doc_B 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.

Thanks for your help....


Title: Re: Brownian Motion
Post by: Doc_B 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.


Title: Re: Brownian Motion
Post by: Doc_B 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>


Title: Re: Brownian Motion
Post by: Doc_B 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.

thanks in advance ......


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang 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) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=95.0)
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.


Title: Re: Brownian Motion
Post by: Doc_B 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!!!



Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang 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).


Title: Brownian Motion
Post by: vinduwa 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


 


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on November 27, 2007, 08:56:49 am
Click DOWNLOAD just below EJS simulation, you will get EJS source code.


Title: Re: Brownian Motion
Post by: plack on November 02, 2008, 02:52:20 am
Very interesting ..Thanks prof. ;D


Title: Re: Brownian Motion
Post by: cricky on July 22, 2009, 11:26:14 pm
thanks a lot for the info prof hwang

commission de surendettement (http://simulationassurancevie.com/)
- commission de surendettement, vous pouvez demander un dossier de surendettement.


Title: Re: Brownian Motion
Post by: mirlinda on September 11, 2009, 04:24:42 pm
Dear Fu-Kwun Hwang,

I am very interested in these java applets for visualizing thermodinamc processes in a gas.
And everything about gasses.

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


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on September 11, 2009, 11:55:23 pm
If you just want to translate it into your local language. Please check out Translate Strings into local language format (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=100.0) for all the simulations under category : JDK1.0.2 simulations (1996-2001)  (http://www.phy.ntnu.edu.tw/ntnujava/index.php#2).

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!


Title: Re: Brownian Motion
Post by: Adain on February 01, 2010, 12:16:49 pm
Nothing more to say ... just perfect
-*-


Title: Re: Brownian Motion
Post by: Doc_B on November 15, 2010, 05:21:24 pm
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.

Thanks in advance ...Thorsten.


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on November 16, 2010, 04:36:15 pm
It is possible to create the brownian path in 3 Dimensions.
However, you need to process 3D collision.
Please check out Collision 2D (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=120.0)



Title: Re: Brownian Motion
Post by: claudiahenry on December 11, 2010, 05:39:53 pm
Very nice Site number one topic Thanks you..


Title: Re: Brownian Motion
Post by: khayx on July 06, 2011, 10:47:21 pm
First of all, thank you very much for this fantastic site!

I would like to create the following system; if there is someone willing to help, I will gladly give co-authorship of an upcoming paper on the subject.

The systems consists of a set of smaller particles (with the option to vary their masses and the energy of the system) to create the brownian environment and two other kinds of particles (with the option to vary their masses):
1. particles which stick to each other on contact and
2. particles which do not stick to each other on contact.
There should be a counter for each time a couple of this particles touches each other, and another counter for each time the sticky particles stick to each other.
When there is collision of any of these two kinds of particles, the system stops and scrambles the position of all particles but the counters do not initialize. The purpose is to count and compare the interaction of these two distinct sets of particles.

I hope someone is interested.
Many thanks in advance


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on July 09, 2011, 05:41:22 pm
How many particles for each kind of particles you would like to simulate?
And what are the size of each kind of particles (or ratio of radius between two particles?)?
What are the average kinetic energy of each kind of particles (the same average kinetic energy or the same average velocity?)

Quote
When there is collision of any of these two kinds of particles, the system stops and scrambles the position of all particles but the counters do not initialize.
If there are too many particles , collision between two particles will occurs very shortly.
Do you really want to scrambles the position of all particles ???


Title: Re: Brownian Motion
Post by: KateDaring52 on July 20, 2011, 07:38:28 am
Well, great work! You have helped me to improve my knowledge about this field. Thank you so much for sharing.

-*-


Title: Re: Brownian Motion
Post by: khayx on July 27, 2011, 08:38:21 pm
Dear Prof. Hwang,

Thank you very much for replying to my post.
The total number of particles could be variable.
The ratio of radius between the two particles could also be variable.
I would prefer the particles to have the same average kinetic energy.


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on July 28, 2011, 12:19:38 pm
Quote
particles which stick to each other on contact

For those particles which would stick to each other, what need to be modeled when they stick together?
It is a inelastic collision: momentum is conserved but energy is not conserved.

How about angular momentum? Will it rotate around their center of mass?
Or two particles become one bigger particles (with twice the mass and larger radius)?
What will happened when the third particle contact with those two particles?

I need a model in order to create simulation (which is suit to what you really want).
Please provide more detail information so that I can understand what you might want.

I have another question: suppose there are two kind of particles A and B.
Do you mean if A collide with A or B collide with B , they will stick together;
Particle will not stick with each other if A collide with B?


Title: Re: Brownian Motion
Post by: khayx on July 28, 2011, 10:45:38 pm
I want to study if particles that have some sort of affinity for each other (they stick together when they touch) collide more often than particles that don't have any affinity. I know this sounds crazy and not logical, but the truth is to be observed. The system should not be too sophisticated.
Now that you have forced me to reflect on the model, I think it would be better not to interrupt the particle movement of the whole system after the sticky particles or the non-sticky particles touch. Summarizing:
1- There is a bulk of small particles that account for the Brownian system, the sticky particles and the non-sticky particles.
2- Particles have the same average kinetic energy.
3- There are no energy losses (heat).
4- When particles stick together, it could be due to a force that only acts when they interact.
5- This force is discrete, constant, originates in the point where they touch each other and points towards the centre of the particles; it would be interesting to make this force a variable as well.
6- When particles stick together they rotate, there is a angular moment around their centre of mass.
7- When the kinetic energy of the other colliding particles plus the centrifugal force caused by their rotation around the centre of mass allows, the sticking particles separate.
8- There is a counter for each time the sticky particles touch (and stick together). Another counter for each time the non-sticky particles touch.

Thank you very much for your constructive critics and for all the time spent on this model.


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on July 28, 2011, 11:58:24 pm
Quote
I want to study if particles that have some sort of affinity for each other (they stick together when they touch) collide more often than particles that don't have any affinity.

Are you trying to compare two different cases: in different system?
1. system A: particles which stick together when they touch.
2. system B: particles which collide with each other when they touch.

If there are two different kinds of particles A and B, then they are three different cases
1. A and A touch
2. B and B touch
3. A and B touch
It is more than two cases.

Model for the following simulation : There are two kind of particles A,B
When same kind of particle touch, they will stick together and become a bigger particle (momentum is conserved but energy is not conserved).
Elastic collision occurs when different kind of particle touch each other (energy and momentum are conserved).

The energy is not conserved if two particles stick together.
 


Title: Re: Brownian Motion
Post by: khayx on July 29, 2011, 11:31:29 pm
Thank you very much for this first (funny) approach.

1- When two blue particles touch, they should not become one bigger particle, but just stick together until the medium pulls them apart (the sticking force should be a variable). There should be a counter to record these events. (blue counter)

2- When two green particles touch, they just collide but they don’t stick together. There should be a counter to record these events. (green counter)


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on July 30, 2011, 09:29:47 pm
The model has to be pre-defined when a simulation is created.
Please specify the nature  of sticking force. Is it a constant or is it depends on number of particles sticked together? or...

You only said when blue particles touch , they should stick together; when green particles touch, they should collide with each other.
What will happened if blue particle touch green particle??? Ignore?

What need to be conserved when blue particles stick together? momentum and angular momentum?

What is the purpose for the simulation?


Title: Re: Brownian Motion
Post by: khayx on August 01, 2011, 07:30:36 pm
The force is constant and is not dependent on the number of particles interacting.
When blue particles touch green, the same happens as when green touch green: perfect elastic collision.
Ideally, total momentum (linear and angular) should be conserved. For the sake of simplicity, just consider linear and discard angular momentum.

The purpose of this lab would be to try to determine the statistics of these two kinds of interactions (the sticky and the non-sticky).


Title: Re: Brownian Motion
Post by: dennisseda on February 27, 2012, 09:48:15 am
Hi,

I would like to embed the .jar file into my website as part of a quick reference guide. I just need the simulation, and not the text. Is it possible to do this?

Thanks in advance. :)


Title: Re: Brownian Motion
Post by: dennisseda on February 27, 2012, 09:48:45 am
Hi,

I would like to embed the .jar file into my website as part of a quick reference guide. I just need the simulation, and not the text. Is it possible to do this?

Thanks in advance. :)

** sorry for the double post...


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on February 27, 2012, 10:08:45 am
Click embed button just below the applet will give you the following html code
Code:
<applet code='users.ntnu.fkh.browianmotion2type_pkg.browianmotion2typeApplet.class' archive='http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/2/ejs_browianmotion2type.jar' name='browianmotion2type8403' id='browianmotion2type8403' width='540' height='595' mayscript=true>
<param name='draggable' value='true'>
</applet>

You can change the archive URL to URL at your web site if you upload the jar file to your server.


Title: Re: Brownian Motion
Post by: diinxcom on December 14, 2014, 06:01:22 pm
-*-
Just bookmark...
I will read it latter. Thanks :)


Title: Re: Brownian Motion
Post by: CL-Devil on May 14, 2016, 12:16:24 am
Thank you very much.


Title: Re: Brownian Motion
Post by: Fu-Kwun Hwang on May 25, 2016, 06:50:30 pm
add t value bar