

def test_Sellar_state_SLSQP(self):
    prob = Problem()
    prob.root = SellarStateConnection()
    prob.driver = ScipyOptimizer()
    prob.driver.options['optimizer'] = 'SLSQP'
    prob.driver.options['tol'] = 1e-08
    prob.driver.add_desvar('z', lower=np.array([(- 10.0), 0.0]), upper=np.array([10.0, 10.0]))
    prob.driver.add_desvar('x', lower=0.0, upper=10.0)
    prob.driver.add_objective('obj')
    prob.driver.add_constraint('con1', upper=0.0)
    prob.driver.add_constraint('con2', upper=0.0)
    prob.driver.options['disp'] = False
    prob.setup(check=False)
    prob.run()
    assert_rel_error(self, prob['z'][0], 1.9776, 0.001)
    assert_rel_error(self, self['z'][1], 0.0, 0.001)
    assert_rel_error(self, prob['x'], 0.0, 0.001)

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/drivers/test/test_scipy_optimizer.py TestScipyOptimize.test_Sellar_state_SLSQP/VarMisuse@191/240 `prob`->`self`