class_docstr: Method for formulating the equations of motion using a set of interconnected bodies with joints.
  
  Parameters
  ==========
  
  newtonion : Body or ReferenceFrame
      The newtonion(inertial) frame.
  *joints : Joint
      The joints in the system
  
  Attributes
  ==========
  
  q, u : iterable
      Iterable of the generalized coordinates and speeds
  bodies : iterable
      Iterable of Body objects in the system.
  loads : iterable
      Iterable of (Point, vector) or (ReferenceFrame, vector) tuples
      describing the forces on the system.
  mass_matrix : Matrix, shape(n, n)
      The system's mass matrix
  forcing : Matrix, shape(n, 1)
      The system's forcing vector
  mass_matrix_full : Matrix, shape(2*n, 2*n)
      The "mass matrix" for the u's and q's
  forcing_full : Matrix, shape(2*n, 1)
      The "forcing vector" for the u's and q's
  method : KanesMethod or Lagrange's method
      Method's object.
  kdes : iterable
      Iterable of kde in they system.
  
  Examples
  ========
  
  This is a simple example for a one degree of freedom translational
  spring-mass-damper.
  
  >>> from sympy import symbols
  >>> from sympy.physics.mechanics import Body, JointsMethod, PrismaticJoint
  >>> from sympy.physics.vector import dynamicsymbols
  >>> c, k = symbols('c k')
  >>> x, v = dynamicsymbols('x v')
  >>> wall = Body('W')
  >>> body = Body('B')
  >>> J = PrismaticJoint('J', wall, body, coordinates=x, speeds=v)
  >>> wall.apply_force(c*v*wall.x, reaction_body=body)
  >>> wall.apply_force(k*x*wall.x, reaction_body=body)
  >>> method = JointsMethod(wall, J)
  >>> method.form_eoms()
  Matrix([[-B_mass*Derivative(v(t), t) - c*v(t) - k*x(t)]])
  >>> M = method.mass_matrix_full
  >>> F = method.forcing_full
  >>> rhs = M.LUsolve(F)
  >>> rhs
  Matrix([
  [                     v(t)],
  [(-c*v(t) - k*x(t))/B_mass]])
  
  Notes
  =====
  
  ``JointsMethod`` currently only works with systems that do not have any
  configuration or motion constraints.
docstr: Method to form system's equation of motions.
  
  Parameters
  ==========
  
  method : Class
      Class name of method.
  
  Returns
  ========
  
  Matrix
      Vector of equations of motions.
  
  Examples
  ========
  
  This is a simple example for a one degree of freedom translational
  spring-mass-damper.
  
  >>> from sympy import S, symbols
  >>> from sympy.physics.mechanics import LagrangesMethod, dynamicsymbols, Body
  >>> from sympy.physics.mechanics import PrismaticJoint, JointsMethod
  >>> q = dynamicsymbols('q')
  >>> qd = dynamicsymbols('q', 1)
  >>> m, k, b = symbols('m k b')
  >>> wall = Body('W')
  >>> part = Body('P', mass=m)
  >>> part.potential_energy = k * q**2 / S(2)
  >>> J = PrismaticJoint('J', wall, part, coordinates=q, speeds=qd)
  >>> wall.apply_force(b * qd * wall.x, reaction_body=part)
  >>> method = JointsMethod(wall, J)
  >>> method.form_eoms(LagrangesMethod)
  Matrix([[b*Derivative(q(t), t) + k*q(t) + m*Derivative(q(t), (t, 2))]])
  
  We can also solve for the states using the 'rhs' method.
  
  >>> method.rhs()
  Matrix([
  [                Derivative(q(t), t)],
  [(-b*Derivative(q(t), t) - k*q(t))/m]])
docstr_tok: ["Method","to","form","system","'s","equation","of","motions",".","Parameters","==========","method",":","Class","Class","name","of","method",".","Returns","========","Matrix","Vector","of","equations","of","motions",".","Examples","========","This","is","a","simple","example","for","a","one","degree","of","freedom","translational","spring-mass-damper",".",">",">",">","from","sympy","import","S",",","symbols",">",">",">","from","sympy.physics.mechanics","import","LagrangesMethod",",","dynamicsymbols",",","Body",">",">",">","from","sympy.physics.mechanics","import","PrismaticJoint",",","JointsMethod",">",">",">","q","=","dynamicsymbols","(","'","q","'",")",">",">",">","qd","=","dynamicsymbols","(","'","q","'",",","1",")",">",">",">","m",",","k",",","b","=","symbols","(","'m","k","b","'",")",">",">",">","wall","=","Body","(","'","W","'",")",">",">",">","part","=","Body","(","'","P","'",",","mass=m",")",">",">",">","part.potential_energy","=","k","*","q","*","*","2","\/","S","(","2",")",">",">",">","J","=","PrismaticJoint","(","'","J","'",",","wall",",","part",",","coordinates=q",",","speeds=qd",")",">",">",">","wall.apply_force","(","b","*","qd","*","wall.x",",","reaction_body=part",")",">",">",">","method","=","JointsMethod","(","wall",",","J",")",">",">",">","method.form_eoms","(","LagrangesMethod",")","Matrix","(","[","[","b","*","Derivative","(","q","(","t",")",",","t",")","+","k","*","q","(","t",")","+","m","*","Derivative","(","q","(","t",")",",","(","t",",","2",")",")","]","]",")","We","can","also","solve","for","the","states","using","the","'rhs","'","method",".",">",">",">","method.rhs","(",")","Matrix","(","[","[","Derivative","(","q","(","t",")",",","t",")","]",",","[","(","-b","*","Derivative","(","q","(","t",")",",","t",")","-","k","*","q","(","t",")",")","\/m","]","]",")"]
code: def form_eoms(self, method=KanesMethod):
      """Method to form system's equation of motions.
  
      Parameters
      ==========
  
      method : Class
          Class name of method.
  
      Returns
      ========
  
      Matrix
          Vector of equations of motions.
  
      Examples
      ========
  
      This is a simple example for a one degree of freedom translational
      spring-mass-damper.
  
      >>> from sympy import S, symbols
      >>> from sympy.physics.mechanics import LagrangesMethod, dynamicsymbols, Body
      >>> from sympy.physics.mechanics import PrismaticJoint, JointsMethod
      >>> q = dynamicsymbols('q')
      >>> qd = dynamicsymbols('q', 1)
      >>> m, k, b = symbols('m k b')
      >>> wall = Body('W')
      >>> part = Body('P', mass=m)
      >>> part.potential_energy = k * q**2 / S(2)
      >>> J = PrismaticJoint('J', wall, part, coordinates=q, speeds=qd)
      >>> wall.apply_force(b * qd * wall.x, reaction_body=part)
      >>> method = JointsMethod(wall, J)
      >>> method.form_eoms(LagrangesMethod)
      Matrix([[b*Derivative(q(t), t) + k*q(t) + m*Derivative(q(t), (t, 2))]])
  
      We can also solve for the states using the 'rhs' method.
  
      >>> method.rhs()
      Matrix([
      [                Derivative(q(t), t)],
      [(-b*Derivative(q(t), t) - k*q(t))/m]])
  
      """
  
      bodylist = self._convert_bodies()
      if issubclass(
          method, LagrangesMethod
      ):  # LagrangesMethod or similar
          L = Lagrangian(self.frame, *bodylist)
          self._method = method(
              L, self.q, self.loads, bodylist, self.frame
          )
      else:  # KanesMethod or similar
          self._method = method(
              self.frame,
              q_ind=self.q,
              u_ind=self.u,
              kd_eqs=self.kdes,
              forcelist=self.loads,
              bodies=bodylist,
          )
      soln = self.method._form_eoms()
      return soln
  
imports: from sympy.physics.mechanics import Body, Lagrangian, KanesMethod, LagrangesMethod, RigidBody, Particle
  from sympy.physics.mechanics.body_base import BodyBase
  from sympy.physics.mechanics.method import _Methods
  from sympy import Matrix
label_desc: Use image node_id 18 for calling the JointsMethod obj's underlying member method code with example usage: obj.form_eoms(method) and returns: soln