Euler Equation with Auxiliary Condition

Abstract

This research-oriented report applies Lagrange’s Equations of the First Kind to analyze three examples. The examples are categorized by the symmetry of the tracks in a two-dimensional vertical plane that a massive point-like particle traverses. The time-dependent coordinates of the mobile point traversing the tracks are determined. The equation of motion embodies a second-order differential-algebraic equation (DAE). Using the Computer Algebra System (CAS) Mathematica, the equations are solved numerically. Auxiliary by-products, such as the effective forces and associated kinematic quantities, are quantified, determined, and extensively graphed. Most of the essential Mathematica code for reproduction and potentially augmenting the scale of interest and generalization on a need basis is embodied. The latter assists Mathematica-familiar readers in exercising the code.

Share and Cite:

Sarafian, H. (2026) Euler Equation with Auxiliary Condition. American Journal of Computational Mathematics, 16, 247-259. doi: 10.4236/ajcm.2026.164013.

1. Introduction

For a point-like massive particle moving along a track, i.e., a stationary, holonomic constraint in a 2D vertical plane under gravity, its equation of motion is traditionally found by constructing its Lagrangian. Consequently, solving the Euler-Lagrange equation determines the particle’s time-dependent coordinates. If desired, by utilizing the identified coordinates of the particle, the unmentioned active effective forces on the particle may be quantified; more on this in follow-up sections. In most scenarios (cases), the scope of the investigation is limited to the mentioned coordinates and their affiliated kinematic quantities. This method (approach) deals entirely with a scalar function, the Lagrangian, and explicitly bypasses the involved effective vector quantities, the forces.

Alternatively, though uncommon, one might begin utilizing the effective forces. The latter method, in a sense, is Newton’s second law that embodies the internal track forces, so-called the reaction forces. The inclusion of these forces, external and internal, in one is called Lagrange’s equations of the first kind. The vector nature of these forces, i.e., two-dimensional forces, is conducive to two equations (one for each dimension), and the third equation, the constraint equation imposed by the track, can be simplified to replace the two differential equations and the constraint equation with one differential-algebraic equation (DAE) with a solution conducive to the aforementioned coordinates and forces. The mentioned DAE does not fall into the traditional class of ODEs encountered in Euler-Lagrange equations. Solving the latter poses mathematical challenges.

This report focuses on the Lagrange equation of the first kind. To be as clear as possible, this report presents three practical examples with complete solutions to address these issues. These examples are categorized based on the symmetry of the tracks.

This report is composed of four sections. Section 1, the Introduction, is followed by the formulation in Section 2. CAS calculations are heavily used. Section 3 embodies the Mathematica code. This section also includes the solutions, numerical output, and graphs. The conclusions and comments are in Section 4.

2. Formulation

According to Lagrange equations of the first kind [1] [2], given the equation of the track in the Cartesian {x, y} coordinate system that a massive point-like particle in a two-dimensional vertical plane traverses is,

m r ¨ =F+R , (1)

here, F and R are the external and track reaction forces acting on a particle of mass m, respectively, acquiring an acceleration, r ¨ . The track reaction, R , is given by,

R= ∑ α=1 d λ α ∂ ∂r f α ( x,y ) (2)

The latter is the generalized expression underscoring the fact that one might apply (2) to d constraints. For the case on hand, only one track, d = 1. Equation (2) is universally used in the literature [1] [2]. Instead of applying (2) without underlying its profound geometric meaning for the case on hand, a frictionless track, the author wishes symbolically to replace the notion with,

R=λ ∇ { x,y } f( x,y ) (3)

The replacement emphasizes that, as is well known, the gradient represents the orientation of a line perpendicular to a curve (track) given by f( x,y ) . But also, as is well known in solid mechanics, in the absence of friction, the contact reaction force(s) is perpendicular to the contact surfaces (curves). Moreover, the “scale” factor, λ, so to speak, “The undetermined Lagrange multipliers” [1] [2], may be interpreted as being the proportionality coefficient that scales the value of the normal force. It is a variable coefficient; although it is independent of the contact coordinates, it depends on the implied parameter. According to (1), the implied parameter is time, so that λ is time-dependent, λ(t). The t varies in accordance with the movement of the particle.

