NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
October 22, 2014, 08:45:55 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"Choose a job you love, and you will not have to work for a day in your life." ...Confucius (551-479 BC)
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Ejs Open Source Newton's Cradle Java Applet by Fu-Kwun & lookang  (Read 11445 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
on: May 17, 2011, 02:26:39 am » posted from:Singapore,,Singapore

Ejs Open Source Newton's Cradle Java Applet by Fu-Kwun & lookang, this version has best collision detection by Fu-Kwun.

this is a derived work based on Fu-Kwun Hwang's original Real Newton's Cradle here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1976.msg7387#msg7387

this remixed was a necessary as it has better collision detection than my older remix here Ejs Open source Newton's Cradle java Applet by Paco customized by lookang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=824.0

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
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!


reference: http://en.wikipedia.org/wiki/Newton%27s_cradle
Newton's cradle
Newton's cradle, named after Sir Isaac Newton, is a device that demonstrates conservation of momentum and energy via a series of swinging spheres.

Construction
A typical Newton's cradle consists of a series of identically sized metal balls suspended in a metal frame so that they are just NOT touching each other at rest. Each ball is attached to the frame by two wires of equal length angled away from each other. This restricts the pendulums' movements to the same plane.

Action
If the first one ball on the left is pulled away and is let to fall, it strikes the second ball in the series and the the first ball comes to an almost dead stop. The ball on the opposite side of the series acquires the momentum of the first ball almost instantly and swings in an arc that one would expect of the first ball.

The intermediate balls appear almost stationary. What actually happens is that the first impact transfer momentum and kinetic energy from the first ball to the second. The second ball having the momentum and kinetic of the first ball now hits almost perfectly elastic with the third ball, transferring it's momentum and kinetic energy to the third ball in the series. This transfer of momentum and kinetic energy continues until the (n-1) and n ball, where finally the last ball n moves off with the momentum and kinetic energy of the first ball. Toward the end of oscillation, the intermediate balls are jiggling a bit.

Further intrigue is provided by starting more than one ball in motion. With two balls, exactly two balls on the opposite side swing out and back. While this is satisfyingly symmetrical, why could not one opposite ball swing out twice as fast, or four balls at half speed? Having the same number of balls swing on each side conserves both energy and momentum.

Further Physics
Newton's cradle is a clear visual example of the conservation of both momentum (mass x velocity) and kinetic energy (0.5 x mass x velocity^2) in a mechanical system. When the cradle only has two balls, these two principles are sufficient to specify its behaviour; i.e. there is no way of conserving momentum and energy when the first ball strikes the second other than for the first to stop and the second to move off at the same speed as the first.
For example, if the balls each have a mass of 1 and the first ball strikes the other two stationary balls with a velocity of 1, the initial momentum of the system is 1 x 1 = 1 and the kinetic energy is 0.5 x 1 x 1^2 = 0.5. If the first balls stops and the third ball moves off with a velocity of 1 (which is what actually happens), the momentum remains 1 and the kinetic energy remains 0.5.
However, if the first ball were to bounce backwards with a velocity of -1/3 and the second and third balls were to move forward each at a velocity of 2/3, the momentum would be 1 x (-1/3 + 2/3 + 2/3) = 1 and the kinetic energy 0.5 x 1 x ((-1/3)^2 + (2/3)^2 + (2/3)^2) = 0.5; i.e. this would also preserve both momentum and kinetic energy; however, it is not what happens.
The reason is because the collisions are actually with free individual balls and not with 2 connected-joint balls.
What actually happens is that the first impact transfer momentum and kinetic energy from the first ball to the second. The second ball having the momentum and kinetic of the first ball now hits almost perfectly elastic with the third ball, transferring it's momentum and kinetic energy to the third ball in the series. This transfer of momentum and kinetic energy continues until the (n-1) and n ball, where finally the last ball n moves off with the momentum and kinetic energy of the first ball. Toward the end of oscillation, the intermediate balls are jiggling a bit.

Applications
The most common application is that of a desktop executive toy. A less common use is as an educational aid, where a tutor explains what is happening or challenges students to do so.


* newtoncradle3D.png (43.11 KB, 758x549 - viewed 177 times.)
« Last Edit: July 26, 2011, 07:20:04 pm by lookang » Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #1 on: May 17, 2011, 02:32:50 am » posted from:Singapore,,Singapore

changes:

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
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
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 http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1976.msg7387#msg7387
used codes from Ejs Open source Newton's Cradle java Applet by Paco customized by lookang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=824.0
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 http://www.compadre.org/OSP/items/detail.cfm?ID=8385&Attached=1
//Ceiling Bounce Model written by Wolfgang Christian
18May2011
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

« Last Edit: July 26, 2011, 07:58:45 pm by lookang » Logged
ahmedelshfie
Ahmed
Hero Member
*
Offline Offline

Posts: 954



«
Embed this message
Reply #2 on: May 17, 2011, 05:17:21 pm » posted from:Uberaba,Minas Gerais,Brazil

Nice, i like the idea good work, i notice have a bug in 3d i not sure in my computer have it may only in my PC is
when i tried to change postion the 3d applet appear look like black screen and also disappear too fast and back again too fast.
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #3 on: May 17, 2011, 10:09:16 pm » posted from:Singapore,,Singapore

