class_docstr: Lagrange's method object.
  
  Explanation
  ===========
  
  This object generates the equations of motion in a two step procedure. The
  first step involves the initialization of LagrangesMethod by supplying the
  Lagrangian and the generalized coordinates, at the bare minimum. If there
  are any constraint equations, they can be supplied as keyword arguments.
  The Lagrange multipliers are automatically generated and are equal in
  number to the constraint equations. Similarly any non-conservative forces
  can be supplied in an iterable (as described below and also shown in the
  example) along with a ReferenceFrame. This is also discussed further in the
  __init__ method.
  
  Attributes
  ==========
  
  q, u : Matrix
      Matrices of the generalized coordinates and speeds
  loads : iterable
      Iterable of (Point, vector) or (ReferenceFrame, vector) tuples
      describing the forces on the system.
  bodies : iterable
      Iterable containing the rigid bodies and particles of the system.
  mass_matrix : Matrix
      The system's mass matrix
  forcing : Matrix
      The system's forcing vector
  mass_matrix_full : Matrix
      The "mass matrix" for the qdot's, qdoubledot's, and the
      lagrange multipliers (lam)
  forcing_full : Matrix
      The forcing vector for the qdot's, qdoubledot's and
      lagrange multipliers (lam)
  
  Examples
  ========
  
  This is a simple example for a one degree of freedom translational
  spring-mass-damper.
  
  In this example, we first need to do the kinematics.
  This involves creating generalized coordinates and their derivatives.
  Then we create a point and set its velocity in a frame.
  
      >>> from sympy.physics.mechanics import LagrangesMethod, Lagrangian
      >>> from sympy.physics.mechanics import ReferenceFrame, Particle, Point
      >>> from sympy.physics.mechanics import dynamicsymbols
      >>> from sympy import symbols
      >>> q = dynamicsymbols('q')
      >>> qd = dynamicsymbols('q', 1)
      >>> m, k, b = symbols('m k b')
      >>> N = ReferenceFrame('N')
      >>> P = Point('P')
      >>> P.set_vel(N, qd * N.x)
  
  We need to then prepare the information as required by LagrangesMethod to
  generate equations of motion.
  First we create the Particle, which has a point attached to it.
  Following this the lagrangian is created from the kinetic and potential
  energies.
  Then, an iterable of nonconservative forces/torques must be constructed,
  where each item is a (Point, Vector) or (ReferenceFrame, Vector) tuple,
  with the Vectors representing the nonconservative forces or torques.
  
      >>> Pa = Particle('Pa', P, m)
      >>> Pa.potential_energy = k * q**2 / 2.0
      >>> L = Lagrangian(N, Pa)
      >>> fl = [(P, -b * qd * N.x)]
  
  Finally we can generate the equations of motion.
  First we create the LagrangesMethod object. To do this one must supply
  the Lagrangian, and the generalized coordinates. The constraint equations,
  the forcelist, and the inertial frame may also be provided, if relevant.
  Next we generate Lagrange's equations of motion, such that:
  Lagrange's equations of motion = 0.
  We have the equations of motion at this point.
  
      >>> l = LagrangesMethod(L, [q], forcelist = fl, frame = N)
      >>> print(l.form_lagranges_equations())
      Matrix([[b*Derivative(q(t), t) + 1.0*k*q(t) + m*Derivative(q(t), (t, 2))]])
  
  We can also solve for the states using the 'rhs' method.
  
      >>> print(l.rhs())
      Matrix([[Derivative(q(t), t)], [(-b*Derivative(q(t), t) - 1.0*k*q(t))/m]])
  
  Please refer to the docstrings on each method for more details.
docstr: Supply the following for the initialization of LagrangesMethod.
  
  Lagrangian : Sympifyable
  
  qs : array_like
      The generalized coordinates
  
  hol_coneqs : array_like, optional
      The holonomic constraint equations
  
  nonhol_coneqs : array_like, optional
      The nonholonomic constraint equations
  
  forcelist : iterable, optional
      Takes an iterable of (Point, Vector) or (ReferenceFrame, Vector)
      tuples which represent the force at a point or torque on a frame.
      This feature is primarily to account for the nonconservative forces
      and/or moments.
  
  bodies : iterable, optional
      Takes an iterable containing the rigid bodies and particles of the
      system.
  
  frame : ReferenceFrame, optional
      Supply the inertial frame. This is used to determine the
      generalized forces due to non-conservative forces.
docstr_tok: ["Supply","the","following","for","the","initialization","of","LagrangesMethod",".","Lagrangian",":","Sympifyable","qs",":","array_like","The","generalized","coordinates","hol_coneqs",":","array_like",",","optional","The","holonomic","constraint","equations","nonhol_coneqs",":","array_like",",","optional","The","nonholonomic","constraint","equations","forcelist",":","iterable",",","optional","Takes","an","iterable","of","(","Point",",","Vector",")","or","(","ReferenceFrame",",","Vector",")","tuples","which","represent","the","force","at","a","point","or","torque","on","a","frame",".","This","feature","is","primarily","to","account","for","the","nonconservative","forces","and\/or","moments",".","bodies",":","iterable",",","optional","Takes","an","iterable","containing","the","rigid","bodies","and","particles","of","the","system",".","frame",":","ReferenceFrame",",","optional","Supply","the","inertial","frame",".","This","is","used","to","determine","the","generalized","forces","due","to","non-conservative","forces","."]
code: def __init__(
      self,
      Lagrangian,
      qs,
      forcelist=None,
      bodies=None,
      frame=None,
      hol_coneqs=None,
      nonhol_coneqs=None,
  ):
      """Supply the following for the initialization of LagrangesMethod.
  
      Lagrangian : Sympifyable
  
      qs : array_like
          The generalized coordinates
  
      hol_coneqs : array_like, optional
          The holonomic constraint equations
  
      nonhol_coneqs : array_like, optional
          The nonholonomic constraint equations
  
      forcelist : iterable, optional
          Takes an iterable of (Point, Vector) or (ReferenceFrame, Vector)
          tuples which represent the force at a point or torque on a frame.
          This feature is primarily to account for the nonconservative forces
          and/or moments.
  
      bodies : iterable, optional
          Takes an iterable containing the rigid bodies and particles of the
          system.
  
      frame : ReferenceFrame, optional
          Supply the inertial frame. This is used to determine the
          generalized forces due to non-conservative forces.
      """
  
      self._L = Matrix([sympify(Lagrangian)])
      self.eom = None
      self._m_cd = Matrix()  # Mass Matrix of differentiated coneqs
      self._m_d = Matrix()  # Mass Matrix of dynamic equations
      self._f_cd = Matrix()  # Forcing part of the diff coneqs
      self._f_d = Matrix()  # Forcing part of the dynamic equations
      self.lam_coeffs = Matrix()  # The coeffecients of the multipliers
  
      forcelist = forcelist if forcelist else []
      if not iterable(forcelist):
          raise TypeError(
              "Force pairs must be supplied in an iterable."
          )
      self._forcelist = forcelist
      if frame and not isinstance(frame, ReferenceFrame):
          raise TypeError("frame must be a valid ReferenceFrame")
      self._bodies = bodies
      self.inertial = frame
  
      self.lam_vec = Matrix()
  
      self._term1 = Matrix()
      self._term2 = Matrix()
      self._term3 = Matrix()
      self._term4 = Matrix()
  
      # Creating the qs, qdots and qdoubledots
      if not iterable(qs):
          raise TypeError("Generalized coordinates must be an iterable")
      self._q = Matrix(qs)
      self._qdots = self.q.diff(dynamicsymbols._t)
      self._qdoubledots = self._qdots.diff(dynamicsymbols._t)
      _validate_coordinates(self.q)
  
      mat_build = lambda x: Matrix(x) if x else Matrix()
      hol_coneqs = mat_build(hol_coneqs)
      nonhol_coneqs = mat_build(nonhol_coneqs)
      self.coneqs = Matrix(
          [hol_coneqs.diff(dynamicsymbols._t), nonhol_coneqs]
      )
      self._hol_coneqs = hol_coneqs
  
imports: from sympy import diff, zeros, Matrix, eye, sympify
  from sympy.core.sorting import default_sort_key
  from sympy.physics.vector import dynamicsymbols, ReferenceFrame
  from sympy.physics.mechanics.method import _Methods
  from sympy.physics.mechanics.functions import find_dynamicsymbols, msubs, _f_list_parser, _validate_coordinates
  from sympy.physics.mechanics.linearize import Linearizer
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 1 to create a new LagrangesMethod object from inherited base classes: _Methods with example: obj = LagrangesMethod(Lagrangian, qs, forcelist, bodies, frame, hol_coneqs, nonhol_coneqs)