Generalization of the least uncomfortable journey problem

The variational problem of the least uncomfortable journey between two locations on a straight line is simplified by a choice of the dependent variable. It is shown that taking the position, instead of the velocity, as the optimal function of time to be determined does away with the isoperimetric constraint. The same results as those found with the velocity as the dependent variable are obtained in a simpler and more concise way. Next the problem is generalized for motion on an arbitrary curve. In the case of acceleration-induced discomfort, it is shown that, as expected, motion on a curved path is always more uncomfortable than motion on a straight line. It is not clear that this is necessarily the case for jerk-induced discomfort, which appears to indicate that the acceleration provides a more reasonable measure of the discomfort than the jerk. The example of motion on a circular path is studied. Although we have been unable to solve the problem analytically, approximate solutions have been constructed by means of trial functions and the exact solution has been found numerically for some choices of the relevant parameters.


Introduction
The calculus of variations is a powerful mathematical tool that finds application in virtually every branch of theoretical physics. A variational problem of recent invention is that of finding the least uncomfortable way to travel from point A to point B on a straight line, with both the travel time and the distance between the two points fixed [1].
Since frequent acceleration and deceleration make a trip uncomfortable, the discomfort can be quantified by the integral of the square of the acceleration taken over the duration of the journey. Abrupt changes of a constant acceleration are also a source of distress. Therefore, another possible quantification of the discomfort is in terms of the time rate of change of the acceleration, usually known as jerk. In this case the discomfort is defined by the square of the jerk integrated over the duration of the journey.
The choice of independent variable impacts a variational problem. Sometimes an unfortunate choice makes the problem seem much more difficult than it actually is. In [2] it is shown that with the time as independent variable the least uncomfortable journey problem becomes much simpler than with the position as independent variable, which was the original choice of Anderson, Desaix and Nyqvist [1].
In both [1] and [2] the problem of the least uncomfortable journey was understood as a search for the optimal velocity, which minimizes the discomfort. Either with position [1] or time [2] as independent variable, this approach is characterized by the existence of an isoperimetric constraint, which is taken into account by the method of Lagrange multipliers. It turns out that the choice of dependent variable, namely the unknown function to be determined, also impacts a variational problem. We show that with time as independent variable and position as dependent variable, the isoperimetric constraint is automatically satisfied and, both for acceleration-induced and jerkinduced discomfort, one has to deal with an ordinary unconstrained variational problem. In the case in which the discomfort is measured by the jerk, natural boundary conditions arise because the acceleration cannot be prescribed either at the beginning or the end of the journey. For both choices of the discomfort functional the same results as those found in [2] are obtained in a more straighforward way, without having to bother about constraints.
Next we generalize the problem by considering motion on an arbitrary curve with the arc length s as the dependent variable. Both for discomfort measured by the acceleration and by the jerk, it so happens that if the curvature is not constant the velocity v =ṡ cannot be taken as the dependent variable. In the case of acceleration-induced discomfort, it is found that, as expected, motion on a curved path gives rise to more discomfort than motion on a straight line. It is somewhat surprising that this is not necessarily the case for jerk-induced discomfort. This leads us to believe that it is the acceleration, rather than the jerk, that provides the more trustworthy measure of the discomfort. As a case study, we consider motion on a circular path. In spite of some advances towards the exact solution, we have been unable to express it in an explicit and manageable form. Therefore, approximate solutions have been constructed by means of trial functions and compared with the exact solutions obtained numerically.
The paper is organized as follows. In Section 2 we recall the statement of the problem for motion on a straight line as the search for the optimal velocity function v(t) that minimizes the discomfort. In Section 3 we rephrase the problem as the search for the optimal position function x(t) that leads to the least discomfort, and it is pointed out that the isoperimetric constraint is automatically taken care of. The exact solution is found both for the acceleration-induced and jerk-induced discomfort, in the latter case taking into account the natural boundary conditions, which are derived. In Section 4 the least uncomfortable journey problem is generalized for motion on an arbitrary curve. With the arc length s as the dependent variable and time as the independent variable, it is shown that the acceleration-induced discomfort depends only on the curvature and is always larger for a curved trajectory than for a straight line. The jerk-induced discomfort depends both on the curvature and the torsion, but it is not always necessarily larger for a curved path than for a straight line. In Section 5 the case of motion on a circular path is studied and approximate trial-function solutions are given for the optimal function s(t) which are compared with the exact numerical solutions. Section 6 is dedicated to a few final remarks.

