## 2 Methods  
For the analysis, this study used a system where a generator is attached to a rotating shaft to which a pendulum is connected. The diagram used for mathematical analysis is shown in Figure 1. The pendulum is assumed to move in the x, y plane and the gravitational acceleration is assumed to act in the -y direction.  
Figure 1 shows a simple model for analyzing pendulum motion, where the MG is a motor and generator. When the MG acts as a motor, it supplies an excitation force to the pendulum. The MG can rotate with the same resonant frequency of the pendulum by a controller. For the energy source, pre-generators can utilize a variety of energy harvesting devices, such as piezoelectric or triboelectric from sources such as wind, vibration, and static electricity [26; 27; 28]. In Figure 1, \(l\) is the pendulum length, \(m\) is the pendulum mass, and \(M(t)\) is the excitation torque when the MG is a motor. When the pendulum stops without any movement, it is called the equilibrium position. The angle \(\theta\) at which the pendulum moves can be derived by solving the equation of motion, and power generation is started when \(\theta\) reaches a certain angle owing to the force. At this time, the electrical efficiency of the generator is a specific constant. However, as it is not considered in this study it is set to 1, and the losses such as the friction of the pendulum are ignored.  
In this study, the equation of motion of the pendulum is derived using the Lagrange equation, and the equation of motion is derived using the definition from Lagrangian mechanics, which states that the difference between the kinetic energy and potential energy is the same as the general work applied from the outside. The position and velocity of the x and y coordinate axes shown in Figure 1 are expressed by length \(l\) and angle \(\theta\) of the pendulum, respectively, and are used to derive the kinetic and potential energies of the system.  
\[T=\frac{1}{2}mv^{2}=\frac{1}{2}m(\sqrt{\left(l\cos\theta\cdot\dot{\theta} \right)^{2}+\left(l\sin\theta\cdot\dot{\theta}\right)^{2}})^{2}=\frac{1}{2} ml^{2}\dot{\theta}^{2} \tag{1}\]  
\[U=mg\Delta h=mgl(1-\cos\theta) \tag{2}\]  
Equations (1) and (2) refer to the kinetic energy T and potential energy U of the system, respectively, and they are both functions of \(\theta\). By applying Equations (1) and (2) to the Lagrange equation, the equation of motion is derived as follows:  
\[-\frac{d}{dt}\left(\frac{\partial T}{\partial\dot{\theta}}\right)+\frac{ \partial T}{\partial\theta}+-\frac{\partial U}{\partial\theta}=ml^{2}\ddot{ \theta}+mgl\sin\theta=M(t) \tag{3}\]  
In Equation (3), \(M(t)\) means the excitation torque that occurs when the MG operates as a motor, and the frequency of this torque is the same as the resonance frequency of the  
Figure 1: Generator using the resonance of the pendulum model.  
pendulum. The resonance frequency of the pendulum can be derived by assuming that there is no torque in Equation (3). Because the resonance frequency of a simple pendulum is \(\omega_{n}=\sqrt{g/l}\), the torque M(t) is expressed by:  
\[M(t)=al\cos(\sqrt{\frac{g}{l}}t) \tag{4}\]  
In Equation (4), the excitation torque simulates the case in which there is an excitation force on the mass of the pendulum, \(a\) is the magnitude of the excitation force, and \(g\) is the gravity. The solution of the equation of motion \(\theta\) obtained from Equations (3) and (4) is the same as:  
\[\theta(t)=\frac{a}{2 ml\omega_{n}}t\sin(\omega_{n}t) \tag{5}\]  
Equation (5) describes the pendulum motion \(\theta\) when the pendulum receives force \(M(t)\), as represented by Equation (4).