(self, kdeqs)
Supply all the kinematic differential equations in a list.

        They should be in the form [Expr1, Expr2, ...] where Expri is equal to
        zero

        Parameters
        ==========

        kdeqs : list (of Expr)
            The listof kinematic differential equations
Supply all the kinematic differential equations in a list.
Supply all the kinematic differential equations in a list .
def _kindiffeq(self, kdeqs):
        """Supply all the kinematic differential equations in a list.

        They should be in the form [Expr1, Expr2, ...] where Expri is equal to
        zero

        Parameters
        ==========

        kdeqs : list (of Expr)
            The listof kinematic differential equations

        """
        if len(self._q) != len(kdeqs):
            raise ValueError('There must be an equal number of kinematic '
                             'differential equations and coordinates.')

        uaux = self._uaux
        # dictionary of auxiliary speeds which are equal to zero
        uaz = dict(list(zip(uaux, [0] * len(uaux))))

        #kdeqs = Matrix(kdeqs).subs(uaz)
        kdeqs = Matrix(kdeqs)

        qdot = self._qdot
        qdotzero = dict(list(zip(qdot, [0] * len(qdot))))
        u = self._u
        uzero = dict(list(zip(u, [0] * len(u))))

        f_k = kdeqs.subs(uzero).subs(qdotzero)
        k_kqdot = (kdeqs.subs(uzero) - f_k).jacobian(Matrix(qdot))
        k_ku = (kdeqs.subs(qdotzero) - f_k).jacobian(Matrix(u))

        self._k_ku = _mat_inv_mul(k_kqdot, k_ku)
        self._f_k = _mat_inv_mul(k_kqdot, f_k)
        self._k_kqdot = eye(len(qdot))
        self._qdot_u_map = solve_linear_system_LU(Matrix([self._k_kqdot.T,
            -(self._k_ku * Matrix(self._u) + self._f_k).T]).T, self._qdot)

        self._k_ku = _mat_inv_mul(k_kqdot, k_ku).subs(uaz)
        self._f_k = _mat_inv_mul(k_kqdot, f_k).subs(uaz)
def _kindiffeq ( self , kdeqs ) : if len ( self . _q ) != len ( kdeqs ) : raise ValueError ( 'There must be an equal number of kinematic ' 'differential equations and coordinates.' ) uaux = self . _uaux # dictionary of auxiliary speeds which are equal to zero uaz = dict ( list ( zip ( uaux , [ 0 ] * len ( uaux ) ) ) ) #kdeqs = Matrix(kdeqs).subs(uaz) kdeqs = Matrix ( kdeqs ) qdot = self . _qdot qdotzero = dict ( list ( zip ( qdot , [ 0 ] * len ( qdot ) ) ) ) u = self . _u uzero = dict ( list ( zip ( u , [ 0 ] * len ( u ) ) ) ) f_k = kdeqs . subs ( uzero ) . subs ( qdotzero ) k_kqdot = ( kdeqs . subs ( uzero ) - f_k ) . jacobian ( Matrix ( qdot ) ) k_ku = ( kdeqs . subs ( qdotzero ) - f_k ) . jacobian ( Matrix ( u ) ) self . _k_ku = _mat_inv_mul ( k_kqdot , k_ku ) self . _f_k = _mat_inv_mul ( k_kqdot , f_k ) self . _k_kqdot = eye ( len ( qdot ) ) self . _qdot_u_map = solve_linear_system_LU ( Matrix ( [ self . _k_kqdot . T , - ( self . _k_ku * Matrix ( self . _u ) + self . _f_k ) . T ] ) . T , self . _qdot ) self . _k_ku = _mat_inv_mul ( k_kqdot , k_ku ) . subs ( uaz ) self . _f_k = _mat_inv_mul ( k_kqdot , f_k ) . subs ( uaz )