def linearize(self, params, unknowns, resids):
        """Analytical derivatives"""
        J = {}

        x = params['x']

        J[('f', 'x')] = np.array([
            [2*x[0]-5, 2*x[1]-5, 4*x[2]-21, 2*x[3]+7]
        ])

        J[('g', 'x')] = np.array([
            [2*x[0]+1, 2*x[1]-1, 2*x[2]+1, 2*x[3]-1],
            [2*x[0]-1, 4*x[1],   2*x[2],   4*x[3]-1],
            [4*x[0]+2, 2*x[1]-1, 2*x[2],   -1],
        ])

        return J
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/test/simple_comps.py/RosenSuzuki.linearize/original