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

Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: lookang on March 19, 2010, 03:45:42 pm



Title: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: lookang on March 19, 2010, 03:45:42 pm
Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang, now remixed by lookang so i can learn from examining the codes legally because the condition of use is attribution of original authors.

Reference:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=178.msg791#msg791

Brownian motion
What?
This is a simulation of Brownian motion of a big particle (dust particle) that collides with a large set of smaller particles (molecules of a gas) which move with uniform motion in different random directions.

How?
The Brownian motion of a particle in a liquid is thus due to the instantaneous imbalance in the combined forces exerted by collisions of the particle with the much smaller liquid molecules (which are in random thermal  motion) surrounding it. http://en.wikipedia.org/wiki/Brownian_motion

Why?
The mathematical model of Brownian motion has several real-world applications. An often quoted example is stock market fluctuations.  http://en.wikipedia.org/wiki/Brownian_motion
[ejsapplet]



Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: lookang on March 21, 2010, 10:15:30 pm
changes made:

1 color the background green
2 added elastic wall slider
3 added elastic between particles slider
4 a couple of check-boxes for visualization


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: lookang on March 29, 2010, 03:26:26 pm
good YouTube on Real Life Brownian Motion as explained by Professor Bowley discusses Albert Einstein, Brownian motion and whether pollen is alive. More videos at http://www.sixtysymbols.com/


other applets:
http://galileo.phys.virginia.edu/classes/109N/more_stuff/Applets/brownian/brownian.html


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: lookang on April 19, 2012, 11:54:05 am
Lookang,

I like what you have done to the brownian motion applet. I was wondering if you could help me make an additional modification. I am trying to increase the number of Particle[0] to an array size so that the user can input a number of "yellow" particles say from 1 to 20 particles. I am having a difficult time doing this for I am a novice at the coding part of ejs.

Thank you for any help or insight you can give me.

Thanks

jake

done!
the extra codes are:
// set
for (int counter=0; counter pxset[counter]=  x[counter];
  pyset[counter]=  y[counter];
}

the rest is easily to figure out when you are inside EJS right?
hope this is what you need :)
enjoy!

my blog has the entry too
http://weelookang.blogspot.com/2010/06/ejs-open-source-brownian-motion-gas.html


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: frodo on April 19, 2012, 07:45:43 pm
Lookang,

I am honored that you have taken the time to help me. You expertise is much appreciated. The code you created:

Quote
// set
for (int counter=0; counter pxset[counter]=  x[counter];
  pyset[counter]=  y[counter];
}

Should it go into the initialization screen or a new tab on the custom screen? The variable "counter" will then have to be declared on the variables page and it is an array? I am unsure, but that is what I think so far. Please correct me if I am wrong. It also looks like I need to declare pxset and pyset. Are those double type variables? Then do I need to create a slider that is linked to the "counter" variable?

I understand how the basic parts of EJS work, where I am learning is how to make sense of arrays and how to link the appropriate variables to visual objects. This is very complicated, although I enjoy trying to figure out how to do it.  I am truly a novice, but I am excited to learn. This is going to help out so much in my classroom.

Thank you again for your help Lookang!!!!

-jake


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: frodo on April 19, 2012, 07:53:44 pm
Oh there is one more thing I was hoping for, is to have the larger yellow particles concentrated to one area in the view panel. I am hoping to show how a spray of perfume may diffuse across a room as time progresses. I was looking at your blog, very cool by the way, and noticed that the yellow particles were spread out at the start of the simulation. I hope to have mine highly concentrated to one spot to start with. If you have suggestions that would be fantastic.

Thanks again Lookang!!!

jake

p.s. I am following your blog now ;)


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: lookang on April 19, 2012, 08:30:19 pm
you can watch these first
http://weelookang.blogspot.com/2011/02/easy-java-simulation-tutorial.html
or
http://www.um.es/fem/EjsWiki/Main/Webcasts

i am not sure if i can find time to make video tutorial.

maybe i try if time permits


your question:
to make the perfume particles come together,
u can try to change the codes to instead of random start positions

to a fix position of your choice

try it and let us know if you are progressing :)


Title: Re: Ejs Open Source Brownian Motion Gas Model Java Applet by Professor Paco & Hwang
Post by: frodo on April 19, 2012, 11:49:18 pm
Sounds great!!!

I am making a little progress and I will let you know the out come as well as come up with specific questions.

Thanks again!!!!

This forum is a CoLos al help!