NTNUJAVA Virtual Physics Laboratory

JDK1.0.2 simulations (1996-2001) => Optics => Topic started by: Fu-Kwun Hwang on January 29, 2004, 11:47:02 pm

Title: Find the fastest Path
Post by: Fu-Kwun Hwang on January 29, 2004, 11:47:02 pm

In the above java applet, there are two different regions (green and yellow).
How to chose a path such that minimizes the travel time?



Sounds familar? Fermat's principle states that:
Title: L1/L2
Post by: kristianly on October 04, 2004, 10: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
Title: Re: Find the fastest Path
Post by: Fu-Kwun Hwang on March 05, 2007, 12:13:58 am
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!
Title: Re: Find the fastest Path
Post by: Fu-Kwun Hwang on June 16, 2009, 11:16:41 am
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.
Title: Re: Find the fastest Path
Post by: ahmedelshfie on July 21, 2010, 08:23:15 pm
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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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.0workspaceoutputusersrahmedfastestpath_pkgfastestpath.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!
Title: Re: Find the fastest Path
Post by: Fu-Kwun Hwang on July 21, 2010, 11:28:19 pm
The event page was disabled. You can remove it and it will work fine.
The above jar file has been updated,too!
Title: Re: Find the fastest Path
Post by: buymmlensf on October 02, 2010, 02:18:23 am
I'm finding this knowledge for my project work thanks