To solve the brachistochrone problem (see Section 6.22.1), you can first find the Euler-Lagrange equations for the Lagrangian
L(x,y(x),y′(x))= |
|
|
You can simplify this somewhat by assuming that you are using units
where 2g=1.
Input:
assume(y>=0):; |
euler_lagrange(sqrt((1+y’^2)/y),x,y) |
Output:
⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ | − |
| =K2, |
| y | ⎛ ⎝ | x | ⎞ ⎠ | = |
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ |
It is easier to solve the first equation for y, since it is first-order and separable.
The first equation can be rewritten as
| = − |
|
|
for appropriate C, which can be solved by separation of variables, getting you the parametric equations
|
which parameterize a cycloid. This implicitly defines a function
y=y(x) as the only stationary function for L. The
problem is to prove that it minimizes T, which would be easy if the
integrand L was convex. However, it’s not the case here:
Input:
assume(y>=0):; |
convex(sqrt((1+y’^2)/y),y(x)) |
Output:
⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ | − | ⎛ ⎜ ⎜ ⎝ |
| y | ⎛ ⎝ | x | ⎞ ⎠ | ⎞ ⎟ ⎟ ⎠ |
| +3≥ 0 | ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ |
This is equivalent to |y′(t)|≤√3, which is certainly not satisfied by the cycloid y near the point x=0.
Using the substitution y(x)=z(x)2/2, you get y′(x)=z′(x) z(x) and
L(x,y(x),y′(x))=P(x,z(x),z′(x))= | √ |
| . |
The function P is convex:
Input:
assume(z>=0):; |
convex(sqrt(2(z^(-2)+z’^2)),z(x)) |
Output:
true |
Hence the function z(t)=√2 y(t), stationary for P (which is verified directly), minimizes the objective functional
U(z)= | ∫ |
| P(x,z(x),z′(x)) dx. |
From here and U(z)=T(y) it easily follows that y minimizes T and is therefore the brachistochrone. (For details see John L. Troutman, Variational Calculus and Optimal Control (second edition), page 257.)