Author Topic: Ejs Open source Newton's Cradle java Applet by Paco customized by lookang  (Read 24149 times)

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
http://home.phy.ntnu.edu.tw/~lookang/EJS_4.1_090115/NewtonsCradlewee_Simulation.html
Open source Newton's Cradle Applet by found in EJS 4.1 user/murcia/fem/mechanics
Ejs Open source Newton's Cradle java Applet by Paco customized by lookang

http://www.egglescliffe.org.uk/physics/physicists/newton/nlaws/collision.html
Collision Analysis
Assumptions:
  * Spheres are perfectly smooth
  * Collisions are head on.
  * Energy is purely translational and not rotational or vibrational

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!


alternative 2 versions here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1976.0 by Fu-Kwun Hwang !! ;D
« Last Edit: May 17, 2011, 03:12:35 am by lookang »

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Newton's Cradle Applet by found in EJS 4.1 user/murcia/fem/mechanics
« Reply #1 on: December 17, 2008, 10:04:33 pm »
Paco is a Professor at Universidad de Murcia in Spain.

The following is the offical address (http://www.um.es/)
Universidad de Murcia. Avda. Teniente Flomesta, nº 5 - 30003 - Murcia · Teléfono

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Newton's Cradle Applet by found in EJS 4.1 user/murcia/fem/mechanics
« Reply #2 on: December 18, 2008, 08:33:48 am »
Yes! think the xml originally made by prof. paco, the tags and descriptions did not clearly state so i can't attribute future derived works.

i can only guess from the folder names.

thanks!

EJS 4.1 has a lot of improvements over EJS 3.47, everyone should get the latest version to try ;)

a cool Newton's Cradle applet that i always wanted to know how to make it a learning tool.

murcia is the name of the person? or is it Prof paco ? University of Murcia fem@um.es ?


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
13May2011
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


My learning journey for interactive balls mass, the codes i was looking for,
note: element is assigned variable name "ballMoved"

// Compute new angle and freeze the ball
alpha[ballMoved] = Math.atan2(x[ballMoved]-xTop[ballMoved],yTop-y[ballMoved]);
omega[ballMoved] = 0;

// Limit the motion
double maxAngle = Math.PI/2;
if (alpha[ballMoved]> maxAngle) alpha[ballMoved] = maxAngle;
if (alpha[ballMoved]<-maxAngle) alpha[ballMoved] = -maxAngle;

// Check for one ball moving the others
for (int i=ballMoved+1; i  if (alpha[ballMoved]>alpha[i]) { alpha[i] = alpha[ballMoved]; omega[i] = 0; }
}
for (int i=0; i  if (alpha[ballMoved]}

// Force constant rod length
for (int i=0; i  x[i] = xTop[i] + l*Math.sin(alpha[i]);
  y[i] = yTop - l*Math.cos(alpha[i]);
}
please note the codes has missing ++ symbols, due to forum's modified php?
so if you want to copy the codes go into the source xml files


source code
download the *.jar for using the applet on standalone without internet connection.
« Last Edit: May 13, 2011, 11:26:44 pm by lookang »

aidooon

  • Newbie
  • *
  • Posts: 1
hello ppl. .
i am working on a simulation for this newton's cradle. .
i want to make the simulation myself
but i like to get use of this cute simulation in here. .
so may u please put here a full physical study for newton's cradle. . so that i can start working on the simulation. .
thanx alot . .

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
The physical model is
. Var. = t      Increment   = dt
alpha=   omega
omega=   -g/l*Math.sin(alpha)-k*l*omega

All ejs models in this forum are open sourced.
Try to use ejs to read the codes.

Good luck!

ahmedelshfie

  • Hero Member
  • Posts: 930
A good applet, i didn't see this applet before.
I have a comment about one thing the sound of applet seem fast more than movement.
May wrong in my browser ???
  

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
The code for the sound play and off is not good enough to handle multiple hits in very close time.
I don't know how to make it better.

But you are right ahmed, the problem is the code not powerful for the sound.
« Last Edit: October 10, 2010, 08:54:12 am by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
hello ppl. .
i am working on a simulation for this newton's cradle. .
i want to make the simulation myself
but i like to get use of this cute simulation in here. .
so may u please put here a full physical study for newton's cradle. . so that i can start working on the simulation. .
thanx alot . .
http://www.phy.ntnu.edu.tw/ntnujava/ntnujavazip.php?ejsuserjar=3114
Download the jar
Unzipped it
Inside the folders there should be the java file.
Can find?

I think you should be able to figure out the equations from the open sourced xml or java, do your own homework ;)

In a Newton's Cradle , hard steel spheres hang at rest side by side. If one or more of the spheres is displaced and released , near elastic collisions ensue. http://www.egglescliffe.org.uk/physics/physicists/newton/nlaws/collision.html

Collision Analysis
Assumptions:
   * Spheres are perfectly smooth
   * Collisions are head on.
   * Energy is purely translational and not rotational or vibrational
   * Collisions are perfectly elastic


alternative 2 versions here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1976.0 by Fu-Kwun Hwang
« Last Edit: October 11, 2010, 11:46:29 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
trying to make sound in array format.

but the sound still don't sound very realistic due to lack of intensity of hits proportional to sound loudness.

currently it just play the wav file

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
13May2011
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

enjoy!
« Last Edit: May 16, 2011, 12:17:02 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
added 3D
work in progress!

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
this simulation version has been replaced by Ejs Open Source Newton's Cradle Java Applet by Fu-Kwun & lookang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2195.0
enjoy!

my blog to make my Ejs simulations more searchable on the internet for open educational resource OER :)
http://weelookang.blogspot.com/2011/05/ejs-open-source-newtons-cradle-java.html