With the given notations, suppressing the relevant subscripts, (1) reads,

m r ¨ =F+λ( t )∇f( x,y ) (4)

3. Examples

Consider a track given by f( x,y )=y−2.5 x 2 −1 . It is displayed in Figure 1 along withe applied forces, F=−mg and R .

Figure 1. Displays the constraint expression and the active forces acting on the mobile particle.

Projecting the last equation on the x, y axes yield,

m x ¨ =λ( t ) [ ∇f( x,y ) ] x m y ¨ =−mg+λ( t ) [ ∇f( x,y ) ] y (5)

Eliminating λ amongst the set of Equations (5) yields a mass-independent equation,

y ¨ =−g+ [ ∇f( x,y ) ] y [ ∇f( x,y ) ] x x ¨ (6)

Solving (6) along with the constraint expression given in the previous paragraph with a set of desired initial conditions by applying NDSolve yields the numeric pair {x(t), y(t)}. Here is the Mathematica code,

Clear[eqy,gradxy];

f(x_,y_)=y-2.5x2-1

gradxy=Grad[f[x,y],{x,y}];

gradxyt=gradxy/.{x->x[t],y->y[t]};

gradxyt[[1]];

λ[t] gradxyt[[1]];

λ[t]=m x''[t]/gradxyt[[1]];

eqy=λ[t] gradxyt[[2]]-m 9.8-m y''[t];

eqy=Simplify[eqy/m];

solxyt=NDSolve[Rationalize[{eqy==0,fxyt==0,x[0]==-0.74,x'[0]==0,y[0]==2.225,y'[0]==0},0],{x,y},{t,0,7},Method->{"IndexReduction"->Automatic}];

plotxt=Plot[x[t]/.solxyt,{t,0.,7},AxesLabel->{"t","x[t]"},GridLines->Automatic,PlotStyle->Black];

plotyt=Plot[y[t]/.solxyt,{t,0.,7},AxesLabel->{"t","y[t]"},GridLines->Automatic,PlotRange->{0,3},PlotStyle->Red];

GraphicsGrid[{{plotxt,plotyt}}];

plotxyt=Show[plotyt,plotxt,AxesLabel->{"t","x,y"},PlotRange->All,PlotLabel->{"Red=y(t),Black=x(t)"}];

As expected, the track’s symmetry makes the particle oscillate symmetrically along the x and y axes. The oscillation periods along these axes are different. Along the horizontal axis, the particle oscillates more slowly than along the vertical axis (Figure 2).

Figure 2. Display of oscillations of the particle along the x and y axes vs. time.

Utilizing the solutions of the pair {x[t], y[y]} the next graph displays the pair in green along with the original track in blue.

One might take the displayed graph as a measure of the accuracy of the solution of the differential-algebraic equation (DAE) (Figure 3).

Kinematic quantities such as speeds are evaluated.

speedx=D[x[t]/.solxyt,{t,1}];

speedy=D[y[t]/.solxyt,{t,1}];

plotspeedx=Plot[speedx,{t,0.,7},GridLines->Automatic,AxesLabel->{"t","speedx"},PlotStyle->{Black}];

plotspeedy=Plot[speedy,{t,0.,7},GridLines->Automatic,AxesLabel->{"t","speedy"},PlotStyle->Red];

speedxy=Show[plotspeedy,plotspeedx,AxesLabel->{"t","speedy,speedx",speedy},PlotLabel->{"Red=speedy,Black=speedx"},PlotRange->All]

Figure 3. The original track (in blue) and the numerical solution of the associated coordinates of the mobile particle (in green).

