# find travel time given path and velocity field

As I was studying refraction, I began wondering what path would light take when entering a non-homogeneous transparent medium, i.e. a certain material in which the refraction index $n$ varies (smoothly) through space: $n=n(x,y,z)$.

My guess is that the path chosen (let's forget Feynman QED for the time being) could be the one which minimizes travel time, so here's the mathematical question:

Q: Given a differentialble non-negative scalar field $\phi:\mathbb{R}^2\longrightarrow\mathbb{R}^+$ and a smooth (or at least $\mathcal{C}^1$) curve $\gamma:[0,1]\longrightarrow\mathbb{R}^2$ such that $\gamma(0)=P$ and $\gamma(1)=Q$ with $P,Q\in\mathbb{R}^2$, how to determine the time it takes to travel from $P$ to $Q$ assuming that in every point $\gamma(\lambda)=(x(\lambda),y(\lambda))$ the modulus of the speed is $\phi(x(\lambda),y(\lambda))$ and that the direction of travel never changes (i.e. we go directly from $P$ to $Q$ without stopping or going back for blueberries)?

In other words I impose the condition that \begin{equation} \|\frac{d\gamma(\lambda(t))}{dt}\|=\phi(\gamma(\lambda)) \end{equation}

I am confused by the dependency of $\gamma$ on time, and am unsure about what parametrisation of $\gamma$ should fit the case. Should it be arc length? Does it even matter? I cannot think clearly for some reason. Thank you!

You just need to invoke Fermat's principle: light travels the trajectory which minimizes the total time. Let $\tau$ be the total time spent by the light when it goes from $P$ to $Q$ under the curve $\gamma(s) = (q^1(s),q^2(s))$, then:

$\tau = \int_P^Q dt = \int_P^Q \frac{dl}{v} = \frac{1}{c}\int_P^Q n(\mathbf{r})dl = \int_P^Q n(\mathbf{r(s)})\sqrt{g_{ij}\dot q^i(s)\dot q^j(s)}ds,$

where $c$ is the speed of light in the vacuum, $v$ is the speed of the light in a media with refractive index $n(\mathbf{r})$, $l$ is a physical length and $s$ a parameter. You can take $s$ to be arc length, but it would be harder to solve the minimization problem since we must do it while constraining $\|\gamma'(s)\|=1$. Just use the Euler-Lagrange equations for the lagrangian

$L(q^i,\dot q^i) = n(\mathbf{r})\sqrt{g_{ij}\dot q^i\dot q^j}.$

By solving the Euler-Lagrange equations for the generalized coordinates $q^i$, you obtain the curve $\gamma$ that describes the trajectory of the light in the non-homogeneous media (which is your primary concerning). Moreover, you can calculate the total time $\tau$ by resolving the above integral along the curve you just find. At the end, just replace $\|\gamma'(s)\|$ by $\phi(\gamma(s))$.

About the parameter, remember that the length of a curve (and, therefore, the total time) doesn't depend on the specific parameter choice. Just pay attention on the domain of it (knowing its geometrical/physical meaning usually helps).

I guess you are trying to construct a functional of the curve $\gamma$ and then minimize the functional to obtain the equation of motion for $\gamma(t)$?

Let $(x,y)$ be the coordinates on the plane and $v(x,y)$ be the speed on each point. I would parametrize the curve by time $t$ and then write down the time of travel by $$\int v^{-1}(x,y) dl$$ where $dl^2 = dx^2 +dy^2$ , is the infinitesimal length traveled. Thus, along the trajectory $\gamma(t)=(x(t),y(t))$ $$dl = \sqrt{\dot{x}^2+\dot{y}^2}dt$$ The functional we have is $$\int f[x,y,\dot{x},\dot{y}]dt, \quad f= \frac{\sqrt{\dot{x}^2+\dot{y}^2}}{v(x,y)}.$$ By calculus of variation or directly the Euler-Lagrange equation, you can get the ODEs for $(x(t),y(t))$. After solving the equations of motion under your boundary condition, you can find the time used.

• Thank you mastrok, I was definitely going to consider the variational approach but the question is slightly different- namely I consider a particular curve $\gamma$ (not necessarily the optimal curve) and would like to calculate the travel time. – marco trevi Feb 27 '15 at 9:55
• oh I am sorry, if the curve is given then $t$ is just calculated by that integral. – mastrok Feb 27 '15 at 9:58
• but houw do you find the parametrization of $\gamma$ with time if you have only the support of the curve? – marco trevi Feb 27 '15 at 9:59
• How is the curve given? Are $x(t), y(t)$ given or they are given under some parametrization which is not necessarily $t$? $x(\lambda), y(\lambda)$ in which the time dependence of $\lambda(t)$ is unknown? – mastrok Feb 27 '15 at 10:02
• Actually I am realizing that it does not matter since arc length does not depend upon the particular parametrization... – marco trevi Feb 27 '15 at 10:02