# Long Time Simulation Analysis of Geometry Dynamics Model under Iteration
## 4 The Solution of the Dynamics of a Planer Pendulum  
In this chapter, a planner pendulum is used to explain the above theory. The planer pendulum is shown in Figure 3, which considers its geometry. The mass and the rotational inertia of the pendulum are \(m\) and \(J\), respectively. The length between the center of mass and pivot is \(l\). The dynamics model of the pendulum is written as Equation (39) with rotation matrix \(R\) and angular velocity \(\omega\). \[\left\{ \begin{array}{l}J\dot{\omega}+mgle_{2}^{T}R\epsilon_{1}=0\\ \dot{R}=RS(\omega)\end{array} \right. \tag{38}\]Equation (39) can also be written as triangle type:  
\[\left\{ \begin{array}{l}\dot{J}\dot{\omega}+mgl\sin\theta=0\\ \dot{\theta}=\omega\end{array} \right. \tag{39}\]  
Let \(\prod=J\omega\). Then, Equation (39) can change to be of Hamilton type, as in Equation (41). \[\left\{ \begin{array}{l}\dot{\Pi}+mgl\varepsilon_{2}^{T}\mathbf{R}\mathbf{e}_{1}=0\\ \dot{\mathbf{R}}=\mathbf{R}\mathbf{S}\left(\frac{\Pi}{J}\right)\end{array} \right. \tag{40}\]  
In general, Equation (41) can be solved by the Runge-Kutta method. Here, the difference method is used to solve it. The parameters are discrete:  
\[\omega_{k+\frac{1}{2}}=\frac{\omega_{k+1}+\omega_{k}}{2},\dot{\omega}_{k+\frac {1}{2}}=\frac{\omega_{k+1}-\omega_{k}}{h},\dot{\theta}_{k+\frac{1}{2}}=\frac{ \theta_{k+1}-\theta_{k}}{h},\theta_{k+\frac{1}{2}}=\frac{\theta_{k+1}+\theta _{k}}{2} \tag{41}\]  
Substitute Equation (42) into Equation (40). Then, the dynamics equation is  
\[\left\{ \begin{array}{l}J(\omega_{k+1}-\omega_{k})+hmgl\sin\left(\frac{\theta _{k+1}+\theta_{k}}{2}\right)=0\\ 2(\theta_{k+1}-\theta_{k})-h(\omega_{k+1}+\omega_{k})=0\end{array} \right. \tag{42}\]  
The Jacobi matrix of Equation (43) is  
\[\left[ \begin{array}{cc}J&\frac{1}{2}hmgl\cos\left(\frac{\theta_{k+1}+\theta _{k}}{2}\right)\\ -h&2\end{array} \right] \tag{43}\]  
Discretize \(\omega,\theta\) as Equation (45) to use \(\Delta\omega_{k}\) and \(\Delta\theta_{k}\) as parameters of a difference operation. \[\dot{\omega}_{k+\frac{1}{2}}=\frac{\Delta\omega_{k}}{h},\omega_{k+\frac{1}{2}} =\omega_{k}+\frac{\Delta\omega_{k}}{2},\dot{\theta}_{k+\frac{1}{2}}=\frac{ \Delta\theta_{k}}{h},\theta_{k+\frac{1}{2}}=\theta_{k}+\frac{\Delta\theta_{k}} {2} \tag{44}\]  
Substitute it into Equation (40) to obtain the dynamics equation as Equation (46), which uses \(\Delta\omega_{k},\Delta\theta_{k}\) as parameters. \[ \begin{array}{l}J\Delta\omega_{k}+hmgl\sin\left(\theta_{k}+\frac{\Delta \theta_{k}}{2}\right)=0\\ 2\Delta\theta_{k}-2h\omega_{k}-h\Delta\omega_{k}=0\end{array}  \tag{45}\]  
The Jacobi matrix of Equation (46) is  
\[\left[ \begin{array}{cc}J&\frac{1}{2}hmgl\cos\left(\theta_{k}+\frac{\Delta \theta_{k}}{2}\right)\\ -h&2\end{array} \right] \tag{46}\]  
Figure 3: Planar pendulum. Let \(\mathbf{\Gamma}=R^{T}\mathbf{e}_{2}\). Then, the Lie group expresses the dynamics equation as Equation (48). \[\left\{ \begin{array}{l}\dot{J\omega}+mgle_{1}^{T}\mathbf{\Gamma}=0\\ \dot{\mathbf{\Gamma}}=-\mathbf{S}(\omega)\mathbf{\Gamma}\end{array} \right. \tag{47}\]  
\(\omega\) is discrete in a similar regular form as in Equation (42). The discrete regular of \(\mathbf{\Gamma}\) is  
\[\dot{\mathbf{\Gamma}}_{k+\frac{1}{2}}=\frac{\mathbf{\Gamma}_{k+1}-\mathbf{\Gamma}_{k}}{h},\mathbf{\Gamma}_{k+\frac{1}{2}}=\frac{\mathbf{\Gamma}_{k+1}+\mathbf{\Gamma}_{k}}{2} \tag{48}\]  
Substitute Equation (49) into Equation (48). The dynamics equation is  
\[\left\{ \begin{array}{l}2J(\omega_{k+1}-\omega_{k})+hmgle_{1}^{T}(\mathbf{\Gamma} _{k+1}+\mathbf{\Gamma}_{k})=0\\ 4(\mathbf{\Gamma}_{k+1}-\mathbf{\Gamma}_{k})+h\mathbf{S}(\omega_{k+1}+\omega_{k})(\mathbf{ \Gamma}_{k+1}+\mathbf{\Gamma}_{k})=0\end{array} \right. \tag{49}\]  
Then, the Jacobi matrix is Equation (51), achieved by deriving \(\omega_{k+1},\mathbf{\Gamma}_{k+1}\). \[\left[ \begin{array}{cc}2J&hmgle_{1}^{T}\\ hS_{1}(\mathbf{\Gamma}_{k+1}+\mathbf{\Gamma}_{k})&4\mathbf{I}+h\mathbf{S}(\omega_{k+1}+\omega_{ k})\end{array}