Original statement of the least uncomfortable journey problem
The problem of finding the least uncomfortable way to travel between two points on a straight line was posed by Anderson, Desaix, and Nyqvist [1]. On a straight road, a vehicle departs from point A at t = 0 and arrives at point B when t = T . Let the coordinate system be so chosen that the departure point A corresponds to x = 0 and the arrival point B corresponds to x = D. The travel time T is fixed. The problem consists in finding the velocity v(t) that minimizes the discomfort functional defined by and under the isoperimetric constraint If the discomfort is measured by the integral of the square of the jerk, the problem is the same as above except that now the discomfort functional to be minimized is under the same isoperimetric constraint (3) and, as argued in [2], the boundary conditions In both cases the unknown function is the velocity v. With this choice of dependent variable, an essential feature of the problem is the isoperimetric constraint (3).
The treatment of the problem in [1] was based on choosing the position x as the independent variable and searching for the optimal velocity v(x) that minimizes the discomfort. It is a fact that sometimes a judicious choice of independent variable makes a variational problem more tractable. In [2] it is shown that choosing the time as the independent variable and searching for the optimal velocity v(t) leads to a drastic simplification of the problem, especially in the case in which the discomfort is measured by the jerk. Similarly, the choice of dependent variable, that is, the function to be determined, may simplify a variational problem. As we proceed to show, if one looks for the position as a function of time the isoperimetric constraint disappears and one is led to a simpler unconstrained higher-derivative variational problem.

Position as the dependent variable
Let us take the time t as the independent variable, the position x as the dependent variable and search for the function x(t) that yields the minimum discomfort.

Discomfort measured by the acceleration
The functional to be minimized is with the boundary conditions Since the journey starts from rest and ends at rest, we have the additional boundary conditionṡ Note that by taking x as the dependent variable the isoperimetric constraint (3) is automatically incorporated in the boundary conditions (7). This means that now we are dealing with a common unconstrained higher-derivative variational problem, since the functional to be minimized depends on the second derivative of the unknown function. For a functional of the form under the standard boundary conditions of fixed values for x(t) andẋ(t) at t = 0 and t = T , it is well known [3, Section 4.1] that a necessary condition for a function x(t) to minimize the functional (9) is that it obey the generalized Euler-Lagrange equation For the discomfort functional (6) we have and equation (10) becomes simply The general solution to this equation is where a 0 , a 1 , a 2 , a 3 are arbitrary constants. Application of the boundary conditions (7) and (8) leads easily to which is the same result found in [2], in which the original treatment with v as the dependent variable was adopted. The minimum value of the discomfort is obtained by inserting the above x(t) into the right-hand side of equation (6). An easy calculation yields

