## 2 Dynamic Model
### Equation of Motion and Simulation Algorithm  
The total free length of the wire rope (the sum of the original length of the rope segment wrapping on the rope drum and the original length of the rope segments hanging from the rope drum) remains invariable. Therefore, a constraint \(\varphi\) (expressed by Equation (26) in [38]), which gives the relationship between \(l\), \(\varepsilon\) and \(\theta_{5}\), is incorporated into a modified Lagrangian function \(\mathcal{L}=T-V+\lambda\varphi\), in which \(\lambda\) is a Lagrange multiplier. After applying [PERSON]'s principle, ignoring higher order small quality and denoting \(\lambda=-\lambda_{1}c_{\rm w}\dot{\varepsilon}-\lambda_{2}k_{\rm w}\varepsilon\), the equation of motion of the crane during braking of the lifting mechanism are derived as  
\[\mathbf{M}\ddot{\mathbf{x}}+\mathbf{C}\dot{\mathbf{x}}+\mathbf{K}\mathbf{x}= \mathbf{f} \tag{5}\]  
where  
\[\mathbf{M}=\left[ \begin{array}{ccc}\mathbf{M}_{\rm aa}&m_{\rm Q}(1+ \varepsilon)\mathbf{N}_{\rm d}^{\rm T}\mathbf{R}^{\rm T}&-m_{\rm Q}[l+2l_{\rm d }(1+\varepsilon)]\mathbf{N}_{\rm d}^{\rm T}&\mathbf{0}\\ \mathbf{0}&\mathbf{J}_{\rm L}&\mathbf{0}&\mathbf{0}\\ m_{\rm Q}\mathbf{N}_{\rm d}&m_{\rm Q}(1+\varepsilon)\mathbf{R}^{\rm T}&-m_{\rm Q }[l+2l_{\rm d}(1+\varepsilon)]&\mathbf{0}\\ \mathbf{0}&\mathbf{0}&0&0\end{array} \right]\]\[\mathbf{C}=\left[ \begin{array}{cccc}c_{\mathrm{g}}\mathbf{N}_{\mathrm{v}1}&\mathbf{ 0}&-2 lm_{\mathrm{Q}}\mathbf{N}_{\mathrm{d}}^{\mathrm{T}}&\mathbf{0}\\ \mathbf{0}&c_{\mathrm{s}}\mathbf{K}_{\mathrm{L}}&c_{\mathrm{w}}(\lambda_{1} \mathbf{R}+m_{\mathrm{f}}\mathbf{e})&\mathbf{0}\\ \mathbf{0}&\mathbf{0}&-2m_{\mathrm{Q}}l-c_{\mathrm{w}}[1+2l_{\mathrm{d}}(1- \lambda_{1})/l]&0\\ \mathbf{0}&\mathbf{R}^{\mathrm{T}}&-2l_{\mathrm{d}}&1\end{array} \right],\]  
\[\mathbf{K}=\left[ \begin{array}{cccc}\mathbf{N}_{\mathrm{v}1}&\mathbf{0}& \mathbf{0}&\mathbf{0}\\ \mathbf{0}&\mathbf{K}_{\mathrm{L}}&k_{\mathrm{w}}(\lambda_{2}\mathbf{R}+m_{ \mathrm{f}}\mathbf{e})&\mathbf{0}\\ \mathbf{0}&\mathbf{0}&-k_{\mathrm{w}}[1+2l_{\mathrm{d}}(1-\lambda_{2})/l]&0\\ \mathbf{0}&\mathbf{0}&0&0\end{array} \right]\mathbf{f}=\left[ \begin{array}{ ccc}-m_{\mathrm{Q}}\mathbf{g}\mathbf{N}_{\mathrm{d}}^{\mathrm{T}}-m_{\mathrm{T}} \mathbf{g}\mathbf{N}_{\mathrm{T}}^{\mathrm{T}}\\ -\mathbf{M}_{\mathrm{b}}^{\mathrm{T}}\\ -m_{\mathrm{Q}}\mathbf{g}\\ 0\end{array} \right]\]  
\[\mathbf{x}^{\mathrm{T}}=\left[ \begin{array}{cccc}\mathbf{a}^{\mathrm{T}}& \mathbf{\theta}^{\mathrm{T}}&\varepsilon&l\end{array} \right],\;\mathbf{M}_{ \mathrm{aa}}=m_{\mathrm{g}}\mathbf{I}_{\mathrm{nxn}}+m_{\mathrm{T}}\mathbf{N}_ {\mathrm{T}}^{\mathrm{T}}\mathbf{N}_{\mathrm{T}}+m_{\mathrm{Q}}\mathbf{N}_{ \mathrm{d}}^{\mathrm{T}}\mathbf{N}_{\mathrm{d}}+I_{\mathrm{T}}\mathbf{N}_{ \mathrm{\Phi}}^{\mathrm{T}}\mathbf{N}_{\mathrm{\Phi}}\;,\]  
\[\lambda_{1}=\left(1+2l_{\mathrm{d}}/l\right)/\left(1+2l_{\mathrm{d}}/l- \varepsilon\right),\;\lambda_{2}=\left(1+2l_{\mathrm{d}}/l-\varepsilon/2 \right)/\left(1+2l_{\mathrm{d}}/l-\varepsilon\right),\]  
\[\mathbf{R}^{\mathrm{T}}=\left(0,0,0,0,2\mu l_{\mathrm{d}},0\right),\;\mathbf{e }^{\mathrm{T}}=\left(0,0,0,0,1,0\right).\]  
Equation (5) is just a general equation of motion of the electric crane during braking of the lifting mechanism. There are all two kinds of motion states for every component \(l_{i}(i=1,\,3,\,4,\,6)\) during braking, that is, rotation state and non-rotation state. So if component \(l_{i}\) is held by the mechanical brake \(i\) and cannot rotate, the equation of motion (5) must be reduced according to the following two steps:  
The first step is substituting vector \(\mathbf{f}\) by a new vector \(\mathbf{\overline{f}}=\mathbf{f}-\mathbf{K}_{\theta i}\).