def configure(self): """ Creates a new Assembly with this problem Optimal Design at (1.9776, 0, 0) Optimal Objective = 3.18339 """ self.add('driver', FixedPointIterator()) # Inner Loop - Full Multidisciplinary Solve via fixed point iteration C1 = self.add('C1', sellar.Discipline1_WithDerivatives()) C2 = self.add('C2', sellar.Discipline2_WithDerivatives()) self.driver.workflow.add(['C1','C2']) #not relevant to the iteration. Just fixed constants C1.z1 = C2.z1 = 1.9776 C1.z2 = C2.z2 = 0 C1.x1 = 0 # Solver settings self.driver.max_iteration = 5 self.driver.tolerance = 1.e-15 self.driver.print_convergence = False
def configure(self): """ Creates a new Assembly with this problem Optimal Design at (1.9776, 0, 0) Optimal Objective = 3.18339""" # create Optimizer instance self.add('driver', SLSQPdriver()) # Outer Loop - Global Optimization self.add('dummy', Dummy()) self.dummy.force_execute = True self.add('solver', FixedPointIterator()) self.driver.workflow.add(['dummy', 'solver']) # Inner Loop - Full Multidisciplinary Solve via fixed point iteration self.add('dis1', sellar.Discipline1_WithDerivatives()) self.add('dis2', sellar.Discipline2_WithDerivatives()) self.solver.workflow.add(['dis1', 'dis2']) # Add Parameters to optimizer self.driver.add_parameter(('dis1.z1', 'dis2.z1'), low=-10.0, high=10.0) self.driver.add_parameter(('dis1.z2', 'dis2.z2'), low=0.0, high=10.0) self.driver.add_parameter('dis1.x1', low=0.0, high=10.0) # Make all connections self.connect('dis1.y1', 'dis2.y1') # Iteration loop self.solver.add_parameter('dis1.y2', low=-1.e99, high=1.e99) self.solver.add_constraint('dis2.y2 = dis1.y2') # Solver settings self.solver.max_iteration = 100 self.solver.tolerance = .00001 self.solver.print_convergence = False # Optimization parameters self.driver.add_objective( '(dis1.x1)**2 + dis1.z2 + dis1.y1 + math.exp(-dis2.y2)') self.driver.add_constraint('3.16 < dis1.y1') self.driver.add_constraint('dis2.y2 < 24.0') self.driver.iprint = 0
def configure(self): """ Creates a new Assembly with this problem Optimal Design at (1.9776, 0, 0) Optimal Objective = 3.18339""" # create Optimizer instance self.add('driver', SLSQPdriver()) # Disciplines self.add('dis1', sellar.Discipline1_WithDerivatives()) self.add('dis2', sellar.Discipline2_WithDerivatives()) # Driver process definition self.driver.workflow.add(['dis1', 'dis2']) #self.driver.workflow.add(['dis1']) # Optimization parameters self.driver.add_objective( '(dis1.x1)**2 + dis1.z2 + dis1.y1 + math.exp(-dis2.y2)') #Global Design Variables self.driver.add_parameter(('dis1.z1', 'dis2.z1'), low=-10.0, high=10.0) self.driver.add_parameter(('dis1.z2', 'dis2.z2'), low=0.0, high=10.0) #Local Design Variables and Coupling Variables self.driver.add_parameter('dis1.x1', low=0.0, high=10.0) self.driver.add_parameter('dis2.y1', low=-1e99, high=1e99) self.driver.add_parameter('dis1.y2', low=-1e99, high=1e99) self.driver.add_constraint('3.16 < dis1.y1') self.driver.add_constraint('dis2.y2 < 24.0') self.driver.add_constraint('(dis2.y1-dis1.y1)**2 <= 0') self.driver.add_constraint('(dis2.y2-dis1.y2)**2 <= 0') self.driver.iprint = 0