Discomfort measured by the jerk
Now the functional to be minimized is with the boundary conditions (7) and (8).
For a functional of the form the minimizer function x(t) has to satisfy the generalized Euler-Lagrange equation This is a sixth-order ordinary differential equation, and the boundary conditions (7) and (8) are insufficient to determine a unique solution for x(t). The additional boundary conditions would seem to be [1] These, together with (7) and (8), would comprise the standard boundary conditions for a variational problem involving the third derivative of the unknown function. However, as argued in [2], the specification of the initial acceleration is at odds with the basic principles of Newtonian mechanics, and its enforcement might require pathological, unphysical forces.
The right thing to do [2] is leaveẍ(0) andẍ(T ) free, which leads to a variational problem with variable endpoints as concerns the values ofẍ(t) at t = 0 and t = T . Variable endpoints give rise to what are commonly called natural boundary conditions [3, Section 9.1].
Let us present a short derivation of the natural boundary conditions for the functional (17) witḧ x(0) andẍ(T ) free. Because of the boundary conditions (7) and (8) the variation δx is required to satisfy The variation of the functional (17) is Successive integrations by parts lead to With the use of (20) this reduces to If x(t) is to minimize J one must have δJ = 0 for arbitrary δx with arbitrary values of δẍ(t) at t = 0 and t = T . This means that we are free to choose the variation δx such that δẍ = 0 at both t = 0 and t = T . In this case the boundary term on the right-hand side of (23) vanishes. Apart from the conditions at t = 0 and t = T , the variation δx is an otherwise arbitrary function. Then the fundamental lemma of the calculus of variations [3, p. 39] establishes that the condition δJ = 0, which is necessary for a minimum, implies that the coefficient of δx in the integral on the right-hand side of (23) vanishes. Consequently, the minimizer x(t) must satisfy the previously announced generalized Euler-Lagrange equation (18). This, in turn, further reduces δJ to Since the values of δẍ(t) are arbitrary at t = 0 and t = T , we can choose the variation δx(t) in such a way that δẍ(0) = 0, δẍ(T ) = 0 and vice versa. Therefore, the condition δJ = 0 requires that the following boundary conditions be obeyed: These are natural boundary conditions [3, p. 194] for the problem with variable endpoints as regardsẍ(t).
For the discomfort functional (16) we have and the natural boundary conditions (25) become ...
These are exactly the same natural boundary conditions as those expressed by equation (24) in [2], where they were derived on the basis of taking the velocity v as the dependent variable. With L given by (26) it follows that the generalized Euler-Lagrange equation (18) yields The general solution to this equation is The six initially arbitrary constants are readily found by imposing the boundary conditions (7), (8) and (27). After a little algebra the result is which coincides with equation (41) in [2].

Comments
We have just shown that by taking as dependent variable -that is, the unknown function to be determined -the position x instead of the velocity v, the isoperimetric constraint is eliminated and, in the case of the discomfort measured by the acceleration, one is left with an ordinary higher-derivative variational problem. Just as the choice of independent variable, a proper choice of dependent variable may simplify a variational problem and eliminate constraints by having them automatically satisfied. If the discomfort is measured by the jerk, taking x as the dependent variable also eliminates the isoperimetric constraint and leads to a higher-derivative variational problem with variable endpoints as concernsẍ. The natural boundary conditions in this case are exactly the same as those found by treating v as the dependent variable. For our treatment of the problem with the position as dependent variable, it is also straightforward to prove, as in [4], that the optimal positions (14) and (30) actually yield, in each case, the minimum discomfort.

Generalization of the least uncomfortable journey problem
Let us suppose the motion takes place along a prescribe curve. It will be convenient to parameterize the curve by the arc length s: The motion is completely characterized once the function s(t) is given.

Discomfort induced by the acceleration
For the velocity we have The acceleration is given by We shall first consider the case in which the discomfort is measured by the acceleration, which means that the discomfort functional to be minimized is From (33) it follows that Since upon differentiation with respect to s this equation yields Therefore, By definition r ′′ (s) · r ′′ (s) = κ 2 (s), where κ(s) is the curvature of the curve. Therefore, the discomfort functional (34) becomes The boundary conditions are as well asṡ (0) = 0,ṡ(T ) = 0 inasmuch as the velocity is zero both at the beginning and at the end of the journey. Equation (40) shows that, as expected, curvature adds to the discomfort: if κ = 0 the discomfort given by (40) is larger than the discomfort for motion on a straight line, which is given by (6) It is to be noted that, unless κ(s) is a constant, as for a circle or a helix, the discomfort (40) cannot be regarded as a functional of the speed v =ṡ alone, that is, the approach followed in [1] and [2] is impossible.
It is a straightforward exercise to show that with the generalized Euler-Lagrange equation Since the function L defined by (43) which is a generalization of the Jacobi integral of mechanics [6]. By inserting (43) into the above equation we finds 2 − 2ṡ ... s + 3 κ 2 (s)ṡ 4 = c.

