def configure(self):
     self.add('d', Dummy())
     self.add('driver', DOEdriver())
     self.driver.DOEgenerator = FullFactorial(2)
     self.driver.recorders = [DumpCaseRecorder()]
     self.driver.add_parameter('d.x', low=0, high=10)
     self.driver.case_outputs = ['d.y', 'd.bad', 'd.z']
 def configure(self):
     self.add('driver', DOEdriver())
     self.add('driven', ComponentWhichRaisesException())
     self.driver.workflow.add('driven')
     self.driver.error_policy = 'RETRY'
     self.driver.DOEgenerator = FullFactorial(2)
     self.driver.add_parameter('driven.x', low=-50, high=50)
     self.driver.add_response('driven.f_x')
 def configure(self):
     self.add('driver', DOEdriver())
     self.add('driven', ArrayComponent())
     self.driver.workflow.add('driven')
     self.driver.DOEgenerator = OptLatinHypercube(num_samples=10)
     self.driver.add_response('driven.rosen_suzuki')
     self.driver.add_parameter('driven.x', low=-10., high=10.,
                               scaler=20., adder=10.)
 def configure(self):
     d = DOEdriver()
     self.add('driver', DOEdriver())
     self.add('driven', DrivenComponent())
     self.driver.workflow.add('driven')
     self.driver.DOEgenerator = OptLatinHypercube(num_samples=10)
     self.driver.case_outputs = ['driven.rosen_suzuki']
     self.driver.add_parameter(('driven.x0', 'driven.y0'),
                               low=-10.,
                               high=10.,
                               scaler=20.,
                               adder=10.)
     for name in ['x1', 'x2', 'x3']:
         self.driver.add_parameter("driven.%s" % name,
                                   low=-10.,
                                   high=10.,
                                   scaler=20.,
                                   adder=10.)
            def __init__(self):
                super(Analysis, self).__init__(self)

                self.add('d', Dummy())

                self.add('driver', DOEdriver())
                self.driver.DOEgenerator = FullFactorial(2)
                self.driver.recorders = [DumpCaseRecorder()]
                self.driver.add_parameter('d.x', low=0, high=10)
                self.driver.case_outputs = ['d.y', 'd.bad', 'd.z']
 def configure(self):
     self.add('driver', DOEdriver())
     self.add('driven', DrivenComponent())
     self.driver.workflow.add('driven')
     self.driver.DOEgenerator = OptLatinHypercube(num_samples=10)
     self.driver.add_parameter(('driven.x0', 'driven.y0'),
                               low=-10., high=10., scaler=20., adder=10.)
     for name in ('x1', 'x2'):
         self.driver.add_parameter("driven.%s" % name,
                                   low=-10., high=10., scaler=20., adder=10.)
     self.driver.add_parameter("driven.x3", name='x3',
                               low=-10., high=10., scaler=20., adder=10.)
     self.driver.add_response('driven.rosen_suzuki')
    def test_AutoBEM_DOE(self):
        # perform a DOE
        self.top.replace('driver', DOEdriver())
        self.top.driver.DOEgenerator = FullFactorial(3)

        self.top.driver.add_parameter('b.chord_hub', low=.1, high=2)
        self.top.driver.add_parameter('b.chord_tip', low=.1, high=2)
        self.top.driver.add_parameter('b.rpm', low=20, high=300)
        self.top.driver.add_parameter('b.twist_hub', low=-5, high=50)
        self.top.driver.add_parameter('b.twist_tip', low=-5, high=50)

        self.top.run()

        self.assertEqual(self.top.b.exec_count, 243)
Esempio n. 8
0
    def configure(self):
        """ Configure a simple DOE to set start points for CONMIN. """
        self.add('gp_fun', GoldsteinPrice())

        conmin = self.add('conmin', CONMINdriver())
        conmin.workflow.add('gp_fun')
        conmin.add_parameter('gp_fun.x1')
        conmin.add_parameter('gp_fun.x2')
        conmin.add_objective('gp_fun.f')

        doe = self.add('driver', DOEdriver())
        doe.workflow.add('conmin')
        doe.add_parameter('gp_fun.x1', low=-1.5, high=1.5, start=1)
        doe.add_parameter('gp_fun.x2', low=-1.5, high=1.5, start=1)
        doe.DOEgenerator = FullFactorial(5)
        doe.add_responses(
            ['gp_fun.f', 'gp_fun.x1', 'gp_fun.x2', 'gp_fun.exec_count'])
        self.recorders = [CSVCaseRecorder(), DumpCaseRecorder()]
Esempio n. 9
0
    def test_AutoBEM_DOE(self):
        # perform a DOE
        self.top.replace('driver', DOEdriver())
        self.top.driver.DOEgenerator = FullFactorial(3)
        self.top.driver.recorders = [ListCaseRecorder()]
        self.top.driver.case_outputs = [
            'b.perf.data.tip_speed_ratio', 'b.perf.data.Cp', 'b.perf.data.Ct'
        ]

        self.top.driver.add_parameter('b.chord_hub', low=.1, high=2)
        self.top.driver.add_parameter('b.chord_tip', low=.1, high=2)
        self.top.driver.add_parameter('b.rpm', low=20, high=300)
        self.top.driver.add_parameter('b.twist_hub', low=-5, high=50)
        self.top.driver.add_parameter('b.twist_tip', low=-5, high=50)

        self.top.run()

        self.assertEqual(len(self.top.driver.recorders[0]), 243)
 def __init__(self, *args, **kwargs):
     super(MyModel, self).__init__(*args, **kwargs)
     self.add('driver', DOEdriver())
     self.add('driven', DrivenComponent())
     self.driver.workflow.add('driven')
     self.driver.DOEgenerator = OptLatinHypercube(num_samples=10)
     self.driver.case_outputs = ['driven.rosen_suzuki']
     self.driver.add_parameter(('driven.x0', 'driven.y0'),
                               low=-10.,
                               high=10.,
                               scaler=20.,
                               adder=10.)
     for name in ['x1', 'x2', 'x3']:
         self.driver.add_parameter("driven.%s" % name,
                                   low=-10.,
                                   high=10.,
                                   scaler=20.,
                                   adder=10.)
 def test_doegen_remove(self):
     top = set_as_top(Assembly())
     top.add("driver", DOEdriver())
     top.driver.remove("DOEgenerator")
     top.driver.add("DOEgenerator", FullFactorial())