Evolution of The Generalized Coordinates of Pendulum-Spring System

The pendulum-spring system studied using Hamilton equations consists of three generalized coordinates. The coordinates are the swing angle of the rod, the swing angle of the spring, and the length extension. In this case, the total Hamiltonian is complicated because of the complicated mechanical sys-tem. Six equations of motion are obtained from the Hamilton equations. The visualization of the generalized coordinates with respect to time is illustrated. In the visualization, the spring constant and the initial swing angle of the rod were varied. These variations obtained the harmonic and non-harmonic motion. The motion of such a complex system was usually sensitive to the initial values. Solving the mechanical problems with Hamiltonian formalism could familiarize students with a branch of physics with numerous indispensable applications to other branches.


Introduction
Hamiltonian mechanics were first stated by William Rowan Hamilton in 1833 as a formulation of Lagrangian mechanics in a different way.Hamiltonian mechanics reformulated mechanics into a momentum rather than the velocity phase space approach [1].
In Hamiltonian mechanics, the state of the system was described in terms of the generalized coordinates and momenta.Hamiltonian mechanics is an energy-based theory that seeks to describe and explain mechanical systems [2].
The Hamiltonian description is a stepping stone to other areas of modern physics, such as phase space and Lioville's theorem.Poisson brackets and time translation with the Hamiltonian have analogies in quantum mechanics, and Hamiltonian-Jacobi theory leads to a more general formulation of mechanics.
The equation of motion for the mechanical system of the spring-pendulum has been decomposed using the Euler-Lagrange equation [3].There are three equations of motion obtained.The number of equations obtained corresponds to the total number of generalized coordinates within the system in the form of second-order ordinary differential equations.In this case, the generalized coordinates used are the swing angle of the rod, the swing angle of the spring, and the extension of the spring length denoted as θ 1 , θ 2 , x, respectively.In more detail, Figure 1 illustrates the described system.This mechanical system will be reviewed further by looking for the Hamilton equation, a formal transformation commonly used in dynamics systems.The Hamilton equation that will be obtained is twice the number of generalized coordinates in the form of the first-order ordinary differential equation.
The solution for mechanical cases involving such a pendulum must generally be oscillatory motion.Oscillatory cases involving the back-and-forth motion of a physical system are always interesting to discuss.Those physical systems can arise from existing phenomena or mathematical modeling.[4] works on the design of the simulation of a simple pendulum.While Yazid presented mathematical modeling of a moving planar payload pendulum on an elastic portal framework [5].
Complex oscillatory in the form of simple harmonic motion yield intriguing patterns in the depiction and interpretation of the variables associated with the system.Often such a system will be sensitive to the changes in the initial value of a given system.Biglari et al. and Stachowiak et al. analyzed the dynamics of the double pendulum system numerically using Lagrangian and Hamiltonian formalism [6,7].They found out that a set of coupled non-linear ordinary differential equations governs the system.In another research, [8] studied the Hamiltonian equation on a double pendulum with axial forcing constraint to obtain the equation of motion.This paper aims to derive the Hamilton equation based on the Lagrangian, which has been obtained in the previous research [3].Based on previous research, the Euler-Lagrange equation obtained has three degrees of freedom in the form of a second-order differential equation, so the Hamilton equation to be obtained is six equations equal to twice the degrees of freedom in the form of a first-order differential equation.Afterward, the behavior of the solution to this equation will be analyzed, considering the potential for complex oscillations from an evolutionary perspective over time.

Pendulum-Spring System
The Pendulum-Spring system consisted of two masses illustrated in Figure 1.The string l 1 connected to the mass m 1 was considered massless and inextensible.The second mass m 2 is connected to the spring with the length l 2 , and the spring extends the length by x.The swing angles θ 1 and θ 2 were the swing angles each pendulum makes with respect to the vertical line.The chosen generalized coordinates are θ 1 , θ 2 , and x.We set the potential energy equal to zero at the point m 1 .
The concrete steps to get the equations of motion using the Hamiltonian method was writing down the Lagrangian.How to obtain this Lagrangian for this system has been described by [3].Furthermore, the Hamiltonian of this system can be directly determined by adding the kinetic energy T and the potential energy V .
The interest in solving the pendulum-spring problem using Hamiltonian is not to gain the equation of motion in efficiency.However, it could familiarize students with a branch of physics with numerous indispensable applications to other branches.Hamiltonian formalism is extremely helpful for calculating anything useful in other physics branches, such as statistical mechanics and quantum mechanics.

Hamilton Equation
The Hamiltonian H oh the system equals to the total energy, that is, where T is the kinetic energy and V is the potential energy.The generalized momenta p i corresponding to each generalized coordinate q i is given where qi = dq i /dt.By using the standard prescription for a Legendre transformation, we define H of the system written in terms of the Lagrangian Calculating the partial derivative of the equation ( 3) with respect to the generalized coordinate q i obtains [9]

