NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
February 29, 2020, 05:22:27 am

To live close to great minds is the best kind of education. ..."John Buchan (1875~1940 Scotticsh historian, Governor General of Canada)"

 Pages: [1]   Go Down
 Author Topic: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet  (Read 30512 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message on: September 22, 2008, 04:20:19 pm » posted from:Singapore,,Singapore

Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Open source Ejs applet Displacement & Velocity time graph showing relationships of area & dx/dt

http://home.phy.ntnu.edu.tw/~lookang/EJS/EJS_4.0_080905/weexva3/weexva3.html old version
http://home.phy.ntnu.edu.tw/~lookang/EJS/EJS_4.0_080905/weexva4/weexva4.html old
http://home.phy.ntnu.edu.tw/~lookang/EJS/EJS_4.0_080905/weexva10/weexva10.html
http://home.phy.ntnu.edu.tw/~lookang/EJS_4.1_090115/weexva10_Simulation.html

adapted from Two dogs running (set up xi,vi, and a ) http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=188.msg810#msg810

Displacement & Velocity time graph applet showing relationships of area & dx/dt

rate of change in displacement versus time at that time t = velocity at the same time.
Area of velocity versus time graph = distance traveled in Displacement time graph

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!

reference: http://www.physicsclassroom.com/Class/1DKin/U1L1a.cfm
Kinematics is the science of describing the motion of objects using words, diagrams, numbers, graphs, and equations. Kinematics is a branch of mechanics. The goal of any study of kinematics is to develop sophisticated mental models that serve to describe (and ultimately, explain) the motion of real-world objects.

Concepts in the simulation http://www.physicsclassroom.com/Class/1DKin/U1L1c.cfm
Distance and Displacement
Distance and displacement are two quantities that may seem to mean the same thing yet have distinctly different definitions and meanings.
* Distance is a scalar quantity that refers to "how much ground an object has covered" during its motion.
* Displacement is a vector quantity that refers to "how far out of place an object is"; it is the object's overall change in position.

Speed is a scalar quantity that refers to "how fast an object is moving."
Velocity is a vector quantity that refers to "the rate at which an object changes its position."
Acceleration is a vector quantity that is defined as the rate at which an object changes its velocity. An object is accelerating if it is changing its velocity.

The context of the simulation is based on a distance between -100 to 100 in the x axis direction.
at x=-100 is a house
at x = 100 is a tree.
there are 2 moving objects here cat 1 and dog 2 that are drag-gable in the motion diagram at the top.
there are 2 scientific graphs of x verus t and v versus t to allow for learning to translate between motion diagram to the scientific graphical representations
the sliders at the bottom allows learners to vary the initial displacement, initial velocity and uniform acceleration of the 2 objects.
the time slider can be vary after the simulation ends for learners to recap and make sense of the meaning of time in this particular simulation.
the play/pause, initialize and reset button are standard controls for the simulation.
the initialize button is especially useful for learners to plot 2 different cases of the simulations where the simulations remembers the earlier case and represent the plots in a darker color, for ease of comparison and trend generalization.
 Ejs_Open_source_Displacement_&_Velocity_time_graph_for_area_&_dx_dt_java_applet_.png (55.21 KB, 620x657 - viewed 551 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 10, 2011, 11:04:50 am by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #1 on: September 22, 2008, 10:07:17 pm »

The best way to learn is to try out by yourself.
Let me know when you have problem. Good Luck!
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #2 on: September 23, 2008, 04:26:00 pm » posted from:Singapore,,Singapore

more changes.

it is easy to create derivatives after
1. studying the codes in details
2. adding a panel with variables to understand what it is doing
3. comments lines to clarify to variables assignment

// comment lines by lookang
// 1,2 for object number, s = slider, 0 = initial, P =point, v = velocity
// t is time of simulation
// ts is the scroll bar display time for controller slider
// x1s is displacement object 1 at ts
// x1 is displacement object 1 at t
// x10 is displacement object 1 initial
// v1s assigned v10 value which then assign to vx1 and PY1[1] the second point of the array as first point is (0,0)
// vx1 is the evolution dx1/dt

cute dogs from http://www.phy.ntnu.edu.tw/ntnujava/ejs/_examples/_data/dog.gif

http://www.phy.ntnu.edu.tw/ntnujava/ejs/_examples/_data/dogy.gif

Completed!

more 22 Dec 2010
picture of tree by megabanjo2017 creative commons attribution
http://www.flickr.com/photos/38171671@N02/3511369490/sizes/m/in/photostream/

cartoon house by PeterBrough
http://www.openclipart.org/detail/cartoon-house-by-peterbrough
 cartoon_house.png (31.79 KB, 661x594 - viewed 499 times.)  treecc.png (63.19 KB, 250x375 - viewed 512 times.) « Last Edit: December 22, 2010, 08:14:23 am by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #3 on: September 23, 2008, 04:50:44 pm » posted from:Taipei,T'ai-pei,Taiwan

I just doubled the maximum number of attached (from 4 to 8 ). I can increase it again if you need to attach more files.
You can also pack files into a ZIP file and attached it.
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #4 on: September 24, 2008, 02:50:35 pm » posted from:Singapore,,Singapore

thanks prof!

i think i have created a good applet

things to do.
1. add after clicking distance checkbox, the animation shows the area for v vs t graph slowing first for cat 1 then after 2to 3 sec show animate area for cat 2.  Good idea   i go hunt for the codes to do this
 « Last Edit: September 26, 2008, 02:38:33 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #5 on: November 04, 2008, 04:27:48 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

source code n jar files
 *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 20, 2009, 03:21:49 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #6 on: June 15, 2010, 08:29:43 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

1 alot of time to look at the original codes by Prof Hwang
15 june 2010
3 debug the problem
E:\EJS_4.3.0_100613\EJS_4.3.0\workspace\output\users\sgeducation\lookang\weexva10_pkg\weexva10View.java:739: ';' expected
if ("d2correct ".equals(_variable)) __d2correct _canBeChanged__ = false; // Variables.basic:34
by removing the space at the back of the variables declaration, which causing compiling error
4 recompile to fit width = 600.
22 decemeber 2010
5 add picture of tree by megabanjo2017 creative commons attribution http://www.flickr.com/photos/38171671@N02/3511369490/sizes/m/in/photostream/ cartoon house by PeterBrough http://www.openclipart.org/detail/cartoon-house-by-peterbrough thanks to idea from http://standards.nctm.org/document/eexamples/chap5/5.2/index.htm#APPLET
6 created activities to support the learning
 « Last Edit: December 22, 2010, 11:20:11 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #7 on: December 22, 2010, 09:26:15 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

exercise by lookang

for http://www.seab.gov.sg/oLevel/syllabus/5058_2011.pdf
2. Kinematics
Content
• Speed, velocity and acceleration
• Graphical analysis of motion
• Free-fall
• Effect of air resistance
Learning Outcomes:
Candidates should be able to:
(a) state what is meant by speed and velocity
(b) calculate average speed using distance travelled / time taken
(c) state what is meant by uniform acceleration and calculate the value of an acceleration using
change in velocity / time taken
(d) interpret given examples of non-uniform acceleration
(e) plot and interpret a distance-time graph and a speed-time graph
(f) deduce from the shape of a distance-time graph when a body is:
(i) at rest
(ii) moving with uniform speed
(iii) moving with non-uniform speed
(g) deduce from the shape of a speed-time graph when a body is:
(i) at rest
(ii) moving with uniform speed
(iii) moving with uniform acceleration
(iv) moving with non-uniform acceleration
(h) calculate the area under a speed-time graph to determine the distance traveled for motion with
uniform speed or uniform acceleration
(i) state that the acceleration of free fall for a body near to the Earth is constant and is
approximately 10 m/s2
(j) describe the motion of bodies with constant weight falling with or without air resistance,
including reference to terminal velocity

Prior Knowledge required
nil

Engage
1. How do you predict if the cat or the dog will reach the tree sooner? In physics, is it possible to estimate and predict which of the animal (cat or dog) will reach the tree first. There are some variables which you need to establish in order to predict. Can you list some the variables? Can you think of different ways to reach the tree?
hint: initial velocity vi, initial displacement xi (starting position), acceleration a .....

After some discussions, students can share their ideas through oral/verbal presentation.
Teacher can praise some of the ideas and point them to Ejs as a means to test (modeling approach) out their ideas using this Ejs simulation codes as templates for implementation.
Beginner Level:
Teacher can introduce the simulation to allow students to learn by experiencing.

Explore
1. Explore the simulation, this simulation is designed with a cat 1 and dog 2 moving in the x direction only between a house x = -100 m to a tree x = 100 m.
2 The play button runs the simulation, click it again to pause and the reset button brings the simulation back to its original state.
3 by default values, play the simulation. Notice that the top motion diagram (world view) shows the cat 1 and dog 2 moving in a straight line in the x direction. What is the physics principle(s) simulated here.Write down what you observe. Explain the motion in terms of the influences of initial displacement, initial velocity and acceleration for the whole motion.
_____________________________________________________________________
hint: newton's 1st law for dog 2 and newton's second law of cat 1
4 write down what does which of the slider represent or control?
for cat 1: x1i=______________, u1 =__________, a1=___________________
dog 2: x2i=_______________, u2=__________, a2=___________________
5 reset the simulation.
6 using the default values (x1i= =-100, u1=0, a1=12) and (x2i= =-100, u2=20, a2=0), play the simulation. write down the time for which the cat 1 reach the tree. ________________
7 select (x1i= =-100, u1=0, a1=0) and (x2i= =-100, u2=20, a2=0) and play the simulation.
write down the time for which the dog 2 reach the tree. ________________
notice that by making u1=0 and a1=0, the cat is stationary.
8 explore the slider x1i, u1, a1. what do these sliders control?
9 explore the slider x2i, u2, a2. what do these sliders control?
10 by leaving the cursor on the slider, tips will appear to give a description of the slider.
11 vary the simulation and get a sense of what it does.

12 reset the simulation and ignore the dog 2 for the steps below
13 predict what the graphs of displacement versus time and velocity versus time will look like for the following cases.
(i) at rest
(ii) moving with uniform speed
(iii) moving with uniform acceleration
*(iv) moving with non-uniform acceleration
14 select suitable values of the cat 1 for each of the cases above.
record down the values you suggested and explain why you choose them.
15 draw the graphs of displacement versus time and velocity versus time on paper with the prediction and observed plots of the cat 1 side by side. Are there any difference(s)? Elaborate on the difference(s) if any and discuss with their classmates. Consult your teacher if you need help.
16 by default values, play the simulation. select the checkboxes x1=x1f-x1i and x2=x2f-x2i at the top menu hint: what is displacement,x? suggest with reason, what is the meaning of displacement in terms of the (i) motion diagram and (ii) x versus t graph?
At the end of the simulation, notice the time slider is drag-gable for further exploration. Is your answer appropriate?
16 by default values, play the simulation. select the checkboxes x1=x1f-x1i and x2=x2f-x2i at the top menu hint: what is distance traveled? suggest with reason, what is the meaning of distance traveled in terms of the (i) motion diagram and (ii) v versus t graph?
17 Elaborate on what is the difference between displacement and distance traveled. You may explore the simulation to test your elaboration, if see if it is robust enough or is there a more precise way to describe them?
H
18 by default values, play the simulation. notice write down at the end of the simulation the values of for the following
displacement of cat 1, x1 = ______________
displacement of dog 2, x2 = ______________
distance traveled by cat 1, d1 = ______________
distance traveled by dog 2, d2= _______________
19 suggest suitable equations for this specific case.
x1 = ______________
x2 = ______________
d1 = ______________
d2= _______________
20 describe how did you arrived at the equation for d1 (cat under uniform acceleration) and d2 (dog under uniform velocity).
Optional:
21 how is dx/dt represented in the (i) motion diagram,(ii) x versus t and (iii) v versus t ?
hint: select checkbox what is dx/dt?
Evaluate:
22 A cat says to the dog "I will start with negative initial velocity and still reach the tree sonner than the dog that is running at constant velocity of 20 m/s" play with the simulation suggest suitable values of initial condition(s) and record systematically, determine if the cat is correct. State your assumptions made.

Have Fun!
 Ejs_Open_source_Displacement_&_Velocity_time_graph_for_area_&_dx_dt_java_applet_.png (55.21 KB, 620x657 - viewed 665 times.)  Open source Ejs applet Displacement & Velocity time graph showing relationships of area.PNG (52.08 KB, 1024x768 - viewed 1010 times.) « Last Edit: December 22, 2010, 11:01:30 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #8 on: December 22, 2010, 04:07:05 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

strange, the applet does not load in web browser.
can someone test it too?
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #9 on: December 22, 2010, 10:57:23 pm » posted from:Taipei,T'ai-pei,Taiwan

I was not able to load it, either.
 Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #10 on: December 23, 2010, 12:03:12 am » posted from:SAO PAULO,SAO PAULO,BRAZIL

Also didn't load in my browser Firefox,IE,Opera
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #11 on: December 24, 2010, 10:32:46 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

i tired to remove some panels and re-test by using "Export website with applets".

top, bottom, center, etc systematically to isolate the problem of the inability to deploy in web.

strangely by removing individual panels, i was still unable to get it to work on web.

it work fine as a jar file.

i have no idea how to fix this web deploy issue with this applet.

any suggestion?
 *** There are 1 more attached files. You need to login to acces it! « Last Edit: December 24, 2010, 10:41:41 am by lookang » Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #12 on: December 24, 2010, 04:23:30 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL

I believe that have a bug in convert the applet to running in HTML because,
After i convert to HTML by hit right click in jar file and choose create HTML page,
I run page locally in my browser Firefox,IE and Opera also doesn't loading, other thing when i click jar file to open in PC desktop
Is late to open so may this also the reason to no loading in browser.
 « Last Edit: December 24, 2010, 04:28:57 pm by ahmedelshfie » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #13 on: December 24, 2010, 10:00:01 pm » posted from:Taipei,T'ai-pei,Taiwan

Is it possible that the problem is due to house.png and tree.png

I have never use png file in java. I know java support gif and jpg file.
Try to use gif files instead!
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #14 on: December 26, 2010, 07:12:33 am » posted from:Singapore,,Singapore

I have never used menu in my EJS simulation.
Menu might need more privilege to be aboe to work, however, I am not familar with it.
Thank you for sharing possible reasons!
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1794

http://weelookang.blogspot.com

 « Embed this message Reply #15 on: December 27, 2010, 09:04:53 am »

I have never used menu in my EJS simulation.
Menu might need more privilege to be aboe to work, however, I am not familar with it.
Thank you for sharing possible reasons!

i didn't say that hahahaha ( look at quote ).
i said i found 2 reasons
the slider bars closest set to true.
after removing the menu bar and the slider closest set to "blank" it just works in web deploy!
thanks for the suggestions and sharing.

i think Prof modify by post by accident?
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #16 on: December 27, 2010, 10:52:12 am » posted from:Taipei,T'ai-pei,Taiwan

I am sorry that I deleted your original message.
I need to be more careful!
 Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #17 on: December 27, 2010, 07:55:30 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL

Strange, applet work fine with me after i delete image png but have other problem no accept i upload in NTNU
Always give error and the error that is by my number of profile i didn't know why, i run applet in page locally and now is work fine.
I'm attach the applet may anyone can upload in NTNU.
 *** There are 1 more attached files. You need to login to acces it! Logged
 Pages: [1]   Go Up
To live close to great minds is the best kind of education. ..."John Buchan (1875~1940 Scotticsh historian, Governor General of Canada)"