NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
August 22, 2019, 08:17:52 am

Know the universe as yourself and you can live anywhere in comfort. ...Lao Tzu (570-490 BC)

 Pages: [1]   Go Down
 Author Topic: Find the fastest Path  (Read 108650 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message on: January 29, 2004, 10:47:02 pm » posted from:,,Satellite Provider

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
There are 4 translations,
Higher number at the end means more translation been done.
or

In the above java applet, there are two different regions (green and yellow).
The condition is :
An object (red) located at the top left corner of the green region.
It is going to move to the bottom right corner of the yellow region.

Due to different friction in these two regions,
its speed is also different (green: V1 , yellow: V2)You can change value of V1 and V2 from the textfield.

How to chose a path such that minimizes the travel time?
Those two arrors represent the velocity vectors at those two region.
You can click the left mouse button at the tip of the velocity vector
and drag it left and right, to change the traveling path.

To make it more interested. You can click the mouse button at the boundary,
and drag it up and down, to change the height of those two regions.

Press Start button to start the animation.
A red ball will move along the chosed path.Another ball(blue) will follow the fastest path if you click the show checkbox:

When it stop, compare the ratio of L1/L2 and compare with V1/V2Did you get the right answer?After how many tries?

Sounds familar? Fermat's principle states that:
The path of a ray of light between two points is the path that minimizes the travel time.
We can derives Snell's law from the relation found above L1

where index of refraction n1 = c / v1,
c is the speed of light in vacuum, and v1 is the speed of light in the medium.

This is also true for other waves (e.g. sound wave) propagation between two different medium.

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
There are 4 translations,
Higher number at the end means more translation been done.
or
 Logged
kristianly
Newbie

Offline

Posts: 2

 « Embed this message Reply #1 on: October 04, 2004, 09:16:52 pm »

Dear Sir, what do you mean by L1/L2? I don't quite understand how the applet works. At a certain angle, the red path will take the least time (same as blue path). What does different is xx pt mean? The picture shows the source can be along the surface instead of the corner. Is it possible?

Thanks,
Christian Lee
NIE, Singapore
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #2 on: March 04, 2007, 11:13:58 pm »

I am sorry. Our server was attacked by a hacker several months ago. Some of the files were deleted and I had to restored files from previous archive. And I restored an old version of this applet. There is no L1/L2 shown on the applet. Now, the latest and improved version is restored. Thank you!
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #3 on: June 16, 2009, 10:16:41 am » posted from:Taipei,T\'ai-pei,Taiwan

The following is a similar version created with EJS.
You can drag the star point (at the top) and end point(at the bottom) horizontally.
The velocity v change the moving speed.
Speed at upper half v1=v/n1, speed at lower half v2=v/n2.

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
• 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
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #4 on: July 21, 2010, 07:23:15 pm » posted from:Uberaba,Minas Gerais,Brazil

Prof Hwang
Error in XML source code,, still now im not sure it because i'm use EJS 4.3.0 or it happen because have wrong in XML
However i close Events in evolution page so EJS console give one error before i close this page ejs console give 8 error.

Quote
symbol  : variable initregion
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
if(initregion){  // > Evolution:Evol Page:Event.Zero Condition:2
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:504: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
xl=Math.sqrt((x2-x[id])*(x2-x[id])+y2*y2);  // > Evolution:Evol Page:Event.Zero Condition:4
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:505: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
vx[id]=v2*(x2-x[id])/xl;  // > Evolution:Evol Page:Event.Zero Condition:5
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:506: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
vy[id]=v2*y2/xl;  // > Evolution:Evol Page:Event.Zero Condition:6
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:530: cannot find symbol
symbol  : variable initregion
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
initregion[id]=false;  // > Evolution:Evol Page:Event.Action:1
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:531: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
xl=Math.sqrt((x2-x[id])*(x2-x[id])+y2*y2);  // > Evolution:Evol Page:Event.Action:2
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:532: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
vx[id]=v2*(x2-x[id])/xl;  // > Evolution:Evol Page:Event.Action:3
^
D:\EJS_4.3.0\workspace\output\users\br\ahmed\fastestpath_pkg\fastestpath.java:533: cannot find symbol
symbol  : variable xl
location: class users.br.ahmed.fastestpath_pkg.fastestpath._ODE_evolution1._ODE_evolution1_Event1
vy[id]=v2*y2/xl;  // > Evolution:Evol Page:Event.Action:4
^
8 errors
Compilation produced an error!
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #5 on: July 21, 2010, 10:28:19 pm » posted from:Taipei,T\'ai-pei,Taiwan

The event page was disabled. You can remove it and it will work fine.
The above jar file has been updated,too!
 Logged
Newbie

Offline

Posts: 2

 « Embed this message Reply #6 on: October 02, 2010, 01:18:23 am » posted from:Bangkok,Krung Thep,Thailand

I'm finding this knowledge for my project work thanks
 Logged
 Pages: [1]   Go Up
Know the universe as yourself and you can live anywhere in comfort. ...Lao Tzu (570-490 BC)