NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
September 18, 2019, 08:57:49 pm

The most important medicine is tender love and care. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"

 Pages: [1]   Go Down
 Author Topic: Ejs open source java applet 1D collision carts with realistic collision  (Read 11949 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message on: March 26, 2012, 04:14:19 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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.

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
• 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!

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;

}

 Ejs_open_source_java_applet_1D_collision_carts_with_realistic_collision_inelastic.png (97.5 KB, 1277x993 - viewed 490 times.)  Ejs_open_source_java_applet_1D_collision_carts_with_realistic_collision_elastic.png (78.1 KB, 1281x992 - viewed 518 times.) « Last Edit: December 12, 2012, 02:10:01 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: April 02, 2012, 04:20:22 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

discussion with teacher

We seek your help to change the aesthetic part of the simulation - can the velocity vector of the right cart point to the left and display 1.25 m/s. (pls refer to attached pic)
We need this badly cos this is the convention all aj teachers use.

done a while back as convention 2

 Change arrows.JPG (36.98 KB, 1057x485 - viewed 465 times.)  collisioncartsconvention2.PNG (50.05 KB, 755x655 - viewed 492 times.) Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #2 on: December 12, 2012, 02:05:14 pm » posted from:-,-,SINGAPORE

The refinements are almost done
eduLab AJC page:

1.   change in area size to mass for visual impact, area change according to mass now.
2.   clearer arrows of contact force, done.
3.   some other fixes like better graphics control click 1 show all mom,ke,forces
4.   mouse and elephant graphics, I doubt it helps but I will try with your pictures, you wish to provide your picture of a mouse and elephant?
 collisionajc2013.png (124.28 KB, 1284x966 - viewed 493 times.) Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #3 on: January 15, 2013, 12:11:45 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

from teacher

I have tried your new simulation and found the improvements in visual much better.  I think it is not necessary to change the mouse and elephant.

However, I do note some areas that perhaps need your attention.

1. There was a pause function earlier on but it is missing now? It stops the simulation at the moment of impact.
added at instant of |F| > 0.0 N very precise

2. This is somewhat more serious.  When the simulation is paused in the middle of the collision, the calculations go haywire and the graph shows a blip. I have attached a screen capture of the blip below. I suspect the calculations restart from zero and hence the blip.
i don't see it as shown, but i made a dt slow down? it should be able to calculate accurately given the smaller dt steps

3. Is it possible to reduce the length of the arrow for velocity proportionately? I mean when I set it to 3 ms-1, it crosses  over to the other body. The thickness of the arrow is appreciated, but the length is a bit too long. Perhaps it should only reach the other body if the velocity is set to 10 ms-1, and the length decreases proportionately when the value is decreased.
done it is even smaller now, about 0.5 times

Thanks so much for your help!
no problem
 real_carts_2013-01-15_1321.png (35.13 KB, 758x627 - viewed 445 times.) Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #4 on: February 19, 2013, 01:05:56 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

discussion with another teacher lim e.p.

1 there is a checkbox for velocity that switches the arrows.
The arrow does not agree to the sign of velocity. There is no checkbox.
teacher was using an earlier version.

2 the data up ok. i go play first
what is the name of the ipad app?

.Mass in motion (quite user friendly)

3. the sliders are already grouped together, maybe i bordered thicker
could you section up the mass, velocity of one mass? top and bottom

because of this teacher's suggestion, the applet is improved to
https://dl.dropbox.com/u/44365627/lookangEJSworkspace/export/ejs_Momentum1DForceModel02.jar
 eepeow.png (54.84 KB, 622x364 - viewed 450 times.)  eepeow2.png (56.92 KB, 622x367 - viewed 468 times.)  eepeow3.png (33.66 KB, 621x469 - viewed 432 times.)  collisionpng.png (20.69 KB, 771x629 - viewed 473 times.) Logged
 Pages: [1]   Go Up
The most important medicine is tender love and care. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"