NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: lookang on September 22, 2008, 04:20:19 pm



Title: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on September 22, 2008, 04:20:19 pm
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

Aims to show more clearly the ideas usually difficult for students

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
[ejsapplet]

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.    


Title: Re: Displacement & Velocity time graph applet showing relationships of area & dx/dt
Post by: Fu-Kwun Hwang 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! :o


Title: Re: Displacement & Velocity time graph applet showing relationships of area & dx/dt
Post by: lookang on September 23, 2008, 04:26:00 pm
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

had to start a new thread max 4 attachment :)

will ask again when need!



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/dog.gif)

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

Completed!

download attachment 2 source zip files to remix legally and share :)

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


Title: Re: Displacement & Velocity time graph applet showing relationships of area & dx/dt
Post by: Fu-Kwun Hwang on September 23, 2008, 04:50:44 pm
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.


Title: Re: Displacement & Velocity time graph applet showing relationships of area & dx/dt
Post by: lookang on September 24, 2008, 02:50:35 pm
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 :)


Title: Re: Displacement & Velocity time graph applet showing relationships of area & dx/dt
Post by: lookang on November 04, 2008, 04:27:48 pm
source code n jar files


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on June 15, 2010, 08:29:43 am
changes made:

1 alot of time to look at the original codes by Prof Hwang
2 added features of learning
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


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on December 22, 2010, 09:26:15 am
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.
Advance Level:
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!


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on December 22, 2010, 04:07:05 pm
strange, the applet does not load in web browser.
can someone test it too?


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: Fu-Kwun Hwang on December 22, 2010, 10:57:23 pm
I was not able to load it, either.


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: ahmedelshfie on December 23, 2010, 12:03:12 am
Also didn't load in my browser Firefox,IE,Opera


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on December 24, 2010, 10:32:46 am
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?


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: ahmedelshfie on December 24, 2010, 04:23:30 pm
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.  


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: Fu-Kwun Hwang on December 24, 2010, 10:00:01 pm
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!


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang on December 26, 2010, 07:12:33 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!


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: lookang 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 menu bars
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?  ;D


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: Fu-Kwun Hwang on December 27, 2010, 10:52:12 am
I am sorry that I deleted your original message. 
I need to be more careful! :o


Title: Re: Ejs Open source Displacement & Velocity time graph for area & dx/dt java applet
Post by: ahmedelshfie on December 27, 2010, 07:55:30 pm
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.