some of my earlier contribution in 2008
My contributions are
1. changes made to sync top rectangle to appear directly above the string and mass for changing number of mass, n
2. input panel on the left
3. create a custom function drag() so that can read the codes clearly in a bigger view
4. added m"[j]"
5. add graph of ketotal, petotal tetotal
6. add angular momentum
7. added sound in collision
8. added dw[j]/dt = -g/l*Math.sin(alpha[j])-k*l*omega[j] for air resistance simulation
9. redesign the look and feel of the sliders bar etc
added better controls
fix bug of KE = 0.5*m*l^2*omega^2
fix error by changing method back to BISECTION
made view more zoom in for increase in size
17May 2011, took about 3 hours to combine the features in both simulations
based on Fu-Kwun Hwang's original Real Newton's Cradle here
used codes from Ejs Open source Newton's Cradle java Applet by Paco customized by lookang
drag from paco added
added 3D
rework the simulation to suit better results from real collision
changes solver to velocity verlet as the others kept giving errors
added sound // sound effect added despite the energy conservation
Toolkit.getDefaultToolkit().beep(); // taken from
//Ceiling Bounce Model written by Wolfgang Christian
made ballMoved the key to change mass m[ballMoved] instead of the older code m[id]
change the codes to layout the balls from left to right instead of the older right to left format
26 july 2011
made the xmin and xmax follow the number of balls, n for centralized view
26july 2011
make dt smaller for slower and smoothly run
checkbox for sound