Example #1
0
    def configure(self):
        # add an optimizer and an AeroStructural assembly
        if pyopt_driver and 'SNOPT' in pyopt_driver._check_imports():
            self.add("driver", pyopt_driver.pyOptDriver())
            self.driver.optimizer = "SNOPT"
            self.driver.options = {
                # any changes to default SNOPT options?
            }
        else:
            print 'SNOPT not available, using SLSQP'
            self.add('driver', SLSQPdriver())

        self.add('aso', AeroStructuralOpt())

        # objective: minimize total power
        self.driver.add_objective('aso.Ptot')

        # parameter: rotor speed
        self.driver.add_parameter('aso.Omega_opt',
                                  low=0.15 * 2 * pi,
                                  high=0.25 * 2 * pi)
        self.aso.Omega_opt = 0.2 * 2 * pi  # initial value

        # constraint: lift >= weight
        self.driver.add_constraint('aso.Mtot*9.8-aso.Ttot<=0')
Example #2
0
    def configure(self):
        # add an optimizer and an AeroStructural assembly
        if pyopt_driver and 'SNOPT' in pyopt_driver._check_imports():
            self.add("driver", pyopt_driver.pyOptDriver())
            self.driver.optimizer = "SNOPT"
            self.driver.options = {
                # any changes to default SNOPT options?
            }
        else:
            print 'SNOPT not available, using SLSQP'
            self.add('driver', SLSQPdriver())

        self.add('aso', AeroStructuralOpt())

        # objective: minimize total power
        self.driver.add_objective('aso.Ptot')

        # parameter: rotor speed
        self.driver.add_parameter('aso.Omega_opt',
                                  low=0.15*2*pi, high=0.25*2*pi)
        self.aso.Omega_opt = 0.2*2*pi  # initial value

        # constraint: lift >= weight
        self.driver.add_constraint('aso.Mtot*9.8-aso.Ttot<=0')
    def configure(self):
        # add an optimizer and a multi-point AeroStructural assembly
        if pyopt_driver and 'SNOPT' in pyopt_driver._check_imports():
            self.add("driver", pyopt_driver.pyOptDriver())
            self.driver.optimizer = "SNOPT"
            self.driver.options = {
                # any changes to default SNOPT options?
            }
        else:
            print 'SNOPT not available, using SLSQP'
            self.add('driver', SLSQPdriver())

        # Nothing has anlytical derivaties, but we have a lot of
        # nested assemblies, so it is less problematic to just
        # finite difference it all in one block.
        #self.driver.gradient_options.force_fd = True
        #self.driver.gradient_options.fd_step_type = 'relative'
        #self.driver.gradient_options.fd_step = 1.0e-7
        #self.driver.pyopt_diff = True

        self.add('mp', Multipoint())

        self.mp.alt_low = 0.5         # low altitude
        self.mp.alt_high = 3.5        # high altitude
        self.mp.alt_ratio = 35./60.   # proportion of time near ground

        self.mp.TWire_high = 900
        self.mp.TWire_wind = 2100
        self.mp.TWire_grav = 110

        self.mp.OmegaRatio  = 2

        self.mp.vw = 0/3.6   # zero

        self.mp.Cl_max = [1.4, 1.35, 1.55]    # max control

        # objective: minimize total power
        self.driver.add_objective('mp.P')

        # parameter: rotor speed
        self.driver.add_parameter('mp.Omega_low',
                                  low=0.15*2*pi, high=0.25*2*pi)
        self.mp.Omega_low = 0.20*2*pi  # initial value

        self.driver.add_parameter('mp.Omega_high',
                                  low=0.15*2*pi, high=0.19*2*pi)
        self.mp.Omega_high = 0.17*2*pi  # initial value

        # parameter: lift distribution at high altitude
        self.driver.add_parameter('mp.Cl0_high',
                                  low=0.8, high=1.4)
        self.mp.Cl0_high = 1.

        self.driver.add_parameter('mp.Cl1_high',
                                  low=0.8, high=1.3)
        self.mp.Cl1_high = 1.

        # constraint: lift >= weight
        self.driver.add_constraint('mp.Mtot_low*9.8-mp.Ttot_low<=0')
        self.driver.add_constraint('mp.Mtot_high*9.8-mp.Ttot_high<=0')

        # TODO: optional constraints
        #    if flags.ConFail:
        #       Structural Failure in Rotor Spar (ConFail)
        #       Buckling failure of spar (ConFailBuck)
        #       Tensile failure in wire (ConFailWire)
        #
        #    if flags.ConDef:
        #       Constraints on Maximum Deformation (ConDelta)
        #
        #    if flags.MultiPoint && flags.ConJigCont:
        #       Consistent jig twist (ConAlphaJig)
        #
        #    if flags.MultiPoint && flags.ConWireCont
        #       Wire stretch consistency (conWire)

        # Optimization Constraints  (not used... yet)
        vrCon = VariableTree()
        vrCon.MaxDelta    = -0.1
        vrCon.MinDelta    = 0.1
        vrCon.FOSmat      = 0.55    # 1.3
        vrCon.FOSbuck     = 0.5     # 1.3
        vrCon.FOSquadbuck = 5.
        vrCon.FOStorbuck  = 0.5     # 1.5
        vrCon.FOSwire     = 0.5     # 2

        self.driver.workflow.add('mp')
