def create_matrices(self, extra_g=None, extra_h=None):
        """ Initialize the augmented stoichiometric matrix.

        extra_g: (n x nr) array
            Extra entries in the constraint matrix. postive values for lower
            bounds, negative values for upper bounds
        extra_h: (n) array
            Corresponding bounds for the extra entries matrix

        """

        # Create stoichiometric matrix, get key dimensions
        N = cobra.util.create_stoichiometric_matrix(self.model)
        nm, nr = N.shape
        self.nm = nm
        self.nr = nr

        # Construct full G and h matrices, then drop homogeneous (or near
        # homogeneous) entries
        g_full = np.vstack([np.eye(nr), -np.eye(nr)])
        h_full = np.array([(r.lower_bound, -r.upper_bound)
                           for r in self.model.reactions]).T.flatten()

        inhomogeneous = ~((h_full <= -1000) | np.isclose(h_full, 0))
        h_full = h_full[inhomogeneous]
        g_full = g_full[inhomogeneous]

        if extra_g is not None:
            assert extra_g.shape[1] == nr
            assert extra_g.shape[0] == len(extra_h)

            g_full = np.vstack([g_full, extra_g])
            h_full = np.hstack([h_full, extra_h])

        G = g_full
        h = h_full

        self.nt = nt = len(h)

        self.D = np.vstack([
            np.hstack([N, np.zeros((nm, nt)), np.zeros((nm, 1))]),
            np.hstack([G, -np.eye(nt), np.atleast_2d(-h).T])
        ])