Ejs open source java applet 1D collision carts with realistic collision!

based on an earlier work by Paco and lookang

http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=831.0
Thanks To Professor Fu-Kwun Hwang for guidance and Professor Francisco Esquembre for EJS and the open source digital library source codes.

special mention to engrg1 for the research done on the spring force model for all cases of e.

/htdocs/ntnujava/ejsuser/14019/users/sgeducation/lookang/Momentum1DForceModel01_pkg/Momentum1DForceModel01.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list

the codes by engrg1 was especially useful for this final version :)
public double impactForce (double xa,double xb, double va ,double vb){
double f;
double y;
double x;
double z;
double a;
a=0;

// using the impact force equaion provided by Objalvo and Cohen ,1 1997
// Damping coefficient based on Brach, 1991a
// Formula can be found Pg 3 of http://www.brachengineering.com/publications/SAE%202003-01-0491.pdf
// this equation is not perfect and can only give a good estimate of the coefficient of resistution

if (es>0.05) {
x =Math.log(es)*Math.log(es);
z = Math.sqrt( x/( Math.PI* Math.PI+x));
} else z=1;

if(xa    f= klinear*((xb-xa)-L); // change to 2*L by lookang
else
f = klinear*(L-(xa-xb)); // change to 2*L by lookang
y = mass1*mass2/(mass1+mass2);
if(Math.abs(xa-xb)     a= -2*z*(Math.sqrt(klinear*y))*(va-vb) + f;

}
s_z = "a= " + double2String(a,1000) +"size= " + double2String(2*radius1,1000) ;
return a;

}