The next two “graphs” are animations that are pictorial versions of these facts. Figure 4 is a snapshot of the particle’s oscillations on the actual track. Figure 5 displays the oscillations of the image of the particle along the vertical axis as one observes it on the xy-plane. A similar graph may be coded displaying the oscillations along the horizontal. The latter is left to interested readers.

Figure 4. Snapshot of the oscillations of the particle on the actual track.

Figure 5. A snapshot of the oscillations of the image of the particle along the vertical axis.

Figure 6 shows the particle speed along the x and y axes.

Figure 6. Display of the speeds of the particle along the x and y axes, respectively.

Figure 7 is the speed =v= x ˙ ( t ) 2 + y ˙ ( t ) 2 .

Components of the acceleration {ax,ay} are depicted in Figure 8.

accx=D[x[t]/.solxyt,{t,2}];

accy=D[y[t]/.solxyt,{t,2}];

plotaccx=Plot[accx,{t,0.,7},GridLines->Automatic,AxesLabel->{"t","accx"},PlotStyle->Black];

plotaccy=Plot[accy,{t,0.,7},GridLines->Automatic,AxesLabel->{"t","accy"},PlotStyle->Red,PlotRange->All];

Show[plotaccy,plotaccx,AxesLabel->{"t","accy,accx"},PlotLabel->{"Red=accy,Black=accx"},PlotRange->All]

Figure 7. Speed of the particle vs. time.

Figure 8. Display of the particle’s accelerations along the x and y axes, respectively.

Putting all this information together, we conclude this section.

Figure 9 shows comprehensive graphs of the derived formulations.

Figure 9. Comprehensive display of the derived graphs.

Furthermore, knowing the time-dependency of the pair, {x(t),y(t)} we now evaluate and graph 1) the mentioned scaling factor λ(t), and 2) the track’s reaction, R( t ) .

1) λ(t) is subject to either the first or the second equation of (5). Choosing the first-choice yields

λ( t )= m x ¨ ( t ) [ ∇f( x,y ) ] x , (7)

E.g., for the case at hand, the denominator is 5x(t). Equation (7) is mass-dependent. For instance, for m = 0.1, Figure 10 shows its graph.

Figure 10. Variation of λ(t) vs t. The mass of the particle is m = 0.1.

This is a numeric-based graph; as such, the shown spike corresponds to the minimum value of x(t).

2) The two components of the reaction force are subject to (5). Utilizing the {x(t),y(t)} we evaluate { x ¨ ( t ), y ¨ ( t ) } . This yields the needed components {Rx(t), Ry(t)}. For the chosen m = 0.1, their graphs are shown in Figure 11.

Figure 11. Graph of the components of {Rx(t), Ry(t)} vs. t.

The forces shown vs. time correspond to the physical position of the oscillating particle. For a better understanding, see Figure 5.

The reaction force is subject to R( t )= R x ( t ) 2 + R y ( t ) 2 . It is displayed in Figure 12.

Example 1b. An asymmetric track

We generalize the features of Example 1a by breaking the symmetry of the track. The new track is shown in dashed green in Figure 13. To highlight its asymmetry, we plot the previous symmetric case alongside it.

Figure 12. Reaction force vs. time.

Figure 13. Display of the symmetric (in black) and asymmetric (in dashed-green) tracks.

The analytic expression to graph the asymmetric dashed-green track is given by f 1 ( x,y ) ,