Discomfort induced by the jerk
We haveṙ = r ′ (s)ṡ =ṡt(s), where t = dr/ds is the unit tangent vector to the curve. By definition where κ(s) ≥ 0 is the curvature and n is the principal normal vector. Therefore, from equation (48) it follows that the acceleration is given bÿ r =st(s) + κ(s)ṡ 2 n(s).
Thus, the jerk-induced discomfort is given by The functional (55) is of the form (17) with The boundary conditions for the problem of minimizing the jerk-induced discomfort (55) are The generalized Euler-Lagrange equation for the functional (55) -equation (18) with s substituted for x and L given by (56) -is terribly complicated and will not be written down here. Integration by parts with the use of (57) leads to With this result the jerk-induced discomfort (55) becomes If the curvature is constant, the discomfort for motion on a curved path is always larger than that for motion on a straight line, which is characterized by κ = τ = 0. However, since for variable curvature the third term in the above integrand may be negative, the integral of the sum of all terms but the first may conceivably be negative and one might experience less discomfort by moving on a path with curvature and torsion than on a straight line, for which the discomfort would be given by the integral of the first term alone. Torsion contributes a positive term, but if τ = 0 it is not clear that variable curvature necessarily adds to the jerk-induced discomfort, which appears counterintuitive. This is the reason why the discomfort is seemingly better measured by the acceleration than by the jerk.

Example: circular path
Let the path be an arc of a circle of radius R with the starting point of the journey at the origin. In terms of the angle θ shown in Figure 1, the parametric equation of the path is Since θ = s/R, the parameterization of the circle in terms of the arc length is Thus we have whence Consequently, the discomfort to be minimized is We shall circunscribe our discussion to the acceleration-induced discomfort. Since the curvature κ = 1/R is constant, equation (45) takes the simpler form and its associated constant of the motion (47) is given bÿ where the value of the constant of the motion has been written as c/R 2 for future convenience. As a consistency check, note that in the limit R → ∞ the circle turns into a straight line and equation (67) coincides with equation (12), as it should. Also, for very high curvature (R → 0, κ → ∞) the discomfort (66) becomes enormous, as intuition suggests. Our task is to solve the fourth-order nonlinear differential equation (67) with the boundary conditions (41) and (42). We start by taking advantage of the constant of the motion (68), which we write asu The standard trick to lower the order of equation (69) is to introduce a new variable w defined by w =u (71) and replace the independent variable t by u, so thaẗ Thus, equation (69) is reduced to Setting or, equivalently, Let us attempt to find an integrating factor for the above differential 1-form as a function F of u alone. To this end we write as ω = M(u, r)dr + N(u, r)du the 1-form obtained by multiplying the left-hand side of equation (76) by F (u). The necessary and sufficient condition for the 1-form ω to be exact is ∂M/∂u = ∂N/∂r. This leads to uF ′ (u) = −2F (u), which is solved by F (u) = u −2 . Therefore, multiplication of equation (76) by u −2 leads to Thus, by combining this last equation with (77) we conclude that where a is a constant. Taking into account that r =u 2 -see (71) and (74) -, equation (79) can be rewritten as du dt Separating variables in the above equation and integrating we find where b is a constant. This integral can be reduced to an elliptic integral, but this is not easy to do explicitly [7]. This means that, by inversion, u(t) will be given by a very complicated combination of elliptic functions. Since u =ṡ, in order to find s(t) one will still have to compute the integral of this intricate combination of elliptic functions. This will give s(t) in a quite unmanageable and unilluminating form.

