NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 11, 2018, 09:55:29 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: About particles and walls /board:23-100-  (Read 4953 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
st@lk3r
Newbie
*
Offline Offline

Posts: 1

«
Embed this message
on: November 01, 2009, 12:55:35 am » posted from:Athens,Attiki,Greece

In the "particles&walls" simulation, there's a parameter called "threshold" in the code that calculates force and field. What is it for?
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: November 01, 2009, 08:42:19 am » posted from:Taipei,T\'ai-pei,Taiwan

Charged Particle and Wall

Please check out the following code in the custom / force tab  :
Code:
private double force(int particle, double a[], double b[], boolean xAxis) {
 double force = 0.0, r2;
 if (particle>=numParticles) return 0.0;
 for (int i=0; i  if (i==particle) continue;
  r2 = (a[i]-a[particle])*(a[i]-a[particle]) + (b[i]-b[particle])*(b[i]-b[particle]);
 [b] if (r2  if (xAxis) force += K*charge[i]*charge[particle]*(a[particle]-a[i])/r2;
  else force += K*charge[i]*charge[particle]*(b[particle]-b[i])/r2;
 }
 return force;
}
The above function was used in evolution to calculate vx(t+dt) and vy(t+dt) (dvx/dt=force(i,x,y,true)/mass)

In the simulation when two
The threshold were added to prevent numerical error.
The force is inverse propose to r2. The force will become very arge when r is very small.
So the force were ignored when two particles are too close to each other.
And this also allow the simulation to have a positive and a negative charge to stick together -- the major reason why it is ignored.

Please post your question at the same topic which contain the simulation you want to discuss.



Logged
Pages: [1]   Go Up
  Print  
A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Charged Particles and Walls
Electromagnetism
Fu-Kwun Hwang 5 24173 Last post July 24, 2018, 04:38:42 pm
by madisonbella
new version of charged particles and walls
Electromagnetism
Fu-Kwun Hwang 7 30641 Last post July 24, 2018, 03:38:53 pm
by rosesandra
collision between twp particles in one dimension(along a line)
Examples for beginner who want to learn EJS
Fu-Kwun Hwang 0 12113 Last post October 10, 2007, 03:13:55 pm
by Fu-Kwun Hwang
how to move particles along a path
Questions related to EJS
Fred Chuit 1 7210 Last post December 30, 2008, 04:20:02 pm
by Fu-Kwun Hwang
Particles and Walls
Simulations from other web sites
ahmedelshfie 3 4289 Last post July 04, 2010, 01:00:36 am
by ahmedelshfie
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.061 seconds with 22 queries.since 2011/06/15