Example #4
0
    def configure(self):
        # add an optimizer and a multi-point AeroStructural assembly
        if pyopt_driver and 'SNOPT' in pyopt_driver._check_imports():
            self.add("driver", pyopt_driver.pyOptDriver())
            self.driver.optimizer = "SNOPT"
            self.driver.options = {
                # any changes to default SNOPT options?
            }
        else:
            print 'SNOPT not available, using SLSQP'
            self.add('driver', SLSQPdriver())

        self.add('mp', Multipoint())

        self.mp.alt_low = 0.5  # low altitude
        self.mp.alt_high = 3.5  # high altitude
        self.mp.alt_ratio = 35. / 60.  # proportion of time near ground

        self.mp.TWire_high = 900
        self.mp.TWire_wind = 2100
        self.mp.TWire_grav = 110

        self.mp.OmegaRatio = 2

        self.mp.vw = 0 / 3.6  # zero

        self.mp.Cl_max = [1.4, 1.35, 1.55]  # max control

        # objective: minimize total power
        self.driver.add_objective('mp.P')

        # parameter: rotor speed
        self.driver.add_parameter('mp.Omega_low',
                                  low=0.15 * 2 * pi,
                                  high=0.25 * 2 * pi)
        self.mp.Omega_low = 0.20 * 2 * pi  # initial value

        self.driver.add_parameter('mp.Omega_high',
                                  low=0.15 * 2 * pi,
                                  high=0.19 * 2 * pi)
        self.mp.Omega_high = 0.17 * 2 * pi  # initial value

        # parameter: lift distribution at high altitude
        self.driver.add_parameter('mp.Cl0_high', low=0.8, high=1.4)
        self.mp.Cl0_high = 1.

        self.driver.add_parameter('mp.Cl1_high', low=0.8, high=1.3)
        self.mp.Cl1_high = 1.

        # constraint: lift >= weight
        self.driver.add_constraint('mp.Mtot_low*9.8-mp.Ttot_low<=0')
        self.driver.add_constraint('mp.Mtot_high*9.8-mp.Ttot_high<=0')

        # TODO: optional constraints
        #    if flags.ConFail:
        #       Structural Failure in Rotor Spar (ConFail)
        #       Buckling failure of spar (ConFailBuck)
        #       Tensile failure in wire (ConFailWire)
        #
        #    if flags.ConDef:
        #       Constraints on Maximum Deformation (ConDelta)
        #
        #    if flags.MultiPoint && flags.ConJigCont:
        #       Consistent jig twist (ConAlphaJig)
        #
        #    if flags.MultiPoint && flags.ConWireCont
        #       Wire stretch consistency (conWire)

        # Optimization Constraints  (not used... yet)
        vrCon = VariableTree()
        vrCon.MaxDelta = -0.1
        vrCon.MinDelta = 0.1
        vrCon.FOSmat = 0.55  # 1.3
        vrCon.FOSbuck = 0.5  # 1.3
        vrCon.FOSquadbuck = 5.
        vrCon.FOStorbuck = 0.5  # 1.5
        vrCon.FOSwire = 0.5  # 2