Example #1
0
def box_spar():
    " test wing models "

    Wing.sparModel = BoxSpar
    W = Wing()
    W.substitutions[W.W] = 50
    fs = FlightState()
    perf = W.flight_model(W, fs)
    loading = [W.spar.loading(W)]
    loading[0].substitutions["W"] = 100
    loading.append(W.spar.gustloading(W))
    loading[1].substitutions["W"] = 100

    from gpkit import settings
    if settings["default_solver"] == "cvxopt":
        for l in loading:
            for v in ["\\bar{M}_{tip}", "\\bar{S}_{tip}",
                      "\\bar{\\delta}_{root}", "\\theta_{root}"]:
                l.substitutions[v] = 1e-3

    m = Model(perf.Cd, [
        loading[1].v == fs.V,
        loading[1].cl == perf.CL,
        loading[1].Ww == W.W,
        loading[1].Ww <= 0.5*fs.rho*fs.V**2*perf.CL*W.planform.S,
        W, fs, perf, loading])
    m.solve(verbosity=0)
Example #2
0
def box_spar():
    " test wing models "

    Wing.sparModel = BoxSpar
    W = Wing()
    W.substitutions[W.W] = 50
    W.substitutions[W.planform.tau] = 0.115
    fs = FlightState()
    perf = W.flight_model(W, fs)
    loading = [W.spar.loading(W, fs)]
    loading[0].substitutions["W"] = 100
    loading.append(W.spar.gustloading(W, fs))
    loading[1].substitutions["W"] = 100

    from gpkit import settings
    if settings["default_solver"] == "cvxopt":
        for l in loading:
            for v in ["Mtip", "Stip", "wroot", "throot"]:
                l.substitutions[v] = 1e-2

    m = Model(perf.Cd, [
        loading[1].v == fs.V, loading[1].cl == perf.CL, loading[1].Ww == W.W,
        loading[1].Ww <= fs.qne * perf.CL * W.planform.S, W, fs, perf, loading
    ])
    m.solve(verbosity=0)
Example #3
0
    def setup(self, N=5):
        exec parse_variables(Wing.__doc__)

        self.wing = WingGP.setup(self, N=N)
        with SignomialsEnabled():
            constraints = [mw * (1 + 2 / self.planform["AR"]) >= 2 * np.pi]

        return self.wing, constraints
Example #4
0
    def setup(self, N=5):

        self.wing = WingGP.setup(self, N=N)
        mw = Variable("m_w", "-", "span wise effectiveness")

        with SignomialsEnabled():
            constraints = [mw * (1 + 2 / self.planform["AR"]) >= 2 * np.pi]

        return self.wing, constraints
Example #5
0
    def setup(self, N=3):
        exec parse_variables(VerticalTail.__doc__)

        self.ascs = Wing.setup(self, N)
        self.planform.substitutions.update(
            {self.planform.tau: 0.08, self.planform.lam: 0.8,
             self.planform.AR: 4})
        if self.fillModel:
            self.foam.substitutions.update({self.foam.Abar: 0.0548,
                                            self.foam.material.rho: 0.024})

        return self.ascs
Example #6
0
    def setup(self, N=3):
        exec parse_variables(HorizontalTail.__doc__)

        self.ascs = Wing.setup(self, N)
        self.planform.substitutions.update({
            self.planform.AR: 4,
            self.planform.lam: 0.8
        })
        if self.fillModel:
            self.foam.substitutions.update({
                self.foam.Abar: 0.0548,
                self.foam.material.rho: 0.024
            })

        return self.ascs, mh * (1 + 2.0 / self.planform["AR"]) <= 2 * np.pi
Example #7
0
    def setup(self):

        Wing.fillModel = None
        self.wing = Wing()

        W = Variable("W", "lbf", "aircraft weight")
        WS = Variable("W/S", "lbf/ft^2", "Aircraft wing loading")
        PW = Variable("P/W", "hp/lbf", "Aircraft shaft hp/weight ratio")
        Wpay = Variable("W_{pay}", 2 * 195, "lbf", "payload weight")
        hbatt = Variable("h_{batt}", 210, "W*hr/kg", "battery specific energy")
        etae = Variable("\\eta_{e}", 0.9, "-", "total electrical efficiency")
        Wbatt = Variable("W_{batt}", "lbf", "battery weight")
        Wwing = Variable("W_{wing}", "lbf", "wing weight")
        Pshaftmax = Variable("P_{shaft-max}", "W", "max shaft power")
        sp_motor = Variable("sp_{motor}", 7. / 9.81, "kW/N",
                            'Motor specific power')
        Wmotor = Variable("W_{motor}", "lbf", "motor weight")
        Wcent = Variable("W_{cent}", "lbf", "aircraft center weight")
        fstruct = Variable("f_{struct}", 0.2, "-",
                           "structural weight fraction")
        Wstruct = Variable("W_{struct}", "lbf", "structural weight")
        e = Variable("e", 0.8, "-", "span efficiency factor")
        CL_max_clean = Variable("CL_{max_{clean}}", 1.6, "-", "Clean CL max")
        CL_max_to = Variable("CL_{max_{to}}", 2.0, "-", "Clean CL max")
        CL_max_aprch = Variable("CL_{max_{aprch}}", 2.4, "-", "Clean CL max")
        fbattmax = Variable("f_{batt,max}", 1.0, "-", "max battery fraction")

        loading = self.wing.spar.loading(self.wing)
        loading.substitutions.update({
            loading.kappa: 0.05,
            self.wing.spar.material.sigma: 1.5e9,
            loading.Nmax: 6,
            self.wing.skin.material.tmin: 0.012 * 4,
            self.wing.mfac: 1.4,
            self.wing.spar.mfac: 0.8
        })
        constraints = [
            Wcent == loading.W,
            WS == W / self.wing.planform.S,
            PW == Pshaftmax / W,
            TCS([W >= Wbatt + Wpay + self.wing.W + Wmotor + Wstruct]),
            Wcent >= Wbatt + Wpay + Wmotor + Wstruct,
            Wstruct >= fstruct * W,
            Wmotor >= Pshaftmax / sp_motor,
            Wbatt / W <= fbattmax,
        ]

        return constraints, self.wing, loading