NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 24, 2017, 01:04:34 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  
Simplicity is the ultimate sophistication. ..."da Vinci (1452-1519, Italian artist, sculptor, painter, architect, engineer and scientist) "
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Position vs. Time  (Read 14725 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: March 10, 2009, 12:45:47 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Position vs. Time

This experiment uses the computer and the multimedia system to display graphs of Distance vs Time, Velocity vs Time and Acceleration vs Time.

http://www.phys.ufl.edu/demo/1_Mechanics/D_MotionTwoDimensions/PersonMotionsensor.html


i can figure out the rest except the click to drag part with a running time. may be i need some example to follow the syntax Grin


« Last Edit: March 10, 2009, 02:15:05 pm by lookang » Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #1 on: March 10, 2009, 04:41:20 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

strange, i cant modify my post after some time? is that a new feature?

anyway i was planning to quickly demonstrate how quickly i can get this to work but......


question:

1. the evolution page is dx/dt = v
i got the time t to increment by dt = 0.05, but the v does not vary as i change the position of circle coordinate (x,y)


2. on drag of (x,y) i notice the time t is slower than when no drag of the (x,y), how to make the increment of time constantly, independent of the interaction/calculation of the applet, to simulate like real time for example?

thansk!, attached is my attempt to make this applet in 10 minutes .Smiley

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!


*** There are 1 more attached files. You need to login to acces it!
« Last Edit: March 10, 2009, 04:43:03 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #2 on: March 10, 2009, 05:35:42 pm » posted from:Taipei,T'ai-pei,Taiwan

The equations dx/dt=v at evolution page, tell EJS use the current value v to calculate x (t+dt) from x(t).
It does not have any other  effect.
The left hand side will change according to value at the right hand side of the equation.
It is not the reversed order.

In computer language: x=x+1; does not mean "x equal to x+1" which is always false.
It mean get value from x, add 1 and save the value back to x.

I do not understand what do you mean by
Quote
i got the time t to increment by dt = 0.05, but the v does not vary as i change the position of circle coordinate (x,y)
What is your expectation?
I do not understand what you really want to do. Please explain it in more detail.

The EJS simulation use the equation at evolution pages to calculate new value at t+dt from value at t.
And it does not remember previous values unless you add an array to store those values.

If you want to use mouse action to change the time , you need to
 save values for all the variables
 or
 add code to move the time either forward or backward.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #3 on: March 10, 2009, 08:25:35 pm » posted from:Singapore,,Singapore

strange mesage.
cannot download source or jar
You need to login to ntnujava forum in order to download files.


the applet:
i wanted to be able to drag the circle (x,y) along the x direction only, just like the real life case of a man moving forward and back to observe the graph of s vs t, v vs t, a vs t.

so the rate of me dragging the circle, determines the graphs.

drag slowly constant speed, gives s = v*t graph and v = v graph and a = 0 graph

i can't find any example on the public internet. private one i see before but i cannot link to them.


let me continue to search!

wait i think i am having a eureka moment. i think i figure out already
i tried
evolution page only:
x1 = x;
t = t + dt;
x2 = x;
v = (x2 - x1)/dt;

custom function: drag() // this is to make on drag(), t to increase still. to create illusion of time still running because without this, the drag moment t is not changing.

x1 = x;
t = t + dt;
x2 = x;
v = (x2 - x1)/dt;

but i seems to get no value for v.
i can't seems to create the difference in the value of x to be assigned to x2 and x1 differently despite the the line of code
t = t+ dt;


*** There are 1 more attached files. You need to login to acces it!
« Last Edit: March 10, 2009, 08:51:14 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #4 on: March 10, 2009, 11:06:44 pm » posted from:Taipei,T\'ai-pei,Taiwan

It is a bug. I was wondering why no one download user uploaded jar files in the last week.
I just modified the code. You should be able to download it now.

I though you have did similar work before.
May be you can check out Integrator y= ∫ f(x) dx
You can drag the blue dot, which is follow the curve of of the function (user can input different function).
And the red curve is the integal of the function.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #5 on: March 11, 2009, 07:53:50 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

it looks like i have done similar work but to create knowledge on my own is really difficult, and i can't seem to find the parts where you explained how to get velocity from first principles. so i am making up the knowledge (codes) from my thoughts and experience.

I still have a lot to learn Smiley


i just saw the xml. thanks! my current xml also can drag.

i just found a applet that is similar to what i was thinking of.
http://www.mste.uiuc.edu/users/Murphy/MovingMan/MovingMan.html

i see Lisa Denise Murphy  at the University of Illinois has one made in 1997

let me study it


* position.PNG (27.8 KB, 707x598 - viewed 271 times.)

*** There are 2 more attached files. You need to login to acces it!
« Last Edit: March 11, 2009, 08:55:11 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #6 on: March 11, 2009, 09:26:11 am » posted from:Taipei,T'ai-pei,Taiwan

If you just want to show trace similar to the applet  at http://www.mste.uiuc.edu/users/Murphy/MovingMan/MovingMan.html

Just add n trace in EJS, and enter x,y property as t and x position.
Let the applet change to play mode when user starts to drag the object and enter pause mode when user release the mouse.
Then you will get what you want! Check out the following applet (drag the blue dot).

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
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #7 on: March 11, 2009, 01:19:13 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

nice!.

mine is ok too.

i just can't seem to get the first principle of velocity v = (x2 -x1)/dt to work.

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!


* position01.PNG (58.88 KB, 1280x1024 - viewed 283 times.)
« Last Edit: March 11, 2009, 02:08:57 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #8 on: March 11, 2009, 03:28:23 pm » posted from:Taipei,T'ai-pei,Taiwan

Please write down the code you sued to calculate velocity v.
You applet did not support v=0. But my previous applet does.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #9 on: March 11, 2009, 04:38:28 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

x1 = x;
t = t + dt; // i can't seems to create the difference in the value of x to be assigned to x2 and x1 differently despite the the line of code t = t+ dt;
x2 = x;
v = (x2 - x1)/dt;

but i seems to get no value for v.

it shouldn't be that difficult, but i can't figure out.

can save me? Grin
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #10 on: March 11, 2009, 05:53:47 pm » posted from:Taipei,T'ai-pei,Taiwan

x1=x; // value of x copy to x1
t=t+dt; // value of t add dt and copy result to t
x2=x;// the same x value copy to x2, so x2 is the same as x1

So v=(x2-x1)/dt is always equal to 0.

If you want to calculate velocity, you need to save previous x,
support we save it as xs (define xs first).
Add the following line in the Fixed relations Page:
v=(x-xs)/dt; // x is the new value , and xs is the previous one.
xs=x;// save x value to xs

You should not reverse the above order. otherwise, you will get the same result=0.

You can add
x=xs= (your initial value) at the Initialization page.

Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #11 on: March 11, 2009, 07:47:34 pm »

excellent tip!
 i must remember how to do this again.
it works now.
thanks a million! Grin


*** There are 1 more attached files. You need to login to acces it!
Logged
Pages: [1]   Go Up
  Print  
Simplicity is the ultimate sophistication. ..."da Vinci (1452-1519, Italian artist, sculptor, painter, architect, engineer and scientist) "
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Reaction time measurement « 1 2 »
kinematics
Fu-Kwun Hwang 44 581412 Last post November 04, 2012, 06:04:16 pm
by TONUSSARKAR
Reaction time and car accident
kinematics
Fu-Kwun Hwang 16 183566 Last post June 19, 2010, 03:25:21 pm
by kidashley25
Reaction time measurement
Kinematics
Fu-Kwun Hwang 9 74018 Last post September 24, 2017, 03:28:32 am
by maria goreti
Ejs Open Source Position, velocity, and acceleration graphs
Collaborative Community of EJS
lookang 1 9372 Last post March 12, 2009, 01:22:58 pm
by lookang
How do I get the cursor position in a running plotting panel?
Questions related to EJS
Abyss333 3 4955 Last post October 21, 2010, 09:40:06 pm
by Abyss333
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.071 seconds with 23 queries.since 2011/06/15