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

Easy Java Simulations (2001- ) => misc => Topic started by: Fu-Kwun Hwang on November 23, 2007, 04:46:01 pm



Title: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on November 23, 2007, 04:46:01 pm
This is an EJS version of vernier caliper (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=52.0) with option for positive or negative zero error for faulty caliper(Adjust the vertical slider up/down).
Click the checkbox to find out the base unit and the correct value.
You can select different type of vernier caliper,too (from the selection list).

A new 1/128 inch mode has been added!
-*-


Title: Re: Caliper
Post by: Fu-Kwun Hwang on November 24, 2007, 10:19:45 am
Due to request from one of the user (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=147.msg1936#msg1936).
Quote
I hope you will create one on micrometer screw gauge, hopefully, with zero error as well, so that we will know how to handle with it properly.
The following micrometer applet was created with zero error. (previous version Micrometer applet (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=502.0))

Usage: Click Demonatration (http://www.phy.ntnu.edu.tw/ntnujava/swf/micrometer2.swf) to view flash swf file.
Click [eye][ejsapplet][/eye] to view another simulation or check out Micrometer with zero error options (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1292.0).

-*-


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: 1993.bryan on November 26, 2007, 08:11:19 am
Thank You!


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 12, 2008, 02:05:19 pm
hi prof,

i want to make a pointer to point the user's attention to the upper scale number like the way for the bottom scale.

like in the lower scale
i changed to (xp , y2-size) for the arrow for the bottom


so for example,

12.5 mm = 12 + 0.5 mm

need to understand how you reference the coordinates of 12 in the drawing panel?
chance to explain?  ;D


there is an website applet that i am trying to customize to do
http://members.shaw.ca/ron.blond/Vern.APPLET/index.html







Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 12, 2008, 10:59:14 pm
The coordinate system in the drawing panel were determined by xmin,xmax,ymin,ymax property in the drawing panel.
And the ejs let you access user coordinate as variable value. If you know where to draw the string 12, you should know the coordinate.
I am sorry that I did not fully understand what is your question? ???



Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 13, 2008, 07:43:31 am
i have been examining the codes and i just cannot figure out the codes that correspond to the answer here.

u can examine my xml  ;D
(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=567.0;attach=160)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 13, 2008, 10:21:48 am
Array xm[nm] store the coordinates for all the upper marker (vertical lines) and the separation between lines is dxm.

Initizlize Tab:
xm=x2+zerox+i*dxm;

Constraint Tab:
From the displacement x, you can find the number (int)(x/dxm);

l_x=dvalue(x/dxm,unit)+"mm";


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 13, 2008, 02:09:25 pm
wow.... i did it!!!

i assign in fixed relations:

vss = (int)(x/dxm); // to count the value of the answer as u hinted
xpt=xm[vss];        // assign xpt to xm [ array determine by vss ]


u r the best !!! thanks!


BTW i will continue to post the collaborated work here for others to learn from my comments lines in the source code xml



end of the day, would you be hosting my derived work on your forum as evidence of this good example of 21 st century collaboration cum distance learning :) ?? that will be so cool

thanks for a wonderful deep learning experience.  ;D



Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 13, 2008, 02:19:34 pm
I am glad that I can help and you are a very active learner. So I am really enjoy working with you.
I think you still need to improve the simulation. Something wrong in your applet, please check out attached image. I will post you simulation when you make it a better one.  ;)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 13, 2008, 03:38:45 pm
it is going to be the best vernier applet in the whole physics teaching community for the world :)

i am glad to be part of your effort to give free physics learning-by-doing education.

it is correct :) i have number to prove LOL.
(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=567.0;attach=173)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 13, 2008, 09:09:23 pm
Sorry, You are right. I made a mistake. The applet is fine.
However, there are some error when loading your file with my EJS. (I am using old version ejs, not the same as your version).
So those numbers from the left panel was missing. The compiled version of your work is shown here.
Click image to toggle applet view:[eye]
[/eye]


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 14, 2008, 05:30:27 pm
this is the final version, hope the public learners here like it


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 17, 2008, 10:30:27 pm
Nothing changed when I change the selection in the combobox?
Could you upload the jar file for the above applet (weecaliper09.jar),too!
So that I can check it!


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 19, 2008, 09:37:04 pm
ok