Trial functions
Since the exact solution is unwieldy, we shall first consider analytical approximate solutions to our minimization problem. Let us first consider the functioñ It follows at once thatṡ It is clear from (82) and (83) that the boundary conditions (41) and (42) are fulfilled. The discomfort brought about by the trial function (82) is With the change of variable x = πt/T this simplifies to With the use of we finally have This provides an upper bound on the minimum discomfort: As a check, note that in the limit R → ∞ we have A[s] = π 4 D 2 /8T 3 . Since π 4 /8 ≈ 12.18, a comparison with (15) shows that for motion on a straight line the error committed is only 1.5%, that is, our approximation is pretty good. This suggests that the function (82) may furnish a fairly good approximation to the optimal solution also for finite but not too small R as compared to D.
A better trial function for the straight line case is where the real parameter α is to be chosen so as to yield the least discomfort within this class of trial functions. An elementary calculation yields The minimum of the function of α within brackets is attained at α = −1/82. For this value of α we have which is only 0.2% larger than the true minimum (15). The computation of the discomfort associated with (90) for the circular path is a bit laborious but requires only the use of trigonometric identities such as and the following definite integrals, where n is a natural number: The result for the discomfort (66) associated with the function (90) is Let f (α) be the function within braces, which is to be minimized. Setting f ′ (α) = 0 one gets a third degree algebraic equation to be solved, whose coefficients depend on the parameter D/R. Although a formula in terms of radicals for the roots of a cubic equation is known, it is too complicated to be useful here. This table shows that the best approximation provided by the family of functions (90) is systematically better than the approximation furnished by the single function (82), and the improvement becomes more and more significant as D increases beyond the semicircumference of the circle. A physical explanation of why, for D ≫ R, the optimal approximation within the family of functions (90) is much better than the approximation afforded by the function (82) might run as follows.
For D big compared to R, which would also be the case for fixed D and a highly curved circle, the discomfort (66) is dominated by the term involving the speedṡ rather than the one involving the tangential accelerations. This means that comparatively smaller values of the speed may result in less discomfort in spite of comparatively larger speed changes. This is because the pull on the passenger towards the center of the trajectory, connected with the radial (centripetal) acceleration associated with the speed and customarily felt as if being pressed against the wall of the vehicle, causes more discomfort than speed changes. This is illustrated in Figures 2 and 3 for the case  (90) is compared with the approximation (82). For the better approximation the maximum value attained by the speed is lower, as shown by the solid line in Figure 2, and the smaller contribution to the discomfort of the speed term amply compensates the bigger contribution owing to the larger speed changes, represented by the solid line in Figure 3.

Numerical solutions
In order numerically to solve the ordinary differential equation (67) with the boundary conditions (41) and (42), lets us first reformulate the problem in dimensionless form. Let τ and σ(τ ) be dimensionless quantities defined by Note that both τ and σ(τ ) take values in the closed interval [0, 1]. The chain rule gives Substituting these results into (67), the dimensionless boundary-value problem to be numerically solved consists of the fourth-order differential equation together with the boundary conditions By means of the Maple software we have numerically solved this boundary value problem for σ(τ ), and the figures below compare the speed for the exact (numerical) solution with the speed that arises from the trial function (90) for the values of D/R considered in the table above.  Figure 4 shows that if D/R ≤ 2 the qualitative behavior of the numerically computed speed is not too different from that of the straight-line case discussed in [2]. For D = R the trial function (90) provides a tolerable approximation to the exact solution, but for D = 2R the discrepancy is already significant.
As can be seen from Figure 5, for D equal to or bigger than the semicircumference of the circle the trial function (90) is a very bad approximation to the exact solution. As D approaches and increases beyond the circumference of the circle, the strategy to minimize the discomfort becomes clear: accelerate quickly from rest to a speed a little above the average speed D/T , keep this speed nearly constant for most of the journey, then slow down quickly to a full stop.
The trial function (90) provides a very poor approximation to the exact solution for D/R ∼ 2 and becomes worse and worse as the ratio D/R increases beyond two. An improvement would require a trial function depending on more than one parameter. But this would make it extremely cumbersome to compute the integral (66) and subsequently solve the problem of minimizing a function of several variables. Let us note, nevertheless, that the trial function (90) provides an excellent approximation to the exact solution for D ≤ R/2, as Figure 6 illustrates very well.

Final Remarks
The problem of the least uncomfortable journey affords the opportunity to acquaint advanced undergraduate or beginning graduate students with several useful techniques of the calculus of variations. It illustrates nicely that the appropriate choice of independent and dependent variables can make a variational problem much more tractable, sometimes allowing us to get rid of constraints. It also provides a nice example of a higher-order variational problem of physical interest.
The generalization of the least uncomfortable journey problem to motion on an arbitrary path makes it possible to compare the measures of discomfort induced by acceleration and jerk. The acceleration-induced discomfort is always larger for a curved path than for a straight line, as intuitively expected. This is not necessarily so for the jerk-induced discomfort, which suggests that the integral of the square of the acceleration provides a more reliable measure of the discomfort than the one supplied by the jerk.