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

Information about this web site => Request for physics Simulations => Topic started by: GwenArBreizhou on April 08, 2009, 04:13:24 am



Title: Slingshot and Moon
Post by: GwenArBreizhou on April 08, 2009, 04:13:24 am
Hello again ;o)),
I wonder whether you could do an applet comparing a stone turning in a slingshot and the moon around the Earth.
Then it'll be possible to cut the string (and then the stone will go away) and to suppress the Earth (and then the Moon will do the same).

Thanks in advance,
best regards,


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 08, 2009, 08:05:46 am
I do not understand what do you mean.
Could you explained it in more detail. Please provide all the physics quantities:
For example: what is the mass of the stone, speed?
Is it an imaginary experiment assume no air resistance or ...?
What do you means by suppress the earth???


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 08, 2009, 05:59:29 pm
It's just an imaginary experiment to show analogy between planet movement and the movement of the stone turning in a slingshot ...

Something like the one you see on Fu1.jpg.
When I click on the hand, the stone is free to go away (see Fu2.jpg) but when I click on the earth, the motion of the moon stops and the moon fall on the earth (see Fu3.jpg) ... I'd like it to be thrown away ... like if they were no earth at all ...

Is it more clear now ?


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 08, 2009, 09:27:34 pm
I do not understand why
Quote
when I click on the earth, the motion of the moon stops and the moon fall on the earth

I created a simulation as what I have interpreted what you need from figure 1 & 2.


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 08, 2009, 09:44:58 pm
I do not understand why
Quote
when I click on the earth, the motion of the moon stops and the moon fall on the earth

Me either.
So does the maker of this animation ...



I created a simulation as what I have interpreted what you need from figure 1 & 2.

Thanks. It's quite perfect in spite of translation problems ;o))
Will it be possible to release the slingshot and the moon separately ?
And when we release the moon, to make the earth disapeare ?

Regards,


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 08, 2009, 11:23:57 pm
I just modified the code according to your suggestion. It has been updated.
However, you might need to close your browser and open it again (otherwaise, you will only view cached files).
Let me know if this is what you want. I will create other simulations you want.
It will be better if you can provide more information about what are the purposes of the simulation.


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 09, 2009, 05:23:26 am
Thanks a lot, this is exactly what I was thinking about.

I'll try to be more precise in my explanations now.

Regards,


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 09, 2009, 06:02:55 am
Can you insert the translation tool ?
My students are very bad in English ;o))


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 09, 2009, 06:56:34 am
This simulation is created with EJS and the file you have download is in jar format. (Alll the simulations I have created since 2001 were using EJS).

You can double click the file to run it if your computer support java.
Right Clcik inside the simulation, and move down to GUI options , you will find translate sub item.
Select the translate: move mouse to that item and release mouse.

A new window will popup with many strings in two columns:
1.You might need to select the language you want to translate to.
2. change the strings in the second columns
3. Click Save and it is done. (If you want to see the change , RIght click again: GUI options->language-> "the language you translated to".

There are many other options: data tools....

You can change the image files,too. But, you need to replace/add new file into the jar file to make it work.
The jar file is the same format as ZIP. You can unzip it and add new image file. Pack file back to ZIP with the same structure, then, rename ext to jar. And double click again to run it.




Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 09, 2009, 06:20:13 pm
Ok, I have done it and it works.
But I have changed as well the frame size because there are more words in french. It changes only the width and then now circles are ellipses. How can I change also the height ?
And is it possible to make french the default langage ?

When translation will be finished, do you want me to send you the file back ?

Regards,



Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 09, 2009, 09:01:55 pm
There are two number for the frame size.
The current default is 729,578. You can change both at the same time and it should work fine.
May be you need to change value in english tab.
The default language is english when double click jar file to run it. I am asking the author of EJS to find out is it possible to change default language in java application mode.

But if the jar file was loaded into html page (shown as applet), the browser will select the locale and change it to the default language.
You can view this web page source if you want to know the tag for the applet.

I certainly hope you can upload your translated jar file as attached file (Click "Additional Options" to find upload options). If you use the "upload new EJS jar file", then the jar will be turn into html code to shown applet at the end of the posted message. Because we already have one applet shown above, please use "Additions Options..." to upload your translated jar. You might want to filename to ejs_magnetdeflect_fr.jar so that to remind it contain french version translation. Thank you! We can work together to help more users enjoy the fun of physics!


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 09, 2009, 10:38:24 pm
Ok, I saw for the frame size but if I ask for big size, it will be hard to see for peoplee who got small resolution screen.
So I wonder if you can shift the whole text to the left (see attached picture).


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 09, 2009, 11:41:47 pm
I got problems to make the simulation to appear in french.

The .jar is the good one now (you can test by running
http://gwenaelm.free.fr//tmp/gravitation/ejs_users_ntnu_fkh_planetmotionanalog_fr.jar )
but I had to go in the file (with 7-zip) and copy the file planetmotionanalog_fr.properties in directory users\ntnu\fkh\planetmotionanalog_pkg because when I saved the translated data, it create a users\ntnu\fkh\planetmotionanalog_pkg\planetmotionanalog_fr.properties next to the ejs_users_ntnu_fkh_planetmotionanalog.jar but it doesn't make the file itself changed.

But now, when I ask for the applet to load in a web page, you said that "the browser will select the locale and change it to the default language" but it doesn't ...

The applet stay in english http://gwenaelm.free.fr//tmp/gravitation/manipulation1.html

Why ?


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 10, 2009, 12:01:05 am
Quote
So I wonder if you can shift the whole text to the left (see attached picture).
It is done.

Sorry about the default language used by jar. It seems to be another way around.
When I double click the created jar file. It will switch to my Chinese language automatically.
You do not need to unzip the jar if you just need to translate those string.
Double click to run it , translate it , and click save -- it will save to the jar file automatically.

But the applet should in web page did not switch to local language automatically. There is a way to do it. I will try to find out and post it here.
The above information is incorrect. Please check out the following message (two messages down).


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 10, 2009, 06:10:45 pm
Thanks in advance.

By the way, here is the french translated file.
Regards,


Title: Translate EJS strings: How to make it as default language
Post by: Fu-Kwun Hwang on April 10, 2009, 09:16:43 pm
I am really sorry. I provided you wrong information again.

The resource file was not saved to the jar file when you click the save button.
(Because you were running the jar file, there is no way you can save to the same file).
Actually, the translated file will be created as users/ntnu/fkh/xxx_pkg/xxx_yy.properties
where xxx is the name of the ejs source filename when I created it.
yy is the language code. For chinese translation it is zh, for french is seem to be fr.

for the ejs_users_ntnu_fkh_planetmotionanalog.jar : xxx is planetmotionanalog.

You need to add that file into the jar file: the  command is
jar -uf ejs_users_ntnu_fkh_planetmotionanalog.jar users/ntnu/fkh/planetmotionanalog_pkg/planetmotionanalog_fr.properties
You will need to have jdk installed to run the above command.

Another way to do is
1. rename ejs_users_ntnu_fkh_planetmotionanalog.jar to ejs_users_ntnu_fkh_planetmotionanalog.jar
2. unpack the zip file
3. copy resource file which was saved (users/ntnu/fkh/planetmotionanalog_pkg/planetmotionanalog_fr.properties)
  to users/ntnu/fkh/planetmotionanalog_pkg in the unzip directory
4. zip all the file again
5. rename the zip file to jar.

I think this time it should work for you. I just test it and it work fines.
I was told that :
 if it is done correctly, the default language will be selected as defult when we click jar file to run it or when we open it in a browser. It wrk for some of my tested jar file, but it did not work for some of the files. I am still trying to find out the exact solution.

Please upload the translation resource file only when you have done with the translation.
I will add it to the original jar file and make it available.
And I hope you will find french version translation in the applet when you view it again (after I have add it to the jar).
The one you have upload in the previous message is removed becuase it is the same as my original jar file.


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 10, 2009, 10:02:09 pm
So, that's the way I've done it (but without changing extension jar to zip, because 7-zip can open jar files).

I'm surprised with the uploaded file because at home, it works (and directly in french when I run it which is not the case with ejs_users_ntnu_fkh_magnetdeflect_fr.jar (I have to select french translation by right clicking)).

I'll upload it again (let me know if it's the good one).

But, for the moment, none of them wants to load in french when I open it in a browser ;o((
And I cannot right click to change the langage ;o((


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 10, 2009, 10:28:28 pm
Hi,
I've found a way to make it appear in french in a browser.
I've made a english translation in french and then copy the false planetmotionanalog_en.properties in the jar file ;o))

And now http://gwenaelm.free.fr/Physique/Physchim/c03/Mecanique/Html/Gravitation/manipulation__premire.html ;o))


Title: Re: Slingshot and Moon
Post by: Fu-Kwun Hwang on April 10, 2009, 10:35:16 pm
Your previouse upload jar file did not contain the translation file.
I know the way you did (translate french into english). But all the user will find french when "english" was selected. It is fine if you just need to use it at your web page.

Could you just upload the resource file only?
I will add it to the jar file and find out a solution to select default language.


Title: Re: Slingshot and Moon
Post by: GwenArBreizhou on April 11, 2009, 04:41:29 am
Don't understand what happened. Here is the file planetmotionanalog_fr.properties in a zip.

The applet will only be used in my web page (that's why I used this way).


Title: Re: Slingshot and Moon
Post by: lingaa on December 01, 2014, 08:13:57 pm
Nice posts buddy specially a website for Physics Laboratory -*-


Title: Re: Slingshot and Moon
Post by: jaisonthomsed on December 03, 2014, 01:43:32 am
Awesome man i am more interested to get deep in Physics-*-


Title: Re: Slingshot and Moon
Post by: Mikecarter on December 22, 2014, 01:41:47 pm
Definitely when the gravity becomes Zero everything will be lost from earth.   


Title: Re: Slingshot and Moon
Post by: saketwahi11 on January 29, 2015, 10:33:24 pm
I will look it up wait for my next reply
Happy Valentines Day 2015


Title: Re: Slingshot and Moon
Post by: saketwahi11 on January 29, 2015, 10:41:35 pm
I must say that overall I am really impressed with this blog.-*-


Title: Re: Slingshot and Moon
Post by: tmukherjee711 on February 03, 2015, 09:50:03 pm
Nice post i must say!
-*-