NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
April 23, 2021, 10:49:01 pm
 Welcome, Guest. Please login or register.Did you miss your activation email? 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length

 Home Help Search Login Register
Ask questions. Follow-up questions. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: Ejs Open source Newton's Cradle java Applet by Paco customized by lookang  (Read 23615 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message on: December 17, 2008, 04:37:00 pm »

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

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!

alternative 2 versions here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1976.0 by Fu-Kwun Hwang !!
 Open source Newton's Cradle Applet by found in EJS 4.1.PNG (55.68 KB, 1024x768 - viewed 910 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: May 17, 2011, 02:12:35 am by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #1 on: December 17, 2008, 09: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
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #2 on: December 18, 2008, 07: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
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
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"

Code:
// 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, 10:26:44 pm by lookang » Logged
aidooon
Newbie

Offline

Posts: 1

 « Embed this message Reply #3 on: October 10, 2010, 04:53:39 am »

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 . .
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #4 on: October 10, 2010, 06:56:19 am »

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!
 Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #5 on: October 10, 2010, 07:00:15 am »

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

 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #6 on: October 10, 2010, 07:51:45 am »

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, 07:54:12 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #7 on: October 11, 2010, 10:35:46 pm »

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
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, 10:46:29 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #8 on: October 12, 2010, 10:06:18 pm »

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
 *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #9 on: May 13, 2011, 10:27:54 pm »

13May2011
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!
 *** There are 1 more attached files. You need to login to acces it! « Last Edit: May 16, 2011, 11:17:02 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #10 on: May 15, 2011, 11:18:40 pm »

work in progress!

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!
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #11 on: May 17, 2011, 02:53:45 am »

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