unittest/python/crocoddyl/state.py
def Jintegrate(self, x, dx, firstsecond='both'):
        """ Compute the partial derivatives for integrate operator using NumDiff.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        """
        assert (firstsecond in ['first', 'second', 'both'])
        if firstsecond == 'both':
            return [self.Jintegrate(x, dx, 'first'), self.Jintegrate(x, dx, 'second')]
        Dx = np.zeros(self.ndx)
        h = self.disturbance
        J = np.zeros([self.ndx, self.ndx])
        d0 = self.integrate(x, dx)
        if firstsecond == 'first':
            for k in range(self.ndx):
                Dx[k] = h
                J[:, k] = self.diff(d0, self.integrate(self.integrate(x, Dx), dx))
                Dx[k] = 0
        elif firstsecond == 'second':
            for k in range(self.ndx):
                Dx[k] = h
                J[:, k] = self.diff(d0, self.integrate(x, dx + Dx))
                Dx[k] = 0
        J /= h
        return J
 Compute the partial derivatives for integrate operator using NumDiff.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        
Compute the partial derivatives for integrate operator using NumDiff.
Compute the partial derivatives for integrate operator using NumDiff .
def Jintegrate(self, x, dx, firstsecond='both'):
        assert (firstsecond in ['first', 'second', 'both'])
        if firstsecond == 'both':
            return [self.Jintegrate(x, dx, 'first'), self.Jintegrate(x, dx, 'second')]
        Dx = np.zeros(self.ndx)
        h = self.disturbance
        J = np.zeros([self.ndx, self.ndx])
        d0 = self.integrate(x, dx)
        if firstsecond == 'first':
            for k in range(self.ndx):
                Dx[k] = h
                J[:, k] = self.diff(d0, self.integrate(self.integrate(x, Dx), dx))
                Dx[k] = 0
        elif firstsecond == 'second':
            for k in range(self.ndx):
                Dx[k] = h
                J[:, k] = self.diff(d0, self.integrate(x, dx + Dx))
                Dx[k] = 0
        J /= h
        return J
def Jintegrate ( self , x , dx , firstsecond = 'both' ) : assert ( firstsecond in [ 'first' , 'second' , 'both' ] ) if firstsecond == 'both' : return [ self . Jintegrate ( x , dx , 'first' ) , self . Jintegrate ( x , dx , 'second' ) ] Dx = np . zeros ( self . ndx ) h = self . disturbance J = np . zeros ( [ self . ndx , self . ndx ] ) d0 = self . integrate ( x , dx ) if firstsecond == 'first' : for k in range ( self . ndx ) : Dx [ k ] = h J [ : , k ] = self . diff ( d0 , self . integrate ( self . integrate ( x , Dx ) , dx ) ) Dx [ k ] = 0 elif firstsecond == 'second' : for k in range ( self . ndx ) : Dx [ k ] = h J [ : , k ] = self . diff ( d0 , self . integrate ( x , dx + Dx ) ) Dx [ k ] = 0 J /= h return J
Compute the partial derivatives for integrate operator using NumDiff.
Compute the partial derivatives for integrate operator using NumDiff .
""" Compute the partial derivatives for integrate operator using NumDiff.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        """
self
x
dx
firstsecond