

def test_fan_out(self):
    prob = Problem()
    root = prob.root = Group()
    root.add('p1', IndepVarComp('x', 1.0))
    root.add('p2', IndepVarComp('x', 1.0))
    root.add('comp1', ExecComp('y = 3.0*x'))
    root.add('comp2', ExecComp('y = 5.0*x'))
    root.add('obj', ExecComp('o = i1 + i2'))
    root.add('con1', ExecComp('c = 15.0 - x'))
    root.add('con2', ExecComp('c = 15.0 - x'))
    root.connect('p1.x', 'comp1.x')
    root.connect('p2.x', 'comp2.x')
    root.connect('comp1.y', 'obj.i1')
    root.connect('comp2.y', 'obj.i2')
    root.connect('comp1.y', 'con1.x')
    root.connect('comp2.y', 'con2.x')
    prob.driver = ScipyOptimizer()
    prob.driver.options['optimizer'] = 'SLSQP'
    prob.driver.add_desvar('p1.x', lower=(- 50.0), upper=50.0)
    prob.driver.add_desvar('p2.x', lower=(- 50.0), upper=50.0)
    prob.driver.add_objective('obj.o')
    prob.driver.add_constraint('con1.c', equals=0.0)
    prob.driver.add_constraint('con2.c', equals=0.0)
    prob.driver.options['disp'] = False
    prob.setup(check=False)
    prob.run()
    obj = prob['obj.o']
    assert_rel_error(self, obj, 30.0, 1e-06)

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/drivers/test/test_scipy_optimizer.py TestScipyOptimize.test_fan_out/original