f1(x,y)=y-[3.2` -0.9` (1.2` +x)-2 (1.2` +x)2-0.2` (1.2` +x)3+(1.2` +x)4]

As shown, the dashed-green track has certain visual characteristics that draw attention to the point of interest.

Equations (5) and (6) are generic, meaning they are applicable to any 2dimenisonal curves in a vertical plane. By replacing f( x,y ) with f 1 ( x,y ) , we may apply the NDSolve command discussed in the previous section to identify the time-dependent position of the sliding particle, x1(t), y1(t). The necessary code is provided, and the exercise is straightforward. To avoid cluttering the report, I leave it as an exercise for interested readers. Nonetheless, Figure 14 shows the essential graph.

Figure 14. Display of x1(t) and y1(t) vs. t. These are the coordinates of the mobile particle sliding on the asymmetric track.

The left panel of Figure 14 vividly displays the impact of the track’s asymmetry. At the end of the first swing, the particle is at a horizontal distance of 0.4, yet the starting horizontal distance is −0.7.

Example 1c. A generalized track

Here we consider a case where the track lacks any symmetric and/or asymmetric character. For instance, we consider a track depicted in Figure 15.

Figure 15. Display of the track.

The track shown has features of interest: a positive hump and a negative valley, and it lacks symmetry.

Using the given constraint, we solve the associated DAE, as in the previous two cases.

Figure 16 displays two traces. The green line is the actual track, and the blue dashes are the solution of the corresponding DAE.

Next, in Figure 17, we display a snapshot of the animation of the movement of the article.

Knowing the time dependence of the pair {x1[t], y1[t]}, we evaluate and display the corresponding speeds. These are shown in Figure 18 and Figure 19.

In order not to clutter the report, we have followed the steps in examples 1a and 1b. The codes are given in the previous two examples.

Interested readers may produce additional graphs of quantities of interest. Given the codes in the previous paragraphs, there should be no coding issues.

Figure 16. Displays two indistinguishable tracks. This attests to the accuracy of the proposed solution.

Figure 17. Animation of the movement of the particle on the generalized track.

Figure 18. Display of the horizontal speed of the particle vs. time.

Figure 19. Display of the vertical speed of the particle vs. time.

4. Conclusion and Remarks

In this report, we consider three examples analyzing the motion of a massive point-like bead on three different tracks on a vertical plane under gravitational force. For frictionless tracks, i.e., conservative systems, it is customary to analyze these problems using the Euler-Lagrange method. However, the literature has seldom reported the Lagrangian-first method, the so-called Lagrangian unknown coefficient. The latter deals explicitly with the forces imposed by the track. The track’s analytic function materializes as a constraint, forming the set of equations describing the motion. The Lagrangian of the first kind encompasses more than one differential equation because it involves equations arising from the components of the forces. The customary Euler-Lagrange method encounters no such issue. In these cases, the Lagrangian of the first kind yields a differential equation and a constraint, making the system a DAE (differential-algebraic equation). Without a CAS, the difficulty depends on the analytic form of the constraint (track). Using a CAS removes this difficulty. The first two given examples are “icebreakers.” The third one and its solution address the issues of interest. The latter lacks the symmetries present in the general unrestricted example. Intentionally, the third example is not a trivial function: an eighth-order polynomial! The reader may try to solve the example without utilizing a CAS!

The first two examples are accompanied by the Mathematica code needed. The numeric examples are converted to the accompanying graphs, making the understanding readily accessible. To avoid cluttering the report with redundancy, we suggest regenerating a few figures as an exercise. Mathematica users can run the code to animate the bead’s motion.

For programming, readers familiar with Mathematica might find [3]-[6] resourceful.

Conflicts of Interest

The author declares no conflicts of interest regarding the publication of this paper.

References

[1] Gantmacher, F. (1970) Lecture in Analytic Mechanics. MIR Publishers.
[2] Thornton, S.T. and Marion, J.M. (2008) Classical Dynamics of Particles and System. Brooks/Cole.
[3] MathematicaR V14.3.
http://Wolfram.com
[4] Wolfram, S. (2003) The Mathematica Book. 5th Edition, Cambridge University Publications.
[5] Sarafian, D.H. (2019). Mathematica Graphics Examples. 2nd Edition, Scientific Search Publishing. [Google Scholar] [CrossRef]
[6] Sarafian, H. (2023) Haiduke Sarafian’s Collective Articles 2020-2023. Scientific Research Search Publishing.[CrossRef]

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.