Hi ahmed,
i suspect that Ejs 4.3.3.1 latest version is causing this bug in the compiled simulations.
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #4 on: May 18, 2011, 10:01:47 pm » posted from:Singapore,,Singapore

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

enjoy!


* newtonscradle3Dbest.png (79.5 KB, 1277x797 - viewed 191 times.)
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #5 on: July 26, 2011, 03:26:17 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

submitted to http://www.compadre.org/osp/index.cfm for their consideration into the digital library

Newton's Cradle Model
reference: http://en.wikipedia.org/wiki/Newton%27s_cradle
Newton's cradle, named after Sir Isaac Newton, is a device that demonstrates conservation of momentum and energy via a series of swinging spheres.

Construction in 3D
A typical Newton's cradle consists of a series of identically sized metal balls suspended in a metal frame so that they are just NOT touching each other at rest. Each ball is attached to the frame by two wires of equal length angled away from each other. This restricts the pendulums' movements to the same plane.
Mathematical Model:
the simplified equations of motion is ODE for a single mass(pendulum) are:
d (cta)/dt = omega
d(omega)/dt = -g*sin(cta)/L

Design features:
currently, the simulation allows of exploration of n max = 7 masses with each mass m[ii] that can be vary from the slider control from 1 to 5 kg.
additional variables are:
gravitational constant downward g = 9.81 m/s^2
Length of pendulums, L
k coefficicent of air resistance model by equation F = k*omega

The usabilty control:
To move the balls, move the cursor over to the mass, click and hold the left mouse and drag the mouse to lift the masses. note that all masses are selectable and movable to a new height along the each path of the pendulums swing.

Design Views:
there are 2 types views available selectable by the check-boxes 2D and 3D,
2D world view
3D world view
hint:
may be useful to observe the transfer of linear momentum from ball to ball by pressing the step button to aid understanding of momentum transfer during collisions
may be useful to observe the scientific representations of kinetic energies KE[ii], gravitational potential energies PE[ii] and total mechanical energies TE[ii]
graph of scientific representations of kinetic energies KE total, gravitational potential energies PE total and total mechanical energies TE total
Exercises:
select n =2 for a simple 2 ball system for the experiment.

Pull and release one ball. Note the results and explain mathematically in terms of conservation of engergy and momentum.
m1 u1 + m1 u1 = m1 v1+ m2 v2
1/2 m1 u1^2 + 1/2 m2 u2^2 = 1/2 m1 v1^2 + 1/2 m2 v2^2
record your observations and discuss if the two equations above can account for the observations

select n = 3 , 4, 5, 6, 7 and repeat the experiment above.
Do the results meet your expectations?
hint: can you conclude that the just before and just after collisions
momentum in = momentum out
kinetic energies in = kinetic energies out.
the clue lies in the conservation of momentum and kinetic energies just before and after collisions.


Discuss what are the differences between this computer model and real life apparatus.
hint: the newton's cradle motion will continue in this back and fro motion until all energies are lost to damping due to air resistance, friction, sound and vibrations.

In this simulation the default is all balls have the same mass. What would occur if this was not the case?


Advanced Learner:
Please submit your remix model that model features that are not available in the existing virtual lab and share your model with the world through NTNUJAVA Virtual Physics Laboratory http://www.phy.ntnu.edu.tw/ntnujava/index.php?board=28.0. Impacting the world with your model now.
Credits:

The Newton's Cradle Model was created by Fu-Kwun Hwang, customized by Loo Kang WEE, using the Easy Java Simulations (EJS) version 4.3.3.2 authoring and modeling tool. An applet version of this model is available on the NTNU website < http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2195.0 >.

You can examine and modify this compiled EJS model if you run the model (double click on the model's jar file), right-click within a plot, and select "Open EJS Model" from the pop-up menu. You must, of course, have EJS installed on your computer. Information about EJS is available at: and in the OSP comPADRE collection .


* newtoncradle150x170.JPG (23.03 KB, 150x170 - viewed 155 times.)
« Last Edit: July 26, 2011, 03:27:53 pm by lookang » Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1728


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #6 on: July 26, 2011, 07:57:42 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

accepted!
http://www.compadre.org/osp/items/detail.cfm?ID=11348&S=7

wolfgang also gave some pointers to

26july 2011
make dt smaller for slower and smoothly run
checkbox for sound

done!

enjoy!
Logged
Pages: [1]   Go Up
  Print  
"Choose a job you love, and you will not have to work for a day in your life." ...Confucius (551-479 BC)
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Open Source Ejs Newton's First Law java applet
Collaborative Community of EJS
lookang 1 9093 Last post November 25, 2008, 04:50:03 pm
by lookang
Ejs Open source Newton's Cradle java Applet by Paco customized by lookang
Collaborative Community of EJS
lookang 11 14276 Last post May 17, 2011, 02:53:45 am
by lookang
Newton's Cradle by lookang
Simulations from other web sites
ahmedelshfie 2 2588 Last post April 07, 2010, 07:37:34 pm
by ahmedelshfie
Ejs Open Source Newton's Mountain Projectile Orbits Model java applet
Collaborative Community of EJS
lookang 5 9121 Last post June 17, 2013, 07:34:00 am
by lookang
Ejs Open Source Newton's Law of Cooling Model Java Applet
Collaborative Community of EJS
lookang 3 5186 Last post April 25, 2012, 09:59:44 pm
by lookang
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.581 seconds with 23 queries.since 2011/06/15