Euler-lagrange equation solution doesn't make sense

164 Views Asked by At

I have a real world based optimization problem, where the equation is $$ T=\int_{0}^{A}\frac{\sqrt{1+y'(x)^2}}{v(x)}\mathrm{d}x,\tag{1}$$ so that $$ L_{y'}=\frac{y'(x)}{\sqrt{1+y'(x)^2}\cdot v(x)}, \quad L_y=0.\tag{2} $$ The differential equation is therefore $$\frac{y'(x)}{\sqrt{1+y'(x)^2} \cdot v(x)}=c,\tag{3}$$ since you can just integrate both sides with respect to $x$. The solution to this, given the initial value $y(0)=0$, should be: $$y(x)=\int_{0}^{x}\frac{c\cdot v(x)}{\sqrt{1-c^2 \cdot v(x)^2}}\mathrm{d}x,\tag{4}$$ with $c$, such that $y(A)=B, A>0, B>0$, for $x>0,v(x)>0$. This would all be fine, but with some $c$, this answer should work for any $A, B$ and $v(x)$, which it simply doesn't, since $c$ would have to be incredibly small, so the square root doesn't become complex, while the whole function still has to be large enough to hit any $A$, $B$. This doesn't always work, I checked with Desmos. Is there any mistake I may have made or is there another solution I missed, since I know an answer must exist?

PS: For anyone interested, the real world problem is that of a Lifeguard having to save a child drowning at the beach fe. What would be the fastest path to the child, given the life guard fe. gets slower the further they're into the water? The child's coordinates are A,B and the speed of the lifeguard is given by $v(x)$, where $x$ is how far they're into the water (that's the reason behind $v(x)>0$, since they always have positive speed. The lifeguard starts at $(0,0)$. This is also why I know an answer must exist, since the must be an optimal path for the lifeguard. For $v(x)=x$ fe., the problem is solvable only for some $B<A$ the path would be on some sector of a circle. For some other $v(x)$ its only solvable for some very small $A,B$.

2

There are 2 best solutions below

1
On

What you are looking for is Snells law.

https://en.wikipedia.org/wiki/Snell%27s_law

This is a classic interview question. There is a lifeguard on the beach, they can run faster than they swim, they are on a beach of height $h$ at position $0,0$ and the child is drowning as co-ordinates $x,y$. Which path do they take.

you will see that the time taken to get there is

$t = \frac{\sqrt{x_{b}^{2}+h^{2}}}{c}+\frac{\sqrt{(x-x_{b})^{2}+(y-h)^{2}}}{\beta c}$

where I have said $c$ is the speed running and $\beta c$ is the speed in water where $\beta < 1$. $x_{b}$ is my free variable of how far i go along the beach before diving in, i always have to move up by $h$.

Now differentiate that and set equal to $0$

$0 = \frac{x_{b}}{c\sqrt{x_{b}^{2}+h^{2}}} - \frac{x-x_{b}}{\beta c\sqrt{(x-x_{b})^{2}+(y-b)^{2}}}$

by looking at the diagram you draw you will see $\sin(\theta_{i})/c = \sin(\theta_{j})/\beta c$.

This law follows from Fermats principle of least time.

0
On
  1. In OP's last paragraph it becomes clear that the line $x=0$ is the coastline, and $v(x)$ is the speed of the lifeguard a distance $x\geq 0$ from the coast. The function $x\mapsto v(x)$ is for physical reasons a monotonically decreasing non-negative function, i.e. $v_0:=v(x\!=\!0)$ is a maximum speed.

  2. OP's functional $T[y]$ is the total time the lifeguard uses along the path $$[0,A]\ni x\mapsto y(x)\in \mathbb{R}.$$

  3. From OP's eq. (3) it follows that $|cv(x)|<1$, which leads to the condition $|c|<1/v_0$. Even with this restriction, it is possible to get to any point $(A,B)$ with $A>0$ if, say, $\inf_{x\in\mathbb{R}_+} v(x) >0$.

  4. Let $\alpha(x)$ be the angle of the lifeguard's direction relative to the $x$-axis, i.e. $\tan\alpha(x)=\frac{dy}{dx}$. Then OP's eq. (3) states that $\sin\alpha(x)=cv(x)$ for the optimal path.