(self)
return sysd.A, sysd.B
Return the linearized system.

        Returns
        -------
        a : ndarray
            The state matrix.
        b : ndarray
            The action matrix.
Return the linearized system.
Return the linearized system .
def linearize(self):
        """Return the linearized system.

        Returns
        -------
        a : ndarray
            The state matrix.
        b : ndarray
            The action matrix.

        """
        gravity = self.gravity
        length = self.length
        friction = self.friction
        inertia = self.inertia

        A = np.array([[0, 1],
                      [gravity / length, -friction / inertia]],
                     dtype=config.np_dtype)

        B = np.array([[0],
                      [1 / inertia]],
                     dtype=config.np_dtype)

        if self.normalization is not None:
            Tx, Tu = map(np.diag, self.normalization)
            Tx_inv, Tu_inv = map(np.diag, self.inv_norm)

            A = np.linalg.multi_dot((Tx_inv, A, Tx))
            B = np.linalg.multi_dot((Tx_inv, B, Tu))

        sys = signal.StateSpace(A, B, np.eye(2), np.zeros((2, 1)))
        sysd = sys.to_discrete(self.dt)
        return sysd.A, sysd.B
def linearize ( self ) : gravity = self . gravity length = self . length friction = self . friction inertia = self . inertia A = np . array ( [ [ 0 , 1 ] , [ gravity / length , - friction / inertia ] ] , dtype = config . np_dtype ) B = np . array ( [ [ 0 ] , [ 1 / inertia ] ] , dtype = config . np_dtype ) if self . normalization is not None : Tx , Tu = map ( np . diag , self . normalization ) Tx_inv , Tu_inv = map ( np . diag , self . inv_norm ) A = np . linalg . multi_dot ( ( Tx_inv , A , Tx ) ) B = np . linalg . multi_dot ( ( Tx_inv , B , Tu ) ) sys = signal . StateSpace ( A , B , np . eye ( 2 ) , np . zeros ( ( 2 , 1 ) ) ) sysd = sys . to_discrete ( self . dt ) return sysd . A , sysd . B