# A Time Integration Method Based on Galerkin Weak Form for Nonlinear Structural Dynamics
## 5 Numerical Examples
### The Simple Pendulum  
The governing equation [43] for the nonlinear pendulum shown in Figure 5 is, \(\ddot{u}+g/L\sin(u)=0\) with initial conditions \(u(0)=\pi/2\) rad and \(\dot{u}(0)=0\) rad/s, where \(g\) is the gravitational acceleration, \(L\) is the length of a massless suspension, and \(u\) is the angle between the cycloid and vertical plane. The kinetic and potential energy of the system are \(T_{E}=0.5L^{2}\dot{u}^{2}\) and \(V_{E}=g(L-L\cos u)\), respectively. Moreover, the total energy is the sum of them. The solutions obtained from the trapezoidal rule with \(\Delta t=0.0001\) s are approximately regarded as the exact solutions to evaluate the accuracy and efficiency of the present method here. This example aims to test the stability and accuracy of the proposed algorithm and the scheme without using numerical damping. Figure 4: Percentage of period elongation and amplitude decay of the proposed scheme with numerical damping: (**a**) Percentage of period elongation. (**b**) Percentage of amplitude decay. Figure 3: The spectral radii of transfer matrix **A** of the trapezoidal rule, [PERSON] \(\theta\)-method, and [PERSON] method and the proposed scheme with different numerical damping. Let \(g/L=4\pi^{2}\)s\({}^{-2}\) and take the time step to be \(\Delta t~{}=~{}0.15\) s. The pendulum motion is calculated with the trapezoidal rule, [PERSON] method, [PERSON] method, [PERSON] \(\theta\)-method, and the proposed method. The displacement, velocity, and total energy histories from the trapezoidal rule are presented in Figures 6 and 7, from which it can be seen that the results become considerably large when the time approaches 30 s, i.e., an unstable response is given from the trapezoidal rule for this example. The displacement responses of the exact solution and the other four methods are shown in Figure 8, which are all stable. It can be seen that, for [PERSON] method, the error of response gets bigger as the time goes on. For the [PERSON] method and [PERSON] method, noteworthy amplitude decay takes place in displacement responses since there is ineradicable numerical damping in these two methods, especially in the [PERSON] method. For this pendulum example, using methods without numerical damping may obtain more suitable responses, but there is no way for the [PERSON] method and [PERSON] method to control or remove the numerical damping, which will significantly affect the accuracy of the solution. The comparisons of energy responses shown in Figure 9 can further demonstrate the numerical dissipation property of the [PERSON] and [PERSON] methods. Both the displacement and velocity results of the present method with \(m=2\),3 are shown in Figure 10, which are stable and of high accuracy. Figure 5: A simple pendulum. Figure 6: Responses of the pendulum using the trapezoidal rule with \(\Delta t=0.15\) s.  
Figure 8: Comparisons of responses among the exact solution, [PERSON] method, [PERSON] method, [PERSON] method, and the present method with \(m=1\). Figure 7: The energy evolution of the pendulum using the trapezoidal rule with \(\Delta t=0.15\) s.  
Figure 9: Comparisons of energy responses among the [PERSON] method, [PERSON] method, [PERSON] method, and the present method. The error and convergence order of the present method are further studied. Let \(g/L=3.438\) s\({}^{-2}\). The period of the response is approximately equal to 4 s. Taking the time step to be \(\Delta t=0.2\) s, \(\Delta t=0.1\) s, and \(\Delta t=0.05\) s respectively, the accuracy of results of trapezoidal rule, [PERSON] method, [PERSON] \(\theta\)-method, [PERSON] method, and the present method with \(m=1\),\(2\),\(3\) are compared, with the following error estimates used:  
\[\varepsilon=\sqrt{\sum_{i=1}^{N}\left(\|\mathbf{u}_{i}^{h}\|-\|\mathbf{u}_{i} \|\right)^{2}}/\sqrt{\sum_{i=1}^{N}\left(\|\mathbf{u}_{i}\|\right)^{2}}\times 1 00\% \tag{40}\]  
where \(\mathbf{u}_{i}^{h}\) and \(\mathbf{u}_{i}\) are the approximate displacement and the exact displacement at step \(i\) and \(N\) is the total number of time steps.