[url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=864.0]Charged Particle and Wall[/url]

Please check out the following code in the [b]custom / force tab[/b]  :
[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;
}
[/code]
The above function was used in evolution to calculate vx(t+dt) and vy(t+dt) (dvx/dt=force(i,x,y,true)/mass[i])

In the simulation when two
The threshold were added to prevent numerical error.
The force is inverse propose to r[sup]2[/sup]. 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.