class_docstr: Kane's method object.
  
  Explanation
  ===========
  
  This object is used to do the "book-keeping" as you go through and form
  equations of motion in the way Kane presents in:
  Kane, T., Levinson, D. Dynamics Theory and Applications. 1985 McGraw-Hill
  
  The attributes are for equations in the form [M] udot = forcing.
  
  Attributes
  ==========
  
  q, u : Matrix
      Matrices of the generalized coordinates and speeds
  bodies : iterable
      Iterable of Particle and RigidBody objects in the system.
  loads : iterable
      Iterable of (Point, vector) or (ReferenceFrame, vector) tuples
      describing the forces on the system.
  auxiliary_eqs : Matrix
      If applicable, the set of auxiliary Kane's
      equations used to solve for non-contributing
      forces.
  mass_matrix : Matrix
      The system's dynamics mass matrix: [k_d; k_dnh]
  forcing : Matrix
      The system's dynamics forcing vector: -[f_d; f_dnh]
  mass_matrix_kin : Matrix
      The "mass matrix" for kinematic differential equations: k_kqdot
  forcing_kin : Matrix
      The forcing vector for kinematic differential equations: -(k_ku*u + f_k)
  mass_matrix_full : Matrix
      The "mass matrix" for the u's and q's with dynamics and kinematics
  forcing_full : Matrix
      The "forcing vector" for the u's and q's with dynamics and kinematics
  
  Parameters
  ==========
  
  frame : ReferenceFrame
      The inertial reference frame for the system.
  q_ind : iterable of dynamicsymbols
      Independent generalized coordinates.
  u_ind : iterable of dynamicsymbols
      Independent generalized speeds.
  kd_eqs : iterable of Expr, optional
      Kinematic differential equations, which linearly relate the generalized
      speeds to the time-derivatives of the generalized coordinates.
  q_dependent : iterable of dynamicsymbols, optional
      Dependent generalized coordinates.
  configuration_constraints : iterable of Expr, optional
      Constraints on the system's configuration, i.e. holonomic constraints.
  u_dependent : iterable of dynamicsymbols, optional
      Dependent generalized speeds.
  velocity_constraints : iterable of Expr, optional
      Constraints on the system's velocity, i.e. the combination of the
      nonholonomic constraints and the time-derivative of the holonomic
      constraints.
  acceleration_constraints : iterable of Expr, optional
      Constraints on the system's acceleration, by default these are the
      time-derivative of the velocity constraints.
  u_auxiliary : iterable of dynamicsymbols, optional
      Auxiliary generalized speeds.
  bodies : iterable of Particle and/or RigidBody, optional
      The particles and rigid bodies in the system.
  forcelist : iterable of tuple[Point | ReferenceFrame, Vector], optional
      Forces and torques applied on the system.
  explicit_kinematics : bool
      Boolean whether the mass matrices and forcing vectors should use the
      explicit form (default) or implicit form for kinematics.
      See the notes for more details.
  kd_eqs_solver : str, callable
      Method used to solve the kinematic differential equations. If a string
      is supplied, it should be a valid method that can be used with the
      :meth:`sympy.matrices.matrixbase.MatrixBase.solve`. If a callable is
      supplied, it should have the format ``f(A, rhs)``, where it solves the
      equations and returns the solution. The default utilizes LU solve. See
      the notes for more information.
  constraint_solver : str, callable
      Method used to solve the velocity constraints. If a string is
      supplied, it should be a valid method that can be used with the
      :meth:`sympy.matrices.matrixbase.MatrixBase.solve`. If a callable is
      supplied, it should have the format ``f(A, rhs)``, where it solves the
      equations and returns the solution. The default utilizes LU solve. See
      the notes for more information.
  
  Notes
  =====
  
  The mass matrices and forcing vectors related to kinematic equations
  are given in the explicit form by default. In other words, the kinematic
  mass matrix is $\mathbf{k_{k\dot{q}}} = \mathbf{I}$.
  In order to get the implicit form of those matrices/vectors, you can set the
  ``explicit_kinematics`` attribute to ``False``. So $\mathbf{k_{k\dot{q}}}$
  is not necessarily an identity matrix. This can provide more compact
  equations for non-simple kinematics.
  
  Two linear solvers can be supplied to ``KanesMethod``: one for solving the
  kinematic differential equations and one to solve the velocity constraints.
  Both of these sets of equations can be expressed as a linear system ``Ax = rhs``,
  which have to be solved in order to obtain the equations of motion.
  
  The default solver ``'LU'``, which stands for LU solve, results relatively low
  number of operations. The weakness of this method is that it can result in zero
  division errors.
  
  If zero divisions are encountered, a possible solver which may solve the problem
  is ``"CRAMER"``. This method uses Cramer's rule to solve the system. This method
  is slower and results in more operations than the default solver. However it only
  uses a single division by default per entry of the solution.
  
  While a valid list of solvers can be found at
  :meth:`sympy.matrices.matrixbase.MatrixBase.solve`, it is also possible to supply a
  `callable`. This way it is possible to use a different solver routine. If the
  kinematic differential equations are not too complex it can be worth it to simplify
  the solution by using ``lambda A, b: simplify(Matrix.LUsolve(A, b))``. Another
  option solver one may use is :func:`sympy.solvers.solveset.linsolve`. This can be
  done using `lambda A, b: tuple(linsolve((A, b)))[0]`, where we select the first
  solution as our system should have only one unique solution.
  
  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 speeds and coordinates and their
  derivatives.
  Then we create a point and set its velocity in a frame.
  
      >>> from sympy import symbols
      >>> from sympy.physics.mechanics import dynamicsymbols, ReferenceFrame
      >>> from sympy.physics.mechanics import Point, Particle, KanesMethod
      >>> q, u = dynamicsymbols('q u')
      >>> qd, ud = dynamicsymbols('q u', 1)
      >>> m, c, k = symbols('m c k')
      >>> N = ReferenceFrame('N')
      >>> P = Point('P')
      >>> P.set_vel(N, u * N.x)
  
  Next we need to arrange/store information in the way that KanesMethod
  requires.  The kinematic differential equations need to be stored in a
  dict.  A list of forces/torques must be constructed, where each entry in
  the list is a (Point, Vector) or (ReferenceFrame, Vector) tuple, where the
  Vectors represent the Force or Torque.
  Next a particle needs to be created, and it needs to have a point and mass
  assigned to it.
  Finally, a list of all bodies and particles needs to be created.
  
      >>> kd = [qd - u]
      >>> FL = [(P, (-k * q - c * u) * N.x)]
      >>> pa = Particle('pa', P, m)
      >>> BL = [pa]
  
  Finally we can generate the equations of motion.
  First we create the KanesMethod object and supply an inertial frame,
  coordinates, generalized speeds, and the kinematic differential equations.
  Additional quantities such as configuration and motion constraints,
  dependent coordinates and speeds, and auxiliary speeds are also supplied
  here (see the online documentation).
  Next we form FR* and FR to complete: Fr + Fr* = 0.
  We have the equations of motion at this point.
  It makes sense to rearrange them though, so we calculate the mass matrix and
  the forcing terms, for E.o.M. in the form: [MM] udot = forcing, where MM is
  the mass matrix, udot is a vector of the time derivatives of the
  generalized speeds, and forcing is a vector representing "forcing" terms.
  
      >>> KM = KanesMethod(N, q_ind=[q], u_ind=[u], kd_eqs=kd)
      >>> (fr, frstar) = KM.kanes_equations(BL, FL)
      >>> MM = KM.mass_matrix
      >>> forcing = KM.forcing
      >>> rhs = MM.inv() * forcing
      >>> rhs
      Matrix([[(-c*u(t) - k*q(t))/m]])
      >>> KM.linearize(A_and_B=True)[0]
      Matrix([
      [   0,    1],
      [-k/m, -c/m]])
  
  Please look at the documentation pages for more information on how to
  perform linearization and how to deal with dependent coordinates & speeds,
  and how do deal with bringing non-contributing forces into evidence.
class_docstr_tok: ["Kane","'s","method","object",".","Explanation","===========","This","object","is","used","to","do","the","``","book-keeping","''","as","you","go","through","and","form","equations","of","motion","in","the","way","Kane","presents","in",":","Kane",",","T.",",","Levinson",",","D.","Dynamics","Theory","and","Applications",".","1985","McGraw-Hill","The","attributes","are","for","equations","in","the","form","[","M","]","udot","=","forcing",".","Attributes","==========","q",",","u",":","Matrix","Matrices","of","the","generalized","coordinates","and","speeds","bodies",":","iterable","Iterable","of","Particle","and","RigidBody","objects","in","the","system",".","loads",":","iterable","Iterable","of","(","Point",",","vector",")","or","(","ReferenceFrame",",","vector",")","tuples","describing","the","forces","on","the","system",".","auxiliary_eqs",":","Matrix","If","applicable",",","the","set","of","auxiliary","Kane's","equations","used","to","solve","for","non-contributing","forces",".","mass_matrix",":","Matrix","The","system","'s","dynamics","mass","matrix",":","[","k_d",";","k_dnh","]","forcing",":","Matrix","The","system","'s","dynamics","forcing","vector",":","-","[","f_d",";","f_dnh","]","mass_matrix_kin",":","Matrix","The","``","mass","matrix","''","for","kinematic","differential","equations",":","k_kqdot","forcing_kin",":","Matrix","The","forcing","vector","for","kinematic","differential","equations",":","-","(","k_ku","*","u","+","f_k",")","mass_matrix_full",":","Matrix","The","``","mass","matrix","''","for","the","u","'s","and","q","'s","with","dynamics","and","kinematics","forcing_full",":","Matrix","The","``","forcing","vector","''","for","the","u","'s","and","q","'s","with","dynamics","and","kinematics","Parameters","==========","frame",":","ReferenceFrame","The","inertial","reference","frame","for","the","system",".","q_ind",":","iterable","of","dynamicsymbols","Independent","generalized","coordinates",".","u_ind",":","iterable","of","dynamicsymbols","Independent","generalized","speeds",".","kd_eqs",":","iterable","of","Expr",",","optional","Kinematic","differential","equations",",","which","linearly","relate","the","generalized","speeds","to","the","time-derivatives","of","the","generalized","coordinates",".","q_dependent",":","iterable","of","dynamicsymbols",",","optional","Dependent","generalized","coordinates",".","configuration_constraints",":","iterable","of","Expr",",","optional","Constraints","on","the","system","'s","configuration",",","i.e",".","holonomic","constraints",".","u_dependent",":","iterable","of","dynamicsymbols",",","optional","Dependent","generalized","speeds",".","velocity_constraints",":","iterable","of","Expr",",","optional","Constraints","on","the","system","'s","velocity",",","i.e",".","the","combination","of","the","nonholonomic","constraints","and","the","time-derivative","of","the","holonomic","constraints",".","acceleration_constraints",":","iterable","of","Expr",",","optional","Constraints","on","the","system","'s","acceleration",",","by","default","these","are","the","time-derivative","of","the","velocity","constraints",".","u_auxiliary",":","iterable","of","dynamicsymbols",",","optional","Auxiliary","generalized","speeds",".","bodies",":","iterable","of","Particle","and\/or","RigidBody",",","optional","The","particles","and","rigid","bodies","in","the","system",".","forcelist",":","iterable","of","tuple","[","Point","|","ReferenceFrame",",","Vector","]",",","optional","Forces","and","torques","applied","on","the","system",".","explicit_kinematics",":","bool","Boolean","whether","the","mass","matrices","and","forcing","vectors","should","use","the","explicit","form","(","default",")","or","implicit","form","for","kinematics",".","See","the","notes","for","more","details",".","kd_eqs_solver",":","str",",","callable","Method","used","to","solve","the","kinematic","differential","equations",".","If","a","string","is","supplied",",","it","should","be","a","valid","method","that","can","be","used","with","the",":","meth",":","`","sympy.matrices.matrixbase.MatrixBase.solve","`",".","If","a","callable","is","supplied",",","it","should","have","the","format","``","f","(","A",",","rhs",")","``",",","where","it","solves","the","equations","and","returns","the","solution",".","The","default","utilizes","LU","solve",".","See","the","notes","for","more","information",".","constraint_solver",":","str",",","callable","Method","used","to","solve","the","velocity","constraints",".","If","a","string","is","supplied",",","it","should","be","a","valid","method","that","can","be","used","with","the",":","meth",":","`","sympy.matrices.matrixbase.MatrixBase.solve","`",".","If","a","callable","is","supplied",",","it","should","have","the","format","``","f","(","A",",","rhs",")","``",",","where","it","solves","the","equations","and","returns","the","solution",".","The","default","utilizes","LU","solve",".","See","the","notes","for","more","information",".","Notes","=====","The","mass","matrices","and","forcing","vectors","related","to","kinematic","equations","are","given","in","the","explicit","form","by","default",".","In","other","words",",","the","kinematic","mass","matrix","is","$","\\mathbf","{","k_","{","k\\dot","{","q","}","}","}","=","\\mathbf","{","I","}","$",".","In","order","to","get","the","implicit","form","of","those","matrices\/vectors",",","you","can","set","the","``","explicit_kinematics","``","attribute","to","``","False","``",".","So","$","\\mathbf","{","k_","{","k\\dot","{","q","}","}","}","$","is","not","necessarily","an","identity","matrix",".","This","can","provide","more","compact","equations","for","non-simple","kinematics",".","Two","linear","solvers","can","be","supplied","to","``","KanesMethod","``",":","one","for","solving","the","kinematic","differential","equations","and","one","to","solve","the","velocity","constraints",".","Both","of","these","sets","of","equations","can","be","expressed","as","a","linear","system","``","Ax","=","rhs","``",",","which","have","to","be","solved","in","order","to","obtain","the","equations","of","motion",".","The","default","solver","``","'LU","'","``",",","which","stands","for","LU","solve",",","results","relatively","low","number","of","operations",".","The","weakness","of","this","method","is","that","it","can","result","in","zero","division","errors",".","If","zero","divisions","are","encountered",",","a","possible","solver","which","may","solve","the","problem","is","``","``","CRAMER","''","``",".","This","method","uses","Cramer","'s","rule","to","solve","the","system",".","This","method","is","slower","and","results","in","more","operations","than","the","default","solver",".","However","it","only","uses","a","single","division","by","default","per","entry","of","the","solution",".","While","a","valid","list","of","solvers","can","be","found","at",":","meth",":","`","sympy.matrices.matrixbase.MatrixBase.solve","`",",","it","is","also","possible","to","supply","a","`","callable","`",".","This","way","it","is","possible","to","use","a","different","solver","routine",".","If","the","kinematic","differential","equations","are","not","too","complex","it","can","be","worth","it","to","simplify","the","solution","by","using","``","lambda","A",",","b",":","simplify","(","Matrix.LUsolve","(","A",",","b",")",")","``",".","Another","option","solver","one","may","use","is",":","func",":","`","sympy.solvers.solveset.linsolve","`",".","This","can","be","done","using","`","lambda","A",",","b",":","tuple","(","linsolve","(","(","A",",","b",")",")",")","[","0","]","`",",","where","we","select","the","first","solution","as","our","system","should","have","only","one","unique","solution",".","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","speeds","and","coordinates","and","their","derivatives",".","Then","we","create","a","point","and","set","its","velocity","in","a","frame",".",">",">",">","from","sympy","import","symbols",">",">",">","from","sympy.physics.mechanics","import","dynamicsymbols",",","ReferenceFrame",">",">",">","from","sympy.physics.mechanics","import","Point",",","Particle",",","KanesMethod",">",">",">","q",",","u","=","dynamicsymbols","(","'","q","u","'",")",">",">",">","qd",",","ud","=","dynamicsymbols","(","'","q","u","'",",","1",")",">",">",">","m",",","c",",","k","=","symbols","(","'m","c","k","'",")",">",">",">","N","=","ReferenceFrame","(","'N","'",")",">",">",">","P","=","Point","(","'","P","'",")",">",">",">","P.set_vel","(","N",",","u","*","N.x",")","Next","we","need","to","arrange\/store","information","in","the","way","that","KanesMethod","requires",".","The","kinematic","differential","equations","need","to","be","stored","in","a","dict",".","A","list","of","forces\/torques","must","be","constructed",",","where","each","entry","in","the","list","is","a","(","Point",",","Vector",")","or","(","ReferenceFrame",",","Vector",")","tuple",",","where","the","Vectors","represent","the","Force","or","Torque",".","Next","a","particle","needs","to","be","created",",","and","it","needs","to","have","a","point","and","mass","assigned","to","it",".","Finally",",","a","list","of","all","bodies","and","particles","needs","to","be","created",".",">",">",">","kd","=","[","qd","-","u","]",">",">",">","FL","=","[","(","P",",","(","-k","*","q","-","c","*","u",")","*","N.x",")","]",">",">",">","pa","=","Particle","(","'pa","'",",","P",",","m",")",">",">",">","BL","=","[","pa","]","Finally","we","can","generate","the","equations","of","motion",".","First","we","create","the","KanesMethod","object","and","supply","an","inertial","frame",",","coordinates",",","generalized","speeds",",","and","the","kinematic","differential","equations",".","Additional","quantities","such","as","configuration","and","motion","constraints",",","dependent","coordinates","and","speeds",",","and","auxiliary","speeds","are","also","supplied","here","(","see","the","online","documentation",")",".","Next","we","form","FR","*","and","FR","to","complete",":","Fr","+","Fr","*","=","0",".","We","have","the","equations","of","motion","at","this","point",".","It","makes","sense","to","rearrange","them","though",",","so","we","calculate","the","mass","matrix","and","the","forcing","terms",",","for","E.o.M",".","in","the","form",":","[","MM","]","udot","=","forcing",",","where","MM","is","the","mass","matrix",",","udot","is","a","vector","of","the","time","derivatives","of","the","generalized","speeds",",","and","forcing","is","a","vector","representing","``","forcing","''","terms",".",">",">",">","KM","=","KanesMethod","(","N",",","q_ind=","[","q","]",",","u_ind=","[","u","]",",","kd_eqs=kd",")",">",">",">","(","fr",",","frstar",")","=","KM.kanes_equations","(","BL",",","FL",")",">",">",">","MM","=","KM.mass_matrix",">",">",">","forcing","=","KM.forcing",">",">",">","rhs","=","MM.inv","(",")","*","forcing",">",">",">","rhs","Matrix","(","[","[","(","-c","*","u","(","t",")","-","k","*","q","(","t",")",")","\/m","]","]",")",">",">",">","KM.linearize","(","A_and_B=True",")","[","0","]","Matrix","(","[","[","0",",","1","]",",","[","-k\/m",",","-c\/m","]","]",")","Please","look","at","the","documentation","pages","for","more","information","on","how","to","perform","linearization","and","how","to","deal","with","dependent","coordinates","&","speeds",",","and","how","do","deal","with","bringing","non-contributing","forces","into","evidence","."]
docstr: The mass matrix of the system, augmented by the kinematic
  differential equations in explicit or implicit form.
docstr_tok: ["The","mass","matrix","of","the","system",",","augmented","by","the","kinematic","differential","equations","in","explicit","or","implicit","form","."]
code: def mass_matrix_full(self):
      """The mass matrix of the system, augmented by the kinematic
      differential equations in explicit or implicit form."""
      if not self._fr or not self._frstar:
          raise ValueError("Need to compute Fr, Fr* first.")
      o, n = len(self.u), len(self.q)
      return (self.mass_matrix_kin.row_join(zeros(n, o))).col_join(
          zeros(o, n).row_join(self.mass_matrix)
      )
  
imports: from sympy import zeros, Matrix, diff, eye
  from sympy.core.sorting import default_sort_key
  from sympy.physics.vector import ReferenceFrame, dynamicsymbols, partial_velocity
  from sympy.physics.mechanics.method import _Methods
  from sympy.physics.mechanics.particle import Particle
  from sympy.physics.mechanics.rigidbody import RigidBody
  from sympy.physics.mechanics.functions import msubs, find_dynamicsymbols, _f_list_parser, _validate_coordinates, _parse_linear_solver
  from sympy.physics.mechanics.linearize import Linearizer
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 18 for calling the KanesMethod obj's underlying member method code with example usage: obj.mass_matrix_full() and returns: self