Exemplo n.º 1
0
    def configure(self):
        
        # create Optimizer instance
        self.add('driver', SLSQPdriver())
        
        # Add components
        self.add('mech', mech_motion())
        self.add('wing', wing_motion())

        # Add components to workflow
        self.driver.workflow.add(['mech', 'wing'])
        
        # Add parameters to driver
        self.driver.add_parameter(('mech.mdef.front.Ri'), low = 5.e-3, high = 9.e-3)
        self.driver.add_parameter(('mech.mdef.front.Ro'), low = 20.e-3, high = 25.e-3)
        self.driver.add_parameter(('mech.mdef.front.theta_del'), low = np.radians(30), high = np.radians(180))
        
        # Make all connections
        self.connect('mech.mpos','wing.mpos')
        
        # Add constrains to inner optimizer
        self.driver.add_constraint('mech.mdef.front.Ri <= 1')

        # Outer optimization parameters
        self.driver.add_objective('-wing.Dymax')
Exemplo n.º 2
0
WingInit = wing_init()

WingInit.fAE = WingInit.bAE = 0.294
WingInit.fEC = WingInit.bEC = 0.02
WingInit.fOC = WingInit.bOC = 0.294
WingInit.fCD = WingInit.bCD = 0.3825
WingInit.fED = WingInit.bED = 0.364
WingInit.fz = 0.
WingInit.bz = MechInit.bz

WingInit.run()

"""
Calculate wing motion
"""
WingMotion = wing_motion()

# Hand over definition and positions of mechanism
WingMotion.wdef = WingInit.wdef
WingMotion.mpos = MechMotion.mpos 
WingMotion.dt = dt

WingMotion.run()

"""
Define elements along equivalent axis (P_1)
"""
Nele = 100
P_1 = np.zeros((len(theta),Nele,3))
Woc = np.linspace(0,1,Nele*(WingInit.fOC/(WingInit.fCD+WingInit.fOC))+1)
Wcd = np.linspace(0,1,Nele*(WingInit.fCD/(WingInit.fCD+WingInit.fOC))+2)