Author Topic: Find the fastest Path  (Read 111942 times)

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Find the fastest Path
« on: January 29, 2004, 11:47:02 pm »
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
If java program did not show up, please download and install latest Java RUN TIME



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
If java program did not show up, please download and install latest Java RUN TIME

kristianly

  • Newbie
  • *
  • Posts: 2
L1/L2
« Reply #1 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

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Find the fastest Path
« Reply #2 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!

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Find the fastest Path
« Reply #3 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.

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!

ahmedelshfie

  • Hero Member
  • Posts: 930
Re: Find the fastest Path
« Reply #4 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!

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Find the fastest Path
« Reply #5 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!

buymmlensf

  • Newbie
  • *
  • Posts: 2
    • Best Buy Cheapest Nikon 70-300mm f/4.5-5.6
Re: Find the fastest Path
« Reply #6 on: October 02, 2010, 02:18:23 am »
I'm finding this knowledge for my project work thanks