<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "https://jats.nlm.nih.gov/publishing/1.3/JATS-journalpublishing1-3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.3" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="publisher-id">jcse</journal-id><journal-title-group><journal-title>Journal of Computational Science and Engineering</journal-title></journal-title-group><issn>1710-4068</issn><publisher><publisher-name>Advancersin</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">jcse-v40-a03</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group></article-categories><title-group><article-title>Particle Swarm Optimization for Dynamic Differential-Algebraic Equations of Multibody Systems</article-title></title-group><contrib-group><contrib contrib-type="author"><name name-style="western"><surname>Zhang</surname><given-names>Xiaoxiao</given-names></name><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author"><name name-style="western"><surname>Ding</surname><given-names>Jieyu</given-names></name><xref ref-type="aff" rid="aff-1"/><xref ref-type="aff" rid="aff-2"/></contrib></contrib-group><aff id="aff-1">School of Mathematics and Statistics, Qingdao University, Qingdao 266071, China</aff><aff id="aff-2">Center for Computational Mechanics and Engineering Simulation, Qingdao University, Qingdao 266071, China</aff><pub-date publication-format="electronic" date-type="pub" iso-8601-date="2019-04-20"><day>20</day><month>04</month><year>2019</year></pub-date><volume>40</volume><fpage>1051</fpage><lpage>1055</lpage><permissions><copyright-statement>2019@ The American Computational Science Society.</copyright-statement><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/" start_date="2021-11-26">https://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is licensed under the Creative Commons Attribution 4.0 International license (CC BY 4.0), which permits sharing and adaptation, including commercial reuse, subject to attribution, a link to the license and an indication of changes. Third-party material separately credited with different terms is governed by the license or rights notice stated for that material.</license-p></license></permissions><self-uri content-type="fulltext" xlink:href="https://www.advancersin.org/jcse/articles/jcse-v40-a03/index.html"/><self-uri content-type="pdf" xlink:href="https://www.advancersin.org/jcse/articles/jcse-v40-a03/jcse-v40-a03.pdf"/><abstract><p>Aiming at solving the differential-algebraic equations of multi-body system dynamics, the solution method based on particle swarm optimization is studied. Firstly, Lagrange interpolation is performed on generalized coordinates and generalized velocity, and the Gauss numerical integration method is combined to transform the problem of solving differential algebraic equations into solving optimization problems. Then the particle swarm algorithm is used to solve the problem optimally. Finally, through the multi-body system simulation experiment of the planar two-link manipulator, it is verified that the particle swarm optimization algorithm not only maintains the constraint but also guarantees the energy precision in solving the dynamic equation. The results show that the intelligent optimization algorithm has a good application prospect in solving multi-body dynamics problems.</p></abstract><kwd-group><kwd>Multibody system dynamics</kwd><kwd>Differential algebraic equations</kwd><kwd>Particle swarm optimization</kwd></kwd-group></article-meta></front><body>
    <sec>
      <title>1. Introduction</title>
      <p>Dynamic simulation of multi-body system has become one of the important contents of Engineering simulation, and has been widely used in mechanical, aerospace, vehicle, robotics and biomechanics fields. The dynamics of multi-body systems is usually described as differential-algebraic equations, and the study of numerical integration method is an important part of the computational dynamics of multi-body systems. The traditional methods for solving differential-algebraic equations in this field are extended from the numerical solution of ordinary differential equations. The focus of the study is to achieve the stability of differential-algebraic equations by constrained stability [1,2]. In recent years, some methods developed gradually, such as generalized-alpha method [3], symplectic algorithm [4], energy method [5,6], symplectic preserved variable fraction integral method [7], Lie group method [8], have achieved good simulation results.</p>
      <p>Particle swarm optimization (PSO) is a group-based stochastic optimization technique proposed by Eberhart and Kennedy in 1995 [9]. Subsequently, Kennedy and Eberhart proposed a particle swarm optimization algorithm for discrete space [10]. Clerc proposed a particle swarm algorithm with contraction factor [11,12].</p>
      <p>The idea of this method is to simulate the social behavior of flocks and fish schools. A particle swarm is randomly generated, where each particle represents a possible solution to an optimization problem, and the position of each particle is evaluated by the objective function. The particle finds the optimal solution through the process of iterative process. Compared with other optimization algorithms, particle swarm optimization algorithm has the advantages of simple algorithm, fast convergence, high optimization efficiency and strong robustness. At present, it has achieved very good results in various multidimensional continuous space optimization problems. Production scheduling, robotic intelligent control and image processing have been widely used.</p>
      <p>In this paper, the Lagrange interpolation method is combined with the Gauss numerical integration method to transform the differential-algebraic equation problem into an optimization problem, and then the particle swarm optimization algorithm is designed for the optimization problem. Finally, the simulation experiment of the planar two-link manipulator shows that the algorithm has high precision while maintaining the constraint.</p>
    </sec>
    <sec>
      <title>2. DAEs of Multibody system Dynamics</title>
      <p>The DAEs of index-3 in multibody systems dynamics can be described as follows: {𝑀(𝑞, 𝑡)𝑞̈ + Φ𝑞 𝑇𝜆 = 𝐹(𝑞̇ , 𝑞, 𝑡) Φ(𝑞, 𝑡) = 0 #(1) where 𝑞𝜖𝑅𝑛 is the generalized coordinate, 𝑞̇ 𝜖𝑅𝑛 is the generalized velocity, 𝜆 is the Lagrange multiplier, Φ is the constraint equation of the generalized coordinate 𝑞,Φ𝑞 is the Jacobian matrix of the constraint equation.</p>
      <p>The constraint equation Φ(𝑞, 𝑡) = 0 is used to find the second-order derivative. Equation (1) can be reduced from 3 to index 1, and the equation form is as follows: [ 𝑀 Φ𝑞 𝑇 Φ𝑞 0 ] [𝑞̈ 𝜆] = [ 𝐹 −(Φ𝑞𝑞̇ )𝑞𝑞̇ ] #(2) The simulation time [0， ] is equally divided into several cells ,𝑡 , 𝑡 - , 𝑖 = 0,1, , 𝑁 . In the time interval ,𝑡 , 𝑡 - ,use Lagrangian interpolation to approximate 𝑞(𝑡): 𝑞(𝑡) = ∑ 𝑙𝑗(𝑡)𝑞𝑗 𝑚 𝑗=0 #(3) 𝑙𝑗(𝑡) = ∏ (𝑡 − 𝑡 ) (𝑡𝑗 − 𝑡 ) 𝑚 =0, ≠𝑗 #(4) Then</p>
      <p>𝑞̇ (𝑡) = ∑ 𝑙𝑗̇ (𝑡)𝑞𝑗 𝑚 𝑗=0 #(5) 𝑞̈ (𝑡) = ∑ 𝑙𝑗̈ (𝑡)𝑞𝑗 𝑚 𝑗=0 #(6) Interpolation node 𝑞 satisfies the constraint Φ(𝑞, 𝑡) = 0. The interpolation functions 𝑞(𝑡), 𝑞̇ (𝑡), 𝑞̈ (𝑡) are brought into the index 1 differential-algebraic equation to obtain the equation (7): 𝑓(𝑡) = [𝑞̈ (𝑡) 𝜆 ] − [ 𝑀 Φ𝑞 𝑇 Φ𝑞 0 ] − [ 𝐹(𝑞̇ (𝑡), 𝑞(𝑡), 𝑡) −(Φ𝑞𝑞̇ )𝑞𝑞̇ ] #(7) ∀𝑡 ∈ ,𝑡 , 𝑡 - If 𝑓(𝑡) = 0 for ∀𝑡 ∈ ,𝑡 , 𝑡 - , the interpolation function 𝑞(𝑡) is the exact solution of equation (1) in ,𝑡 , 𝑡 - . Obviously, the equation (7) is a nonlinear equation, and the analytical solution cannot be normally found. This means that when equation (7) is close to zero, 𝑞(𝑡) is the solution of equation (7) in ,𝑡 , 𝑡 -.Can be converted into the following optimization problems:</p>
      <p>𝑞𝑖 ∫ 𝑓𝑇𝑓𝑑𝑥 𝑖 𝑖 #(8) The Gauss numerical integration of the above formula can be transformed into the following form:</p>
      <p>𝑞𝑖 ∑ 𝑓𝑇(𝑡 )𝑓(𝑡 )</p>
      <p>= #(9) where is the Gauss integral coefficient, and 𝑡 is the Gauss integral node. Obviously, equation (9) is a non-convex optimization problem [13]. The existing research shows that the traditional mathematical optimization method is difficult to solve such problems effectively. The intelligent optimization algorithm is an effective algorithm for solving such problems. Particle swarm optimization is an intelligent algorithm that mimics population motion and provides new theories and methods for solving engineering problems.</p>
    </sec>
    <sec>
      <title>3. Design of particle swarm optimization algorithm</title>
      <p>The traditional particle swarm optimization algorithm consists of a particle swarm system with 𝑀 particles X = *𝑋 , 𝑋2, 𝑋3, , 𝑋𝑀+ , 𝑋 ∈ 𝑅𝐷 . The position and velocity of the 𝑖 particle at time 𝑘 : 𝑋 (𝑘) = (𝑋 (𝑘), 𝑋 2(𝑘), , 𝑋 𝐷(𝑘)) and 𝑉 (𝑘) = (𝑉 (𝑘), 𝑉 2(𝑘), , 𝑉 𝐷(𝑘)) ， (𝑖 = 1,2,3, , 𝑀) . The historical optimal position of a certain particle 𝑋 is 𝑝𝑏𝑒𝑠𝑡 . The overall optimal position of the particle swarm system X is gbest . During the iteration, the particle position and velocity update formula is as follows: 𝑉 𝑗 = 𝜔𝑉 𝑗 + 𝑐 𝑟 (𝑝𝑏𝑒𝑠𝑡𝑗 − 𝑋 𝑗 ) +𝑐2𝑟2(g𝑏𝑒𝑠𝑡𝑗 − 𝑋 𝑗 ) 𝑋 𝑗 = 𝑋 𝑗 + 𝑉 𝑗#(10) where ω is the inertia weight; 𝑐 and 𝑐2 are the acceleration coefficients; 𝑟 and 𝑟2 are random numbers uniformly distributed between (0, 1).</p>
      <p>The particle swarm optimization algorithm is used to solve the interpolation function 𝑞(𝑡) of the interval ,𝑡 , 𝑡 -. The initial point 𝑞0 = 𝑞(𝑡 ) ∈ 𝑅𝑛 is known, and the interpolation node 𝑞𝑗, 𝑗 = 1,2 𝑚 Is the node to be optimized, and 𝑞𝑗 satisfies the constraint Φ(𝑞, 𝑡) = 0.</p>
      <p>Define the objective function as follows: (𝑞𝑗) = ∑ 𝑓𝑇(𝑡 )𝑓(𝑡 )</p>
      <p>= #(11) If (𝑞𝑗) = 0, then 𝑞𝑗, 𝑗 = 1,2 𝑚 is the exact value. Since the objective function is a nonlinear function, there is generally no analytical solution, so (𝑞𝑗) can only be as close as possible to the exact solution, and the convergence precision 𝜑𝑚 𝑛 and the maximum iteration step 𝑔𝑚𝑎𝑥 are set. If the convergence precision is reached or the maximum iteration step is reached, then output the optimization result.</p>
      <p>The solution steps of the particle swarm algorithm are as follows: 1) Set the initial parameters of the particle swarm algorithm: population size, particle dimension d, range of particle position, maximum number of iterations, and randomly generate the initial population, defining the objective function . 2) Calculate the fitness value of each particle according to the set objective function. 3) Compare the fitness of each particle, determine the historical optimal position of each particle and the historical optimal position of the population. 4) Update all particles according to formula (10). 5) If (gbest) &lt; 𝜑𝑚 𝑛 or reaches the maximum iteration step 𝑔𝑚𝑎𝑥, the optimal solution gbest is output, otherwise steps 2)-step 5) are repeated until the preset termination condition is satisfied.</p>
    </sec>
    <sec>
      <title>4. Numerical Example</title>
      <p>The slider-double link system is taken as an example to verify and analyze the above method. As shown in Figure 1, the length of the link are 𝐿 and 𝐿2 and the masses are 𝑚 and 𝑚2. The corners are denoted by 𝜃 and 𝜃2. Suppose the system is only affected by gravity.</p>
      <p>Figure 1.Three-degree-of-freedom robotic arm.</p>
      <p>Taking the state variable 𝑞 = (𝑥 , 𝑦 , 𝜃 , 𝑥2, 𝑦2, 𝜃2) , the system dynamics index 3 differential-algebraic equation is: [ 𝑀 Φ𝑞 𝑇 Φ𝑞 0 ] [𝑞̈ 𝜆] = [ 𝐹 −(Φ𝑞𝑞̇ )𝑞𝑞̇ ] #(11) where 𝑀 = d ag(𝑚 , 𝑚 , 𝐽 , 𝑚2, 𝑚2, 𝐽2) is a generalized mass matrix, 𝐹 = (0, −𝑚 𝑔, 0,0, −𝑚2𝑔, 0) is a generalized force vector, 𝐽 =</p>
      <p>2 𝑚 𝐿 2 and 𝐽2 =</p>
      <p>2 𝑚2𝐿2 2 are the moments of inertia of the connecting rod. Φ𝑞 = (</p>
      <p>1 0 𝐿 2 s 𝜃 0 0 0 0 1 − 𝐿 2 cos 𝜃 0 0 0 −1 0 𝐿 2 s 𝜃 1 0 𝐿2 2 s 𝜃2 0 −1 − 𝐿 2 cos 𝜃 0 1 − 𝐿2 2 cos 𝜃2)</p>
      <p>#(12) (Φ𝑞𝑞̇ )𝑞 = (</p>
      <p>0 0 𝐿 2 cos 𝜃 𝜃 ̇ 0 0 0 0 0 𝐿 2 s 𝜃 𝜃 ̇ 0 0 0 0 0 𝐿 2 cos 𝜃 𝜃 ̇ 0 0 𝐿2 2 cos 𝜃2 𝜃2̇ 0 0 𝐿 2 s 𝜃 𝜃 ̇ 0 0 𝐿2 2 s 𝜃2 𝜃2̇ )</p>
      <p>#(13) Approximate 𝑞(𝑡) with three-point Lagrange interpolation: 𝑞(𝑡) = (𝑡 − 𝑡 )(𝑡 − 𝑡2) (𝑡0 − 𝑡 )(𝑡0 − 𝑡2) 𝑞0 + (𝑡 − 𝑡0)(𝑡 − 𝑡2) (𝑡 − 𝑡0)(𝑡 − 𝑡2) 𝑞 + (𝑡 − 𝑡 )(𝑡 − 𝑡0) (𝑡2 − 𝑡 )(𝑡2 − 𝑡0) 𝑞2 𝑞̇ (𝑡) = (𝑡 − 𝑡 ) + (𝑡 − 𝑡2) (𝑡0 − 𝑡 )(𝑡0 − 𝑡2) 𝑞0 + (𝑡 − 𝑡0) + (𝑡 − 𝑡2) (𝑡 − 𝑡0)(𝑡 − 𝑡2) 𝑞 + (𝑡 − 𝑡 ) + (𝑡 − 𝑡0) (𝑡2 − 𝑡 )(𝑡2 − 𝑡0) 𝑞2 𝑞̈ (𝑡) = 2 (𝑡0 − 𝑡 )(𝑡0 − 𝑡2) 𝑞0 + 2 (𝑡 − 𝑡0)(𝑡 − 𝑡2) 𝑞 + 2 (𝑡2 − 𝑡 )(𝑡2 − 𝑡0) 𝑞2 From the initial value 𝑞(𝑡0) = 𝑞0, 𝑞̇ (𝑡0) = 𝑞̇0: 𝑞 = (𝑕𝑞̇0 + 3𝑞0 + 𝑞2 4 ) ，𝑕 = 𝑡 − 𝑡 #(14) The interpolation node 𝑞 , 𝑖 = 0,1,2 satisfies the constraint Φ(𝑞, 𝑡) = 0: 𝑞 = (</p>
      <p>𝐿 2 cos 𝜃 𝐿 2 s 𝜃 𝜃 𝐿 cos 𝜃 + 𝐿2 2 cos 𝜃2 𝐿 s 𝜃 + 𝐿2 2 s 𝜃2 𝜃2 )</p>
      <p>#(15) Two-point Gauss numerical integration method is used to solve the objective function.</p>
      <p>𝑞2 (∑ 𝑓𝑇(𝑡 )𝑓(𝑡 ) = ) #(16) {</p>
      <p>= 2 = 2 𝑡 = −√3 3 ∙ 𝑕 2 + 𝑡 + 𝑡 2 𝑡2 = √3 3 ∙ 𝑕 2 + 𝑡 + 𝑡 2</p>
      <p>Take the mass of the connecting rod 𝑚 = 1𝑘𝑔, 𝑚2 = 2𝑘𝑔, the length of the rod 𝐿 = 1𝑚, 𝐿2 = √3𝑚, the acceleration of gravity 𝑔 = 9.81, the step length = 0.002s. Initial state of the connecting rod: 𝜃 = 𝜋 3 , 𝜃2 = − 𝜋 6 , generalized speed 𝑞̇ = 0. Particle swarm algorithm parameter setting [14]: population size 𝑀 = 120，𝑐 = 𝑐2 = 2，ω = 0.1, convergence precision 𝜑𝑚 𝑛 = 10− 5 , maximum iteration step 𝑔𝑚𝑎𝑥 =500. The simulation results are shown in the figure:</p>
      <p>Figure 2.The trajectory of the end of connecting rod.</p>
      <p>Figure 3.Total System Energy.</p>
      <p>Figure 4.System Kinetic Energy and Potential Energy.</p>
      <p>Figure 5.Planar manipulator restraint.</p>
      <p>As shown in Figure 3 and Figure 4, the maximum error of the total energy of the system is ax0&lt; &lt;𝑛|𝐻(𝑡 ) − 𝐻(𝑡0)| = 2.2838354400690 × 10−2. The average error of the total energy of the system is 2.727479433485 × 10−3, Kinetic energy and potential energy change stable. It can be seen from Figure 5 that the system guarantees displacement constraints, and the speed and acceleration constraints are large.</p>
    </sec>
    <sec>
      <title>5. Conclusion</title>
      <p>In this paper, the particle swarm optimization algorithm is used to solve the multi-body system dynamics differential-algebraic equations, and the planar two-link manipulator system is simulated. The experimental results show that the energy error of the system is small when the constraint of index 1 is satisfied. The particle swarm algorithm has few parameters and is simple and does not need the derivative information of the objective function. It has achieved good results for solving the differential-algebraic equations of multi-body systems, and illustrates the feasibility of applying the intelligent optimization algorithm to multi-body dynamics simulation. However, this method has the disadvantages of large computational complexity and long running time of the algorithm. In the future, it is a major research direction in effectively reducing the running time and improving the accuracy of the algorithm.</p>
    </sec>
    <sec>
      <title>Acknowledgments</title>
      <p>The financial support was provided by the National Natural Science Foundation of China(NNSFC) through grant Nos 11772166，11472143.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref-001">
        <mixed-citation>[1] Simenon B. Computational flexible multibody dynamics-A differential algebraic approach. Berlin: Springer，2013</mixed-citation>
      </ref>
      <ref id="ref-002">
        <mixed-citation>[2] Fon-Llagunes J M. Multibody dynamics computational methods and applications. Switzerland: Springer，2016.</mixed-citation>
      </ref>
      <ref id="ref-003">
        <mixed-citation>[3] Bruls O, Cardona A, Arnold M. Lie group generalized-alpha time integration of constrained flexible multibody systems. Mechanism &amp; Machine Theory, 2012, 48(1):121-137.</mixed-citation>
      </ref>
      <ref id="ref-004">
        <mixed-citation>[4] Jay L. Symplectic Partitioned Runge-Kutta Methods for Constrained Hamiltonian Systems. SIAM Journal on Numerical Analysis, 1996, 33(1):368-387.</mixed-citation>
      </ref>
      <ref id="ref-005">
        <mixed-citation>[5] Lens E, Alberto Cardona. An energy preserving/decaying scheme for nonlinearly constrained multibody systems. Multibody System Dynamics, 2007, 18(3):435-470.</mixed-citation>
      </ref>
      <ref id="ref-006">
        <mixed-citation>[6] Betsch P, Uhlar S. Energy-momentum conserving integration of multibody dynamics. Multibody System Dynamics, 2007, 17(4):243-289.</mixed-citation>
      </ref>
      <ref id="ref-007">
        <mixed-citation>[7] West J E M M. Discrete mechanics and variational integrators. Acta Numerica, 2001, 10.</mixed-citation>
      </ref>
      <ref id="ref-008">
        <mixed-citation>[8] Iserles A, Munthekaas H Z, Nørsett S P, et al. Lie-group methods. Acta Numerica, 2000, 9(2):215--365.</mixed-citation>
      </ref>
      <ref id="ref-009">
        <mixed-citation>[9] J.Kennedy, R.C.Eberhart. A discrete binary version of the particle swarm algorithm. IEEE International Conference on Systems.1997,5(5):4104-4108.</mixed-citation>
      </ref>
      <ref id="ref-010">
        <mixed-citation>[10] Kennedy J, Eberhart R C. A discrete binary version of the particle swarm algorithm. IEEE International Conference on Systems,Man,and Cybernetics. Computational Cybernetics and Simulation. IEEE,1997.</mixed-citation>
      </ref>
      <ref id="ref-011">
        <mixed-citation>[11] M.Clerc. The swarm and the queen:towards a deterministic and adaptive particle swarm optimisation. Congress on Evolutionary Computation. 2002,3(3):1957.</mixed-citation>
      </ref>
      <ref id="ref-012">
        <mixed-citation>[12] R C Eberhart, Y Shi. Comparing inertia weights and constriction factors in particle swarm optimization. Congress on Evolutionary Computation. 2002,1(5):84-88.</mixed-citation>
      </ref>
      <ref id="ref-013">
        <mixed-citation>[13] Vasant P, Ganesan T, Elamvazuthi I. An improved PSO approach for solving non-convex optimization problems. Ninth International Conference on Ict &amp; Knowledge Engineering. IEEE, 2012.</mixed-citation>
      </ref>
      <ref id="ref-014">
        <mixed-citation>[14] Xu Z, Du L, Wang H, et al. Particle swarm optimization-based algorithm of a symplectic method for robotic dynamics and control. Applied Mathematics and Mechanics(English Edition), 2019, 40(01):113-128.</mixed-citation>
      </ref>
    </ref-list>
  </back>
  <floats-group>
    <fig id="fig-001" position="float">
      <graphic xlink:href="figures/fig-001.jpg"/>
    </fig>
    <fig id="fig-002" position="float">
      <graphic xlink:href="figures/fig-002.jpg"/>
    </fig>
    <fig id="fig-003" position="float">
      <graphic xlink:href="figures/fig-003.jpg"/>
    </fig>
    <fig id="fig-004" position="float">
      <graphic xlink:href="figures/fig-004.jpg"/>
    </fig>
    <fig id="fig-005" position="float">
      <graphic xlink:href="figures/fig-005.jpg"/>
    </fig>
  </floats-group>
</article>
