'Method to form Kane\'s equations, Fr + Fr* = 0.
Returns (Fr, Fr*). In the case where auxiliary generalized speeds are
present (say, s auxiliary speeds, o generalized speeds, and m motion
constraints) the length of the returned vectors will be o - m + s in
length. The first o - m equations will be the constrained Kane\'s
equations, then the s auxiliary Kane\'s equations. These auxiliary
equations can be accessed with the auxiliary_eqs().
Parameters
bodies : iterable
An iterable of all RigidBody\'s and Particle\'s in the system.
A system must have at least one body.
loads : iterable
Takes in an iterable of (Particle, Vector) or (ReferenceFrame, Vector)
tuples which represent the force at a point or torque on a frame.
Must be either a non-empty iterable of tuples or None which corresponds
to a system with no constraints.'

def kanes_equations(self, bodies, loads=None):

    if (((bodies is None) and (loads != None)) or isinstance(bodies[0], tuple)):
        (bodies, loads) = (loads, bodies)
        SymPyDeprecationWarning(value='The    API    for    kanes_equations()    has    changed    such    that    the    loads    (forces    and    torques)    are    now    the    second    argument    and    is    optional    with    None    being    the    default.', feature='The    kanes_equation()    argument    order', useinstead='switched    argument    order    to    update    your    code,    For    example:    kanes_equations(loads,    bodies)    >    kanes_equations(bodies,    loads).', issue=10945, deprecated_since_version='1.1').warn()
    if (not self._k_kqdot):
        raise AttributeError('Create    an    instance    of    KanesMethod    with    kinematic    differential    equations    to    use    this    method.')
    fr = self._form_fr(loads)
    frstar = self._form_frstar(bodies)
    if self._uaux:
        if (not self._udep):
            km = KanesMethod(self._inertial, self.q, self._uaux, u_auxiliary=self._uaux)
        else:
            km = KanesMethod(self._inertial, self.q, self._uaux, u_auxiliary=self._uaux, u_dependent=self._udep, velocity_constraints=((self._k_nh * self.u) + self._f_nh))
        km._qdot_u_map = self._qdot_u_map
        self._km = km
        fraux = km._form_fr(loads)
        frstaraux = km._form_frstar(bodies)
        self._aux_eq = (fraux + frstaraux)
        self._fr = fr.col_join(fraux)
        self._frstar = frstar.col_join(frstaraux)
    return (self._fr, self._frstar)
