NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 23, 2017, 03:49:17 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
The softest thing overcomes the hardest thing in the universe. ...Lao Tzu (570-490 BC)
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: A real time clock created with EJS4  (Read 31205 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
on: February 20, 2009, 10:01:59 pm »

This applet is created with EJS 4. You can find out how to find information about world time with java.
-*-

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
chumunroshan
Newbie
*
Offline Offline

Posts: 4

«
Embed this message
Reply #1 on: February 22, 2009, 10:59:14 pm »

thanks. that was very useful
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: February 24, 2009, 09:08:32 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

i have discussion of collection of clock telling time digital interactive over here http://66.7.205.91/~lookangc/index.php?topic=333.msg752#msg752

some of the people here might be interested to look at them to get good ideas/features to modify the EJS open source version by Prof. Fu-Kwun Hwang

EJS could be a future platform for virtual labs/simulations for collaborations under creative commons licenses.
« Last Edit: February 24, 2009, 11:04:09 am by lookang » Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #3 on: June 02, 2011, 01:12:00 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

strange when i download the source xml and recompile it in Ejs 4.3.31 or 4.27.

on drag of the sliders, the clock goes all over the clock unlike the version above.

any idea what is wrong? Grin

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 #4 on: August 22, 2011, 04:05:03 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Dear Prof Hwang,

I tried to remix the clock.

but i could not replicate the drag on of the minute and hour hand in your simulation model to have a second hand drag-able with the perfect transition of the second hand from 1 to 59. I have created a second hand drag-gable ( http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2276.0 ) but with bugs i cannot eliminated thus, i seek your help Smiley

i do not understand the codes inside the minute hand and the hour hand.
for example: in the minute hand
ctam=Math.atan2(mx,my);// ctaangle of minute hand
if(ctam<0)ctam+=pi2;
vm=(int)(ctam/pi2*T);
if(Math.abs(vm-vms)>40.){// why 40? arbitrary
 if(vms<30){ // why 30? i thought it should be 60 minutes?
   vh=vh-1; // original was vh+=1; i think
   testm=-1; // my codes to debug which lines is executed
   }
 else if(vms>30){ // why 30? i thought it should be 60 minutes?
   vh=vh+1;
   testm=1; // my codes to debug which lines is executed
   }
 if(vh==12 || vh==0){ // this should not impact the drag right? i have not implemented it
  if(hadd>0)hadd=0;
  else hadd=12;
  if(hours24)vh2=vh+hadd;
  }
}
set();
//cta=(vs+vm*60+vh*3600*5)*pi2/T;

where
public void set () {
vs=vs+vm*60+vh*3600*5;
cta=vs*pi2/T;
}


could i request 1 thing? Grin

an add-on to your simulation to have the second hand drag-gable without the bugs i have created in my remixed sim found here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2276.0

please add some useful comments lines // so i can follow the program logic more closely to your thoughts.
Thanks!!


« Last Edit: August 22, 2011, 04:15:13 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #5 on: August 23, 2011, 12:38:22 am » posted from:Taipei,T'ai-pei,Taiwan

The angle for minute hand is vm, vms is previous angle 

Quote
if(vms<30){ // why 30? i thought it should be 60 minutes?

ctam=Math.atan2(mx,my);
vm=(int)(ctam/pi2*T);

The angle is zero degree when value for minute is 15.
The angle for minute=0 is 30 degree.

 if(vms<30)vh--;// counterclockwise rotating so hour value decrease by 1: vh-- is the same as vh=vh-1;
 else if(vms>30)vh++;// clockwise rotating  so hour value increase by 1: vh++ is the same as vh=vh+1;

if(Math.abs(vm-vms)>40.){// this is related to how fast user drag it, the value was found by try and error (I think)
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #6 on: August 23, 2011, 01:11:28 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

dear prof!

i discovered a bug that i cannot solve alone.
maybe you can see if it can be solve?
attached is the animated gif
the bug occurs when the hand hour is drag pass the 12 mark, to the left can produced the bug ( the hour hand jumps to 11 instead of staying at 12)

thanks!

i also noticed if the user drag the hour hand pass the 12 mark left and right a few times
the time appears to have another bug as the time change from 11.59 AM to 12.01 PM and turn back, it should be 11.59AM but the bug remains it at 11.59 PM.
do you notice that too Smiley

for ur info
i look forward to any bug fixes  Cheesy


* clockbug.gif (362.45 KB, 452x452 - viewed 3314 times.)
« Last Edit: August 23, 2011, 01:16:14 pm by lookang » Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #7 on: August 29, 2016, 05:11:02 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

dear prof hwang,

i found a bug when time is say time is HR : MM : SS

when MM =59 and SS = 59
clock is suppose to be HR = HR +1 when SS becomes 60 in the next time step dt.

but instead the HR jumps back to HR causing the clock to be trap in a infinite loop of HR.


attached is my ejss source and model files

can you fix the bug on your ejs (so i can examine your solution) or my ejss(so i can continue building it)?

thanks!


* clockbug.gif (650.06 KB, 464x400 - viewed 316 times.)

*** There are 2 more attached files. You need to login to acces it!
« Last Edit: August 29, 2016, 05:13:14 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #8 on: August 31, 2016, 11:26:53 am » posted from:,,Satellite Provider

Please check out the following

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 #9 on: September 01, 2016, 02:49:42 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

i have created this, thank you for being a great mentor Prof Hwang!

http://iwant2study.org/ospsg/index.php/interactive-resources/mathematics/measurement-and-geometry/measurement/2-time/425-clock24wee01

<iframe width="100%" height="750" src="http://iwant2study.org/lookangejss/01_measurement/ejss_model_clockgeogebrawee/clockgeogebrawee_Simulation.xhtml" frameborder="0">
Logged
Pages: [1]   Go Up
  Print  
The softest thing overcomes the hardest thing in the universe. ...Lao Tzu (570-490 BC)
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
34 applets created with JDK1.0.2 are available from Xplora Knoppix DVD
Enjoy the fun of physics!
Fu-Kwun Hwang 0 22018 Last post February 28, 2007, 11:12:56 am
by Fu-Kwun Hwang
Clock simulation
Request for physics Simulations
fxsuprapto 9 21078 Last post April 26, 2017, 08:05:55 pm
by liamrandall
Ejs Open Source Real Pendulum Model java applet
Collaborative Community of EJS
lookang 3 25518 Last post August 26, 2011, 02:54:19 pm
by lookang
Is it possible to convert jar files (created with EJS) to swf?
Questions related to EJS
yperego 5 12881 Last post April 13, 2012, 08:53:34 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.219 seconds with 23 queries.since 2011/06/15