# How to find the quickest path?

Tags:
1. Jan 29, 2017

### En Joy

• Moved from a technical forum, therefore no template.
How to find the quickest path?

#### Attached Files:

• ###### Untitled.jpg
File size:
43.8 KB
Views:
62
2. Jan 29, 2017

### Stephen Tashi

What level of mathematics are we allowed to use in solving this problem? Calculus?

It seems simplest to begin by finding distance DO.

3. Feb 3, 2017

But how?

4. Feb 3, 2017

### Staff: Mentor

You didn't answer this question. It's important.
I don't think your attempt to fit this problem into Snell's Law is correct. You need to write the equations for the time to the pavement as a function of angle, and the time to the final point on the pavement starting at that landing point. If you can use calculus, you just minimize the total time as a function of the angle you take to the pavement.

Last edited: Feb 3, 2017
5. Feb 3, 2017

### Stephen Tashi

Express DO as a function of AD and unknown angle $\angle OAD = \theta_m$.

6. Feb 3, 2017

### Staff: Mentor

Come to think of it, it might end up looking like Snell's Law. I'll have to try deriving it...

7. Feb 3, 2017

### Staff: Mentor

8. Feb 15, 2017

### En Joy

I know calculus and the derivation of Shell's law because I have completed graduation (Physics honours) and I am a primary school teacher also. The problem came to my mind suddenly while studying calculus of variation, so this is not a school homework. Trust me.
Yes, calculus will need here to sove this problem but I tried my best and did already show my attempt in the picture.

9. Feb 15, 2017

### Staff: Mentor

I think the analogy with Snell's Law is good. Did you look through the links? The minimum time condition seems very applicable to the problem you came up with...

10. Feb 16, 2017

### En Joy

Yes, I have read the link. It illustrates nothing but the derivation of Snell's law using calculus.

I actually want to know something like this. Suppose you are in position A(in mud) and your friend is at B(in pavement) as in picture. Now how can you find the path of least time to reach your friend? All the distances and the two angles are known(see the main image).

I think may be Snell's law and some calculus may help in this case but I could not try further.

11. Feb 16, 2017

### Staff: Mentor

But that's what the derivation of Snell's law is about -- the path with the least time...

12. Feb 16, 2017

### En Joy

I want to know the value of θm

13. Feb 16, 2017

### Ray Vickson

The solution is pretty horrible.

First, I will change the picture to put point A on the y-axis at $(0,h)$ and point B to the right at $(a,-b)$. So, the path crosses the horizontal axis at $x \in (0,a)$. (Basically, instead of putting the origin at the crossing point and the having variable endpoints, I prefer to fix the ends---but of course, it is equivalent.) We have two equations. Since $x = h \tan(\theta_m)$ and $a-x = b \tan(\theta_p)$ we have
$$h \tan(\theta_m) + b\tan(\theta_p) = a.$$
We also have $\sin(\theta_p) = r \sin(\theta_m)$, where $r = v_p/v_m$. Expressing everything in terms of $z = \sin(\theta_m)$ the problem reduces to the solution of the equation
$$(1)\;\;\frac{h z}{\sqrt{1-z^2}}+\frac{b r z}{\sqrt{1-r^2 z^2}} = a.$$
This can be re-written as a rather horrible 4th degree polynomial in $u =z^2$ that is too long and complicated to reproduce here. Using 4th degree solution formulas, the equation can be solved in principle, but the results are not pretty. Maple takes about 59 pages of nasty, and complicated formulas to write out all four solutions to the polynomial. I'm not sure what use that would be to anybody.

Note added in edit: a much easier equation results if we look at the crossing point $x$ as the variable, instead of the angles. Snell's law gives
$$(2) \;\;\frac{1}{v_m} \frac{x}{\sqrt{x^2+h^2}} = \frac{1}{v_p} \frac{a-x}{\sqrt{(a-x)^2+b^2}}.$$
Squaring both sides leads to a relatively tractable 4th degree polynomial. Exact solutions are still lengthy and un-enlightening. However, numerical solution of the $x$-problem is simpler than for the $\theta_m$-problem. Eq. (2) also follows directly by setting the $x$-derivative to zero of the total time function $T = \sqrt{x^2+h^2} / v_m + \sqrt{(a-x)^2 + b^2} / v_p.$

Last edited: Feb 17, 2017
14. Feb 17, 2017

### Ray Vickson

If the locations of A and B are and the two velocities are known you do NOT know the angles; you know only a relationship between the angles. To find the actual angles and the crossing point on the mud-pavement boundary you need to solve a nonlinear equation (numerically). See post #13 for details.

BTW: PF rules forbid us from solving problems completely; we are allowed to help and to give hints.

15. Feb 18, 2017

### En Joy

THANK YOU VERY MUCH @Ray Vickson