Research Methodology
The method used in this theoretical research was transformed L(q, q, t) → H(p, q, t) without losing any information.The first step was calculating T and V , then writing down the Lagrangian, L = T −V , in terms of coordinates q i and their derivatives qi .Then, calculate p i = ∂L ∂ qi for each of the N coordinates.Furthermore, the expressions for the N p i inverted to solve for the N qi in terms of the q i and p 2 i .Write down the Hamiltonian, H = ( p i qi )−L, and then eliminate all the qi in favor of the q i and p i .Write down Hamilton's equations for each of the N coordinates.Solve the Hamiltonian equations; the usual goal is to obtain the N functions q i (t).This process generally involves eliminating the p i in favor of the qi .This will turn the 2N first-order differential Hamilton's equations into N second-order differential equations.These will be equivalent, in one way or another, to what we obtained if we had written down the Euler-Lagrange equations after the first step.
The solution of this kind of complex system is very sensitive to the initial value.The equation of motion will be solved numerically using the fourth-order Runge-Kutta method in Python.However, this paper focuses on the results only.Several dynamics related to changes in the initial values will be analyzed.First, the initial value to be varied is the spring constant k value, while other variables are constant.The next step is to vary the initial angle and keep the other variables constant.
The generalized momenta related to the system are p θ 1 , p θ 2 , p x .Decomposing these momenta to the equation (5) yields The following expression then gives the From the H of the pendulum-spring system, a set of equations of motion was obtained, which are equivalent to the Euler-Lagrange equations H as a function of the variables θ 1 , θ 2 , x, p θ 1 , p θ 2 and p x were required to solve the equation (10), so θ1 , θ2 , ẋ, and L were determined in terms of these variables.Gauss-Jordan Elimination method was used to get the first derivation of θ 1 , θ 2 and x from equation ( 6)-( 8), yield Equation ( 14) used on equation (10) to obtain the Hamiltonian equations of the pendulumspring system, yield where α n (n = 1, 2) defined according to Meanwhile, γ n (n = 1, 2, 3, 4, 5) were defined as and β n (n = 1, 2, 3) were The last assumption in the expression ( 14) are Equations ( 15) formed a set of coupled first-order differential equations of motion on the variables θ 1 , θ 2 , x, p θ 1 , p θ 2 and p x .These functions will be analyzed for their evolution over time, with some interesting changes in the initial values of the mentioned variables.

Evolution of motion with k variation
In general, the solution of differential equation of motions in (15) were sensitive to the initial values.First, we will try to simulate the evolution of motion with various k and the other initial values were keep constant.
The parameters set up for this system are The initial values used are The simulation was made over the interval [0, 10] with ∆t = 0.0001.
The parameter used in figure 2 are

Evolution of motion with θ 1 variation
The graph in Figure 4 exhibits different motion characteristic.Figure 4a, 4b, and 4d show that the state of the system moves non-harmonic motion.Meanwhile, Figure 4c displays periodic behavior.Chaotic motion is observed when considering angles θ 1 such as π/3, π/4, and π/6 are considered.However, no chaotic behavior is observed when θ 1 = π/5.This observation indicates that altering the initial angle θ 1 leads to random motion.Therefore, it is not necessarily true that a greater initial angle θ 1 will result in a more chaotic motion.Figure 4 shows that random motion can occur at any time.This proves that such a complex system is very sensitive to a given initial value.keadaan yang non harmonic ini sebenarnya bisa dianalisis lebih lanjut apakah dari chaotic atau hanya sekdar random.

Discussion
The equation of motion of the pendulum-spring system is derived from the Lagrangian and subsequently transformed to the Hamiltonian.Following the transformation, the Hamiltonian velocity is substituted into the general momentum.The equations of motion are then obtained in terms of general coordinates and general momenta.These derivation steps are also carried out by [6,10,11,12].The effect of changing the spring constant k and the initial pendulum angle θ 1 makes the oscillations no longer harmonic.The findings in [13] support this observation, as Lorente states that when the spring constant is significantly large, the pendulum motion becomes highly restricted, resulting in small oscillations.Conversely, if the spring constant is small, the pendulum motion becomes less elastic.
There are other ways to analyze the behaviour of these mechanical system.Runge-Kutta is one of the numerical methods to see the complexity of the mechanical system by exposing the limit cycle, strange attractors, Poincaré section, and bifurcation.Meanwhile, the focus of this paper is the derivation of the Hamiltonian of the pendulum-spring The work in this paper was obtained using the Runge-Kutta fourth order method.
However, the validity and accuracy of this methods have not been reviewed in depth.An analysis of the accuracy and effectiveness of the Runge-Kutta fourth order method will be analyzed in the further research.

Conclusion
The pendulum-spring system has been solved using the Hamiltonian formalism.Six s 2 .For t = 0 the initial values are θ 1 = θ 2 = π/4, x = 0.The simulation was made over the time interval t [0,15].

Figure 2a ,
Figure2a, 2b, 2c showed the periodic motion with the frequencies and the amplitude not constant.Meanwhile, Figure2dshowed that there is part in θ 1 that the graph is gradually decreasing to the minus valley, indicating that the first pendulum rotated counterclockwise.On the contrary, there is part in θ 2 that the graph is a sharp increase, indicating that the second pendulum rotated clockwise.In addition, x showed that the evolution of the motion corresponds to the θ 2 .Some researchers usually set the range of the graph to [−π, π].Therefore we redraw Figure 2d with the boundary [−π, π] shown in Figure 3.The oscillation that occurs is no longer simple harmonic motion.In other words, the motion is no longer smooth.It can undergo a sudden, instantaneous change in position and velocity at any time.The cause of

Figure 2 .
Figure 2. Graph of generalized θ 1 , θ 2 , x respect to time t with various spring stiffness k

(a) θ 1 = π/ 3 (b) θ 1 = π/ 4 ( 6 Figure
Figure Graph of Generalized coordinates θ 1 , θ 2 , x Respect to time t with various angle θ 2 equations of motions were obtained according to equation (15).Decomposing the equation of motion using the Hamiltonian in this study has met the standards for deriving the equation of motion and has been commonly used by previous studies.The solution of the