but the jar file is 1.36MB, i dont think ur forum allows large attachment

i export as html n zip it....u try to unzip and run :)



OR

r u talking about the other applet on the vector sum.....with some component combo box?
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=216.msg2359#msg2359


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 20, 2008, 09:14:09 pm
You do not need to upload the ejs library jar files.
Just upload jar file for your simulation. For example: weecaliper09.jar
It should be a small size jar file. (Usually less than 100K)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 20, 2008, 09:25:31 pm
ya...i did, check the early post! :)
weecaliper09.app.zip  http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=567.0;attach=178


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 26, 2008, 11:35:50 am
can i be made an admin for a category on your website for me to post applets the way u do yours :)


maybe under the heading on "Collaborative Community of EJS"

u decide. :)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 26, 2008, 03:59:35 pm
You are the moderator for the Collaborative Community of EJS (http://www.phy.ntnu.edu.tw/ntnujava/index.php?board=28.0) board.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 30, 2008, 04:27:17 pm
any idea which variable control this ?

i trying to figure out like it is taking too long :)

very complex modelling, trying to make sense .

anyway

i intend to bring in good features from the vernier into the micro meter

1. the hint: with the arrows and text numbers





Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on May 31, 2008, 02:18:48 pm
I think it is variable:d


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on May 31, 2008, 11:56:36 pm
thanks!! that is correct.

i found a panel with the variables useful to understand the codes as well as guess the purpose of each variable.



will revert when i can't solve the puzzle.

using spare time now LOL.



Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on June 03, 2008, 10:30:00 pm
for example for the micrometer xml,

 i have the number 1.23 which is idv

how do i split the

variable into an integer part and the decimal place part?

1.23      =            1.00         +            0.23

integer part i figure out to be          integerd =(int)(id/100.);

but how to give the decimal place ? i cant find a math.function to do that


reference: http://www.irt.org/articles/js069/index.htm
Method Summary

    * abs() - Returns the absolute value of a number

    * acos() - Returns the arccosine (in radians) of a number

    * asin() - Returns the arcsine (in radians) of a number

    * atan() - Returns the arctangent (in radians) of a number

    * atan2() - Returns the arctangent of the quotient of its arguments

    * ceil() - Returns the smallest integer greater than or equal to the number

    * cos() - Returns the cosine of a number

    * exp() - Return the Enumber, where number is the argument, and E is Euler's constant, the base of the natural logarithms.

    * floor() - Returns the largest integer less than or equal to a number

    * log() - Returns the natural logarithm (base E) of a number.

    * max() - Returns the greater of two numbers

    * min() - Returns the lesser of two numbers

    * pow() - Returns base if the exponent power, that is baseexponent

    * random() - Returns a pseudo-random number between 0 and 1

    * round() - Returns the value of a number rounded to the nearest integer

    * sin() - Returns the sine of a number

    * sqrt() - Returns the squareroot of a number

    * tan() - Returns the tangent of a number


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on June 04, 2008, 12:49:58 pm
i did it !!!!

Code:
integerd =(int)(id/100.);
decimald =(-integerd*100+id)/100.;


no worries :)


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on June 04, 2008, 01:28:50 pm
final micrometer


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on September 02, 2008, 05:20:47 pm
Quote
it"s great topic about measuring instrument vernier caliper µmeter
but i do not know how do know the scale value with my self
The total length for the scale of the moving part is 19mm.
And it was divided by 10 divisions, so each division is 1.9mm which is less than two units in the main scale by 2.0-1.9mm=0.1mm.

Think of the above system in the following way:
Assume every 2.0 mm in the main part is replaced by a 2.0mm block.
And every 1 division in the moving part is replace by a 1.9mm block.
If the first block of both part are aligned at the right, then there is a 0.1 mm displacement at the left.
If the second block of both part are aligned at the right, then there is a 0.2mm displacement at the left.
...
I hope you can understand what I mean.
Anyway, I am going to create another java applet to show it.

Click image to view applet:[eye]
[/eye]

Drag the slider to change the alignment points. Assume the top block is 2.0mm each, and the lower one is 1.9mm each (total length =1.9mm*10=19mm)


Title: Vernier Caliper and Micrometer with zero error options
Post by: sparkysparty on October 09, 2008, 06:02:23 am
Do you have this set up for imperial micrometers and verniers?


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on October 09, 2008, 10:47:04 pm
I can ry to create one if you can provide me detail information about imperial micrometers and verniers.
For example:Upload image for all different types of imperial micrometers and verniers.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: mn12833 on June 08, 2009, 11:09:50 pm
Can anyone tell me how to download this app for educational purposes?  I am just not having much luck.  I am new to the forum.  I would like to download the micormeter app as well.  Any help would be appreciated.  Thanks.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on June 08, 2009, 11:14:39 pm
You will find "Download EJS jar file" link just below the simulation.
Or you will find "get file for offline use" button.
Click the link or button to download file or sent to your email account.
You need to login to find the above link or button.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: mn12833 on June 09, 2009, 12:37:10 am
Thanks for the help.  I downloaded the jar file and when I double-clicked it I got and error message stating that the it was and invalid or corrupt jarfile.  Any suggestions on this. 


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on June 09, 2009, 07:42:59 am
There are several downloadable jar file in this topic. Please indicated which one you downloaded.
May be it is a network problem. Try to download it again.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: mn12833 on June 10, 2009, 10:04:22 pm
The files I tried to download are ejs_micrometer2.jar and ejs_caliper.jar  I receive an error when I try to launch these files.


Title: download links for Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on June 11, 2009, 12:02:53 am
I just downloaded both files , and there are all working fine with my computer.
I have no ideas what kind of error you had (you did not said it).
Please check out the file size:
ejs_users_ntnu_fkh_micrometer2.jar: 1359511
ejs_users_ntnu_fkh_caliper.jar:1337066
You need to download it again if the file size are not the same as above.
You will need to at least close your browser , otherwise you might get the cached file.
If your network provider keep a cache, you will need to download it from other computer/network.

If the file size are O.K. Try to check out java console and find out what are the error shown.

If you can provide more information, may be I can try to help you.
But there is no way I can help if you just said you have problem or you got an error without further information.



Title: Re: Vernier Caliper and Micrometer with zero error options (download problem)
Post by: mn12833 on June 25, 2009, 11:14:15 pm
I am not able to retrieve the files
ejs_users_ntnu_fkh_micrometer2.jar: 1359511
ejs_users_ntnu_fkh_caliper.jar:1337066

When I receive the ntnujavazip file (1308 KB) and I try to launch it (unzip it). I amp prompted to input a password.  Needless to say I still have not been able to obtain the .jar files.  

Am I looking in the wrong spot? What am I doing wrong?  I apologize the inconvenience.  Any support would be greatly appreciated.  Thanks to everyone for their time and efforts.
 


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on June 25, 2009, 11:35:42 pm
I have no problem download those two files:
Download EJS jar file ejs_users_ntnu_fkh_caliper.jar(1305.7kB) (http://www.phy.ntnu.edu.tw/ntnujava/ntnujavazip.php?ejsuserjar=1940)
and Download EJS jar file: ejs_users_ntnu_fkh_caliper.jar(1327.6kB) (http://www.phy.ntnu.edu.tw/ntnujava/ntnujavazip.php?ejsuserjar=1944)

It should not ask for password if you have login to the system already.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: mn12833 on June 26, 2009, 01:14:15 am
Ok.  I am feeling a little goofy right now.  I clicked on the links to download the files and was prompted to download (save) file ntnujavazip (1.27 MB).  I open the folder users_ntnu_fkh_  but there is not a caliper.jar file in this destination.  There is a folder called caliper_pkg.  This folder contains 5 CLASS files (caliper, caliperApplet, caliperSimulation, caliperview$1, and caliperview).  A file called caliper that is a XML document and a file called caliper_intro 1 which is a HTML document.  I do not see the .jar file.  Try not to laugh at me too much.  Thanks for prompt support.



Title: How to solve download problem and associate jar file to java program
Post by: lookang on June 26, 2009, 08:00:34 am
I open the folder users_ntnu_fkh_  but there is not a caliper.jar file in this destination.  There is a folder called caliper_pkg.  This folder contains 5 CLASS files (caliper, caliperApplet, caliperSimulation, caliperview$1, and caliperview).  A file called caliper that is a XML document and a file called caliper_intro 1 which is a HTML document.  I do not see the .jar file.

The download is a EJS jar file ejs_users_ntnu_fkh_caliper.jar (1305.7kB).
U need to associate the file type to jar ?
Do not use any zip program to unzip unless that is what u want, like to extract the xml source which i do sometimes.

watch this video may help http://www.youtube.com/watch?v=b4jOQcXu_v8

around 2:48 :)



Title: Re: How to solve download problem and associate jar file to java program
Post by: Fu-Kwun Hwang on June 26, 2009, 08:25:39 am
Ok.  I am feeling a little goofy right now.  I clicked on the links to download the files and was prompted to download (save) file ntnujavazip (1.27 MB).  I open the folder users_ntnu_fkh_  but there is not a caliper.jar file in this destination.  There is a folder called caliper_pkg.  This folder contains 5 CLASS files (caliper, caliperApplet, caliperSimulation, caliperview$1, and caliperview).  A file called caliper that is a XML document and a file called caliper_intro 1 which is a HTML document.  I do not see the .jar file.  Try not to laugh at me too much.  Thanks for prompt support.


Did you get download file as a single file?  --- this should be the normal case
or did you get a folder of many files? --- it might be that your computer are too advanced, it can unzip the download file automatically?
or Did you unzip the the downloaded file? --- it seems that your computer might associate .jar file to a unzip program
   (for example after you instll WIZIP or WINRAR or similar programs)

Your computer  need to associate .jar file to java program to be able to run it (by double click the downloaded .jar file- as a single file).
Please following the above instruction to inatll java run time (it will try to associate .jar file to java program again).
It is also possible to change the association of .jar file to java program (if you know how to do it).


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: mn12833 on June 27, 2009, 01:33:46 am
Thanks.  You guys are awesome!  Yes I do feel a little goofy, but I will get over.  The students will appreciate it as well.  It will definitely make the instruction for micrometers and calipers easier.  Thanks for all the support and patience.  This forum is very good and educational.  I will share this sight with a lot of my friends.  Thanks again.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on June 27, 2009, 11:28:56 pm
i remixed these from prof hwang's.  
Best of 2 worlds, the original university prof ones and a high school teachers remixes.
Function/Accuracy with Ease of Use/Customization high school use
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=684.0(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=684.0;attach=1106;image)

http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=683.0(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=683.0;attach=671;image)

could u test all 4 applets with your students and let us know what can be done to improve them.?
join in the revolution for free access to educational resources :)
anyone can join in to remix the source code and make instructional materials & worksheets to help students make sense and learn by doing.

act locally and think globally!


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on September 12, 2009, 07:43:14 am
is there a bug?
i got a fellow teacher to test it and it appears that sometimes a slight error does occur in the display.
for your info :D

after more investigating , i realize it is due to 0.08 being read as 0.05 instead of 0.1  if the marking are 0, 0.05 0.1.


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: Fu-Kwun Hwang on September 12, 2009, 09:01:11 am
Yes. It is a bug.  I did not test it when running in full screen mode.

Please modify the following code in function dvalue:
modify from
Code:
else if(unit==0.05)out=((int)(v*100.+dv)/5)/20.;
to
Code:
else if(unit==0.05)out=((int)(v*20.+dv))/20.;
The above simulation has been updated,too!


Title: Re: Vernier Caliper and Micrometer with zero error options
Post by: lookang on September 12, 2009, 09:40:16 am
U r the greatest educator-designer of interactive digital learning i know. ;)



Title: Re: How to solve download problem and associate jar file to java program
Post by: babylioness on November 30, 2009, 10:28:33 pm
I open the folder users_ntnu_fkh_  but there is not a caliper.jar file in this destination.  There is a folder called caliper_pkg.  This folder contains 5 CLASS files (caliper, caliperApplet, caliperSimulation, caliperview$1, and caliperview).  A file called caliper that is a XML document and a file called caliper_intro 1 which is a HTML document.  I do not see the .jar file.

The download is a EJS jar file ejs_users_ntnu_fkh_caliper.jar (1305.7kB).
U need to associate the file type to jar ?
Do not use any zip program to unzip unless that is what u want, like to extract the xml source which i do sometimes.

watch this video may help http://www.youtube.com/watch?v=b4jOQcXu_v8

around 2:48 :)

<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/b4jOQcXu_v8&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/b4jOQcXu_v8&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

Hi...

         I also faced similar problem. It seems that the downloaded file is a zip folder with many files inside. I cannot seem to associate it with jar file. How do I do that? I do not know which file(s) inside the folder to open?

Thanks in advance!


Title: How to view downloaded simulations: ZIP/JAR files
Post by: Fu-Kwun Hwang on November 30, 2009, 10:52:09 pm
There are two different types of downloaded file at this website.
1. For those simulations under "jdk1.0.2 simulations" -- simulations I have created before 2001.
  The download file is ZIP file. You should unzip the file and open xxx.html file (where xxx ussally is the same as the filename of the ZIP file).

2. For those simulations under "Easy java simulation" -- simulations I have created since 2001-.
  The download file is JAR file. Normally, you can double click the JAR file to run the simulation as a java program (application).
  However, your computer should support java (i.e. installed JAVA RUN TIME or JAVA SDK).
 However, if you have installed some UNZIP program, e.g. WINRAR ...etc
 Those program might have set JAR program to be opened by UNZIP program,
  so window file manager open the JAR file as ZIP file ,
  then you would not be able to run it (because you have associate JAR file to UNZIP program).

You need to change the association back to JAVA
The easiest way is to download the latest java run time (http://www.java.com/getjava/) and install it again
 (or you can change the association by yourself if you know how to do it.)


Title: Re: How to view downloaded simulations: ZIP/JAR files
Post by: babylioness on December 03, 2009, 10:19:17 am
There are two different types of downloaded file at this website.
1. For those simulations under "jdk1.0.2 simulations" -- simulations I have created before 2001.
  The download file is ZIP file. You should unzip the file and open xxx.html file (where xxx ussally is the same as the filename of the ZIP file).

2. For those simulations under "Easy java simulation" -- simulations I have created since 2001-.
  The download file is JAR file. Normally, you can double click the JAR file to run the simulation as a java program (application).
  However, your computer should support java (i.e. installed JAVA RUN TIME or JAVA SDK).
 However, if you have installed some UNZIP program, e.g. WINRAR ...etc
 Those program might have set JAR program to be opened by UNZIP program,
  so window file manager open the JAR file as ZIP file ,
  then you would not be able to run it (because you have associate JAR file to UNZIP program).

You need to change the association back to JAVA
The easiest way is to download the latest java run time (http://www.java.com/getjava/) and install it again
 (or you can change the association by yourself if you know how to do it.)


Hi... Thanks! I think I managed to get it now... Basically I change the file extension from ntnujavazip to ntnujava.jar. Then I double click it and manage to open the java file. =) Thanks a million for the clear explanation!



Title: Re: Re: How to view downloaded simulations: ZIP/JAR files
Post by: Fu-Kwun Hwang on December 03, 2009, 01:12:08 pm
Could you tell me the URL where you download the above file?

The program which process the download is ntnujavazip.php
However, The extension of the file you have received should be either .zip or .jar