NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
February 20, 2018, 12:44:39 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
Author Topic: Free Fall Cartesian by Wolfgang Christian and Francisco Esquembre  (Read 7945 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Hero Member
Offline Offline

Posts: 1782


Embed this message
on: November 27, 2008, 02:05:21 pm » posted from:Singapore,,Singapore

Free Fall Cartesian extends the Free Fall model of a ball bouncing on a table top to include motion in the x (horizontal) direction.

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!

* freefallcartesian.PNG (15.4 KB, 378x367 - viewed 402 times.)
« Last Edit: August 03, 2009, 10:22:48 am by lookang » Logged
Offline Offline

Posts: 1

Embed this message
Reply #1 on: January 30, 2009, 10:28:48 pm »

Very interesting post!

Hero Member
Offline Offline

Posts: 1782


Embed this message
Reply #2 on: August 03, 2009, 11:21:23 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

The model includes a trace that shows the ball's trajectory as well as a more sophisticated collision algorithm that takes into account the finite width of the table top.  Newton's second law F = ma  is a vector equation and  it must be satisfied in both the horizontal and vertical direction.
Fx = max Fy = may .
Because the force in the x (horizontal) direction is zero, the associated acceleration ax is also zero and the velocity vx is constant.  As in the Free Fall model, an impulsive normal force acting perpendicular to the table top reverses the ball's velocity upon collision.  The table top corner is treated as a special case.  The impulsive force from a corner collision is applied along a line from the corner toward the ball center.
The Free Fall in Cartesian Coordinates model is designed to teach Ejs modeling.  Right click within the simulation to examine this model in the Ejs modeling and authoring tool.  See:
"Modeling Physics with Easy Java Simulations" by Wolfgang Christian and Francisco Esquembre, The Physics Teacher, November 2007, 45 (Cool, pp. 475-480.
The Easy Java Simulations (EJS) documentation can be downloaded from the ComPADRE Open Source Physics collection and from the Ejs website.
This simulation was created by Wolfgang Christian using the Easy Java Simulations (Ejs) modeling tool. You can examine and modify this simulation if you have Ejs installed by right-clicking within a plot and selecting "Open Ejs Model" from the pop-up menu. Information about Ejs is available at: .

Because the Free Fall 2D model uses 9 variables we have chosen to create two variable tables in Ejs.  The table of dynamic variables contains values that evolve in time while the table of constant parameters contains values that remain fixed.  Creating separate tables to group variables is an effective way to organize data in Ejs models.
Horizontal motion adds a third differential equation to the Ejs evolution page.  We do not include a differential equation for vx because there is no force in the x direction.

Modeling the bounce on a finite table requires that we modify the previous Ejs collision event so that it occurs only when the the ball's x-position is between the table top corners.  As in the Free Fall event, a collision occurs only if the ball is moving downward.

Ejs supports multiple events and we have added a corner collision event (Event 2 is not shown here) to the model.  If the time evolution produces one or more event triggers, Ejs automatically attempts a smaller time step until it finds a time when the zero condition is satisfied for all events.  It is therefore very important that Ejs models be initialized in such a way that all events return positive values when testing the zero condition.  Otherwise, Ejs cannot find a valid starting time and the time evolution algorithm will fail.
Tip: You can temporarily disable an event by right clicking on the tab near the top of the events page.  Right-clicking within the coding text areas provides context-sensitive help.

My contributions are
1. comment lines on the events codes.
if(vy>=0) return 1;  // ball is moving up so collision has occured
if(Math.abs(x)>floor_size/2) return 1; // ball center is past right table edge, do nothing
// starting ball x = -0.5 centre x =0, right x =0.5, so programming is floor_size/2 since floor_size=1.0 declared
return y-ball_radius;  // displacement of ball center above floor, return back to y-ball_radius
// action if particle is falling and below the floor
vy = Math.abs(vy)*coef_of_restitution;
if(vy>=0) return 1;  // ball is moving up so collision has occured
double dx=Math.abs(x)-floor_size/2; // distance of ball past corner
if(dx<=0) return 1;  // ball is on table
if(dx-ball_radius>=0) return 1;  // ball is past corner
double r=ball_radius;
return y-Math.sqrt(r*r-dx*dx);  // displacement of ball center above edge
// action if particle is hitting corner of table
double cos=y/ball_radius;
double sin=(x<0)?(x+floor_size/2)/ball_radius:(x-floor_size/2)/ball_radius;
//double sin -> declares a variable of the numerical data type "double", allowing it to have decimal spaces
// if the x is lesser than 0
//it will evalulate the formula behind it and set the value of "sin" to its result
// it helps to visualise the angle made inside the circle one side is r the other is y.between

//rotate system
//to along surface of collison and perpendicular to surface of collision
double vx2= cos*vx-sin*vy; // vx2 is the velocity along the surface of collision
double vy2= sin*vx+cos*vy; // vy2 is the velocity pendicular the surface of collision

// do corner collision
vy2 = Math.abs(vy2)*coef_of_restitution;
//rotate back
// to the x and y coordinate system
vx= cos*vx2+sin*vy2; // actually it is cos vx2 + cos(90-teta)vy2
vy=-sin*vx2+cos*vy2; //actually it is -sin vx2 + sin(90-teta)vy2

2. panel for inputs of variables like vx and vy so that students can explore when if scenarios

source code
download the *.jar for using the applet on standalone without internet connection.

This is starting to get difficult for me Grin
Pages: [1]   Go Up
"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
Electric Field Applet Physlets®, Wolfgang Christian.
Collaborative Community of EJS
lookang 3 25982 Last post September 09, 2010, 09:39:21 am
by Fu-Kwun Hwang
Francisco (Paco) Esquembre
Ejs simulations from other web sites
lookang 1 9678 Last post November 30, 2008, 05:23:41 pm
by Fu-Kwun Hwang
Free Fall 3D "Modeling Physics with Easy Java Simulations" by Wolfgang/Francisco
Collaborative Community of EJS
lookang 1 14425 Last post August 03, 2009, 10:18:08 am
by lookang
Free Fall Cartesian with friction 2D Wolfgang Christian and Francisco Esquembre
Collaborative Community of EJS
lookang 0 5318 Last post November 27, 2008, 02:27:46 pm
by lookang
3D rotational pendulum also known as Furuta's pendulum by Francisco Esquembre
lookang 2 14510 Last post March 10, 2011, 07:04:23 pm
by ahmedelshfie
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.05 seconds with 23 queries.since 2011/06/15