# Calculus of Variations II

1. Oct 16, 2005

### touqra

I have another difficult question regarding calculus of variations.
A particle travels in the (x,y) plane has a speed u(y) that depends on the distance of the particle from the x-axis. The direction of travel subtends an angle $$\theta$$ with the x-axis that can be controlled to give the minimum time to move between two points.
Let $$u(y) = Ue^{-y/h}$$ whereby, U and h are constants.
If the particles starts at (0,0) and has to get to the point $$(\pi{h}/4,h)$$ in the shortest time, show that, the final direction is $$\theta = tan^{-1}(e\sqrt{2}-1)$$

Last edited: Oct 16, 2005
2. Oct 16, 2005

### saltydog

The time it takes to travel from point a to b is given by:

$$t_{a,b}=\int_{p_1}^{p_2}\frac{ds}{v}$$

Where s is the arclength and v is the speed. Note that:

$$ds=\sqrt{dx^2+dy^2}=\sqrt{1+(y^{'})^2}dx$$

The final direction is just the slope of the extremal function at the end point right?

3. Oct 16, 2005

### touqra

yup, that's what I did initially. But, when I used the Euler equation to get me an equation, I have an equation with some unknown constants, ie, U and h. But the final direction which was needed to be proven does not contain any constants.
What I get was:
$$F=\sqrt{1+y'^2}{e^{y/h}}/U$$
Using Euler equation and the Beltrami identity (since F is independent of x),
$$F-{y'}\frac{\partialF}{\partialy'}=constant$$
$$\sqrt{1+y'^2}{e^{y/h}}-{y'^2}{(1+y'^2)}^{-1/2}{e^{y/h}}/2= constant$$

Last edited: Oct 16, 2005
4. Oct 16, 2005

### saltydog

For the moment, let h=1, leave U as just some constant: This is sufficient to lead to the angle you posted above.

So we start here:

$$t_{a,b}=\int_{p_1}^{p_2}\frac{ds}{v}$$

and extremize:

$$\mathbf{T}[y(x)]=\int_{p_1}^{p_2}\frac{\sqrt{1+(y^{'})^2}}{Ue^{-y/h}}dx$$

(v above in my post is just u(y(x)), the speed of travel)

with the boundary conditions you posted.

so:

$$F(x,y,y^{'})=\frac{\sqrt{1+(y^{'})^2}}{Ue^{-y/h}}$$

So we employ Euler's equation and calculate 3 derivatives. Can you post the first two?

$$\frac{\partial F}{\partial y}=$$

$$\frac{\partial F}{\partial y^{'}}=$$

Last edited: Oct 16, 2005
5. Oct 16, 2005

### touqra

I obtain
$$\frac{\partial F}{\partial y'} = Uy'e^{y/h}/\sqrt{1+y'^2} = J$$
$$\frac{\partial F}{\partial y} = U\sqrt{(1+y'^2)}e^{y/h}/h$$
$$\frac{dJ}{dx}=\frac{K-L}{M}$$
where, $$K = e^{y/h}(1+y'^2)(y''+\frac{y'^2}{h})$$
$$L = y''y'e^{y/h}$$
$$M = (1+y'^2)\sqrt{(1+y'^2)}$$
How do you proceed from here?
Why do you say that putting h=1 will give the final angle?

Last edited: Oct 17, 2005
6. Oct 17, 2005

### saltydog

Touqra, it looks like you're having problems calculating partials. Looks so, maybe not.

First, let's clean up the functional: Really, if we want to minimize that integral, we can just move U across the integral sign right, and let's put the exponential in the numerator:

$$\mathbf{T}[y(x)]=\frac{1}{U}\int_{p_1}^{p_2} e^{y/h}\sqrt{1+(y^{'})^2}dx$$

So:

$$F(x,y,y^{'})=e^{y/h}\sqrt{1+(y^{'})^2}$$

and therefore:

$$\frac{\partial F}{\partial y}=\frac{e^{y/h}\sqrt{1+(y^{'})^2}}{h}$$

and:

$$\frac{\partial F}{\partial y^{'}}=\frac{e^{y/h}y^{'}}{\sqrt{1+(y^{'})^2}}$$

and so:

\begin{align*} \frac{d}{dx}\left(\frac{\partial F}{\partial y^{'}}\right)&=\frac{d}{dx}\left[\frac{e^{y/h}y^{'}}{\sqrt{1+(y^{'})^2}}\right] \\ &=\frac{d}{dx}\left[e^{y/h}y^{'} \cdot \frac{1}{\sqrt{1+(y^{'})^2}}\right] \\ &=e^{y/h}y^{'}\cdot\frac{-1/2}{(1+(y^{'})^2)^{3/2}}\cdot 2 y^{'}y^{''} \\ &+\frac{1}{\sqrt{1+(y^{'})^2}}\left(e^{y/h}y^{''}+y^{'}\frac{1}{h}y^{'}e^{y/h}\right) \\ &=\frac{e^{y/h}y^{''}}{\sqrt{1+(y^{'})^2}}-\frac{e^{y/h}(y^{'})^2y^{''}}{(1+(y^{'})^2)^{3/2}}+ \frac{e^{y/h}(y^{'})^2}{h\sqrt{1+(y^{'})^2}} \end{align}

So, once we obtain the partials, then we substitute them into the Euler equation and equate the expression to zero. Now, can you substitute these expressions into:

$$\frac{\partial F}{\partial y}-\frac{d}{dx}\left(\frac{\partial F}{\partial y^{'}}\right)=0$$

simplify, and then post the results?

Also, with regards to h=1: I just worked the problem with that value and obtained the results you indicated. Perhaps it works for any value of h. Not sure.

Last edited: Oct 17, 2005
7. Oct 17, 2005

### touqra

I simplified the result and obtained
$$hy'' = 1 + y'^2$$
solving the above equation, we have
$$y' = tan (\frac{(x+c)}{h})$$
since, $$y' = tan (angle)$$
this means, angle of direction $$= \frac{(x+c)}{h}$$
Then, how do I proceed?

8. Oct 17, 2005

### saltydog

Well, would be nice to integrate it one more time to get the actual function y(x). That of course brings in another constant of integration. But you have two boundary condtions right? Two equation, two unknowns, little algebra, should be able to figure out what the constants are.

Edit: Oh yea, just use h=1.

9. Oct 17, 2005

### touqra

Thanks. I got it.
But I still have to figure out why h=1 works. When I didn't make that assumption, it turns out that I have $$e^h$$. h = 1 works because $$e^h = e$$
Hmmm...