

def test_simple_array_comp_SLSQP_scaler_unity_eq(self):
    prob = Problem()
    root = prob.root = Group()
    root.add('p1', IndepVarComp('x', np.zeros([2])), promotes=['*'])
    root.add('comp', SimpleArrayComp(), promotes=['*'])
    root.add('con', ExecComp('c = y - 20.0', c=np.array([0.0, 0.0]), y=np.array([0.0, 0.0])), promotes=['*'])
    root.add('obj', ExecComp('o = y[0]', y=np.array([0.0, 0.0])), promotes=['*'])
    root.driver = ScipyOptimizer()
    prob.driver.options['optimizer'] = 'SLSQP'
    prob.driver.add_desvar('x', lower=(- 50.0), upper=50.0, scaler=np.array([1.0, 1.0]))
    prob.driver.add_objective('o', scaler=np.array([1.0, 1.0]))
    prob.driver.add_constraint('c', equals=0.0, scaler=np.array([1.0, 1.0]))
    prob.driver.options['disp'] = False
    prob.setup(check=False)
    prob.run()
    obj = prob['o']
    assert_rel_error(self, obj, 20.0, 1e-06)

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/drivers/test/test_scipy_optimizer.py TestScipyOptimize.test_simple_array_comp_SLSQP_scaler_unity_eq/VarMisuse@145/203 `prob`->`root`