## 3 Dynamics Modeling of Shafting of Hydropower Units
\(J_{d}\) is the diameter moment of inertia. \(\varphi\) is the rotation angle of the rotor around the axis of rotation. Figure 8: Hydropower units spindle model diagram: (**a**) hydropower units spindle diagram, (**b**) rotor disc plane eccentricity diagram. The potential energy equation of hydropower units' shafting is [27]:  
\[U=\frac{1}{2}\left[K_{1}\left(x_{1}^{2}+y_{1}^{2}\right)+K_{2}\left(x_{2}^{2}+y_{ 2}^{2}\right)\right]+K_{3}\sqrt{\left(x_{1}^{2}+y_{1}^{2}\right)\left(x_{2}^{2} +y_{2}^{2}\right)}, \tag{10}\]  
In Equation (10), there is:  
\[\left\{ \begin{array}{l}K_{1}=\frac{A_{1}^{2}}{B^{2}}k_{1}+\frac{(c+d)^{2}}{( b+c+d)^{2}}k_{2}+\frac{d^{2}}{(b+c+d)^{2}}k_{3}\\ K_{2}=\frac{A_{2}^{2}}{B^{2}}k_{1}+\frac{b^{2}}{(b+c+d)^{2}}k_{2}+\frac{(b+c)^{2 }}{(b+c+d)^{2}}k_{3}\\ K_{3}=\frac{-A_{1}A_{2}}{B^{2}}k_{1}+\frac{b(c+d)}{(b+c+d)^{2}}k_{2}+\frac{d(b+ c)}{(b+c+d)^{2}}k_{3}\end{array} \right., \tag{11}\]  
where \(A_{1}=(a+b)(b+c+d)\), \(A_{2}=ab\), \(B=b(b+c+d)\), \(k_{1}\), \(k_{2}\), \(k_{3}\) are the stiffness coefficients of the upper guide bearing, the lower guide bearing, and the water guide bearing, respectively. By combining Equations (9) and (10) and following the principle of Lagrange mechanics, the Lagrange function of the main shaft system in hydropower generating units can be constructed, and its expression is:  
\[ \begin{array}{ll}L&=T-U\\ &=\frac{1}{2}\sum\limits_{i=1}^{2}\left[m_{i}\left(\dot{x}_{i}^{2}+y_{i}^{2}+e _{i}^{2}\dot{\varphi}^{2}+2e_{i}\dot{\varphi}\dot{y}_{i}\cos\varphi-2e_{i}\dot {\varphi}\dot{x}_{i}\sin\varphi\right)\right]+\\ &\frac{1}{2}\sum\limits_{i=1}^{2}\left[J_{d_{i}}\left(\dot{\theta}_{x_{i}}^{2 }+\dot{\theta}_{y_{i}}^{2}\right)+\left(J_{p_{i}}+m_{i}e_{i}^{2}\right)\left( \dot{\varphi}^{2}-2\dot{\varphi}\dot{\theta}_{y_{i}}\theta_{x_{i}}\right) \right]-\\ &\frac{1}{2}\left[K_{1}\left(x_{1}^{2}+y_{1}^{2}\right)+K_{2}\left(x_{2}^{2}+ y_{2}^{2}\right)\right]-K_{3}\sqrt{\left(x_{1}^{2}+y_{1}^{2}\right)\left(x_{2}^{2} +y_{2}^{2}\right)}\end{array} , \tag{12}\]  
Through the previous analysis, the lateral displacement and deflection angle of the main shaft system of the hydropower generating units are selected as generalized displacement coordinates, namely \(q_{i}=(x_{1},y_{1},x_{2},y_{2},\theta_{x1},\theta_{y1},\theta_{x2},\theta_{y2})\). The Lagrange equation can be expressed as:  
\[\frac{d}{dt}\left(\frac{\partial L}{\partial\dot{q}_{i}}\right)-\frac{\partial L }{\partial q_{i}}=Q_{i}, \tag{13}\]  
where \(L\) is the Lagrange function, \(q_{i}\) is the generalized coordinate, and \(Q_{i}\) is the generalized force. The external forces acting on the shafting of hydropower units can be described as:  
\[\left\{ \begin{array}{l}Q_{x_{1}}=F_{x-ump}-c_{1}\dot{x}_{1}-k_{4}\theta_{x_ {1}}\\ Q_{y_{1}}=F_{y-ump}-c_{1}y_{1}+k_{4}\theta_{y_{1}}\\ Q_{x_{2}}=F_{x}-c_{2}\dot{x}_{2}-k_{4}\theta_{x_{2}}\\ Q_{y_{2}}=F_{y}-c_{2}\dot{y}_{2}+k_{4}\theta_{y_{2}}\\ Q_{\theta_{x_{1}}}=-c_{3}\dot{\theta}_{x_{1}}+k_{4}y_{1}-k_{5}\theta_{x_{1}}\\ Q_{\theta_{y_{1}}}=-c_{3}\dot{\theta}_{y_{1}}-k_{4}x_{1}-k_{5}\theta_{y_{1}}\\ Q_{\theta_{x_{2}}}=-c_{3}\dot{\theta}_{x_{2}}+k_{4}y_{2}-k_{5}\theta_{x_{2}}\\ Q_{\theta_{y_{2}}}=-c_{3}\dot{\theta}_{y_{2}}-k_{4}x_{2}-k_{5}\theta_{y_{2}}\\ \end{array} ,\right. \tag{14}\]  
where \(c_{1}\), \(c_{2}\), and \(c_{3}\) are the rotor damping coefficient, turbine runner damping coefficient, and structure bending damping coefficient, respectively. \(k_{4}\) and \(k_{5}\) stiffness coefficients of the large axis inclination caused by force and torque, respectively, represent the ratio of torque change caused by the change in unit inclination when the main axis is tilted. \(F_{x}\) and \(F_{y}\) are the fluid excitation forces acting on the x and y directions of the turbine runner. \(F_{x\text{-}ump}\) and \(F_{y\text{-}ump}\) are the unbalanced magnetic forces acting on the x and y directions of the generator rotor. In Equation (14), the nonlinear unbalanced magnetic tension [28] can be expressed as:  
\[\left\{