From 0b9702bf8d59c3cd3c0ee16d7ba6aa760e615c2b Mon Sep 17 00:00:00 2001 From: mjburton Date: Mon, 9 Apr 2018 17:56:59 -0400 Subject: [PATCH 1/8] move beam to sparloading --- gpkitmodels/GP/aircraft/wing/gustloading.py | 7 ++- gpkitmodels/GP/aircraft/wing/sparloading.py | 48 ++++++++++++++------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/gustloading.py b/gpkitmodels/GP/aircraft/wing/gustloading.py index 88235c7f..3d21c242 100644 --- a/gpkitmodels/GP/aircraft/wing/gustloading.py +++ b/gpkitmodels/GP/aircraft/wing/gustloading.py @@ -32,7 +32,7 @@ class GustL(SparLoading): Lower Unbounded --------------- - Ww, wing.planform.b, wing.planform.cave + W, Ww, wing.planform.cave wing.planform.CM (if wingSparJ), qne (if wingSparJ) theta (if not wingSparJ), M (if not wingSparJ) @@ -57,6 +57,9 @@ def setup(self, wing, state): cbar = self.wing.planform.cbar W = self.W # from SparLoading + q = self.q + N = self.N + b = self.b path = os.path.dirname(os.path.abspath(__file__)) df = pd.read_csv(path + os.sep + "arctan_fit.csv").to_dict( @@ -65,7 +68,7 @@ def setup(self, wing, state): constraints = [ # fit for arctan from 0 to 1, RMS = 0.044 FitCS(df, agust, [cosminus1*vgust/v]), - self.beam["\\bar{q}"] >= cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), + q >= N*W/b*cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), ] return self.load, constraints diff --git a/gpkitmodels/GP/aircraft/wing/sparloading.py b/gpkitmodels/GP/aircraft/wing/sparloading.py index 13963143..6caef426 100644 --- a/gpkitmodels/GP/aircraft/wing/sparloading.py +++ b/gpkitmodels/GP/aircraft/wing/sparloading.py @@ -17,11 +17,23 @@ class SparLoading(Model): kappa 0.2 [-] max tip deflection ratio W [lbf] loading weight twmax 30.*pi/180 [-] max tip twist + Stip 1e-10 [N] tip loading + Mtip 1e-10 [N*m] tip moment + throot 1e-10 [-] root deflection angle + wroot 1e-10 [m] root deflection + N [-] loading factor + + Variables of length wing.N + -------------------------- + q [N/m] distributed wing loading + S [N] shear along wing + M [N*m] wing section root moment + th [-] deflection angle + w [m] wing deflection Variables of length wing.N-1 ---------------------------- - Mr [N*m] wing section root moment - M [N*m] local moment + Mtw [N*m] local moment due to twisting theta [-] twist deflection Upper Unbounded @@ -31,7 +43,7 @@ class SparLoading(Model): Lower Unbounded --------------- - b, W, cave + W, cave wing.planform.CM (if wingSparJ), qne (if wingSparJ) theta (if not wingSparJ), M (if not wingSparJ) @@ -53,25 +65,29 @@ def setup(self, wing, state): self.wing = wing exec parse_variables(SparLoading.__doc__) - Beam.qbarFun = self.new_qbarFun - Beam.SbarFun = self.new_SbarFun - self.beam = Beam(self.wing.N) - b = self.b = self.wing.planform.b I = self.I = self.wing.spar.I Sy = self.Sy = self.wing.spar.Sy cave = self.cave = self.wing.planform.cave + cbar = self.cbar = self.wing.planform.cbar E = self.wing.spar.material.E sigma = self.wing.spar.material.sigma deta = self.wing.planform.deta constraints = [ # dimensionalize moment of inertia and young's modulus - self.beam["dx"] == deta, - self.beam["\\bar{EI}"] <= 8*E*I/Nmax/Nsafety/W/b**2, - Mr >= self.beam["\\bar{M}"][:-1]*W*Nmax*Nsafety*b/4, - sigma >= Mr/Sy, - self.beam["\\bar{\\delta}"][-1] <= kappa, + N == Nsafety*Nmax, + q >= N*W/b*cbar, + S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), + S[-1] >= Stip, + M[:-1] >= M[1:] + 0.5*deta*(b/2.)*(S[:-1] + S[1:]), + M[-1] >= Mtip, + th[0] >= throot, + th[1:] >= th[:1] + 0.5*deta*(b/2.)*(M[1:] + M[:-1])/E/I, + w[0] >= wroot, + w[1:] >= w[:-1] + 0.5*deta*(b/2.)*(th[1:] + th[:-1]), + sigma >= M[:-1]/Sy, + w[-1]/(b/2.) <= kappa, ] self.wingSparJ = hasattr(self.wing.spar, "J") @@ -82,9 +98,9 @@ def setup(self, wing, state): G = self.wing.spar.shearMaterial.G cm = self.wing.planform.CM constraints.extend([ - M >= cm*cave**2*qne*deta*b/2*Nsafety, - theta[0] >= M[0]/G/J[0]*deta[0]*b/2, - theta[1:] >= theta[:-1] + M[1:]/G/J[1:]*deta[1:]*b/2, + Mtw >= cm*cave**2*qne*deta*b/2*Nsafety, + theta[0] >= Mtw[0]/G/J[0]*deta[0]*b/2, + theta[1:] >= theta[:-1] + Mtw[1:]/G/J[1:]*deta[1:]*b/2, twmax >= theta[-1] ]) - return self.beam, constraints + return constraints From fbcbcd171bf4cef301a5764250f65e5bccf91e4c Mon Sep 17 00:00:00 2001 From: mjburton Date: Mon, 16 Apr 2018 10:45:01 -0400 Subject: [PATCH 2/8] insert beam into sparloading --- gpkitmodels/GP/aircraft/wing/gustloading.py | 6 ++-- gpkitmodels/GP/aircraft/wing/sparloading.py | 38 ++++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/gustloading.py b/gpkitmodels/GP/aircraft/wing/gustloading.py index 3d21c242..465c1c8b 100644 --- a/gpkitmodels/GP/aircraft/wing/gustloading.py +++ b/gpkitmodels/GP/aircraft/wing/gustloading.py @@ -32,7 +32,7 @@ class GustL(SparLoading): Lower Unbounded --------------- - W, Ww, wing.planform.cave + Ww, wing.planform.cave, b wing.planform.CM (if wingSparJ), qne (if wingSparJ) theta (if not wingSparJ), M (if not wingSparJ) @@ -58,7 +58,7 @@ def setup(self, wing, state): cbar = self.wing.planform.cbar W = self.W # from SparLoading q = self.q - N = self.N + # N = self.N b = self.b path = os.path.dirname(os.path.abspath(__file__)) @@ -68,7 +68,7 @@ def setup(self, wing, state): constraints = [ # fit for arctan from 0 to 1, RMS = 0.044 FitCS(df, agust, [cosminus1*vgust/v]), - q >= N*W/b*cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), + q >= cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), ] return self.load, constraints diff --git a/gpkitmodels/GP/aircraft/wing/sparloading.py b/gpkitmodels/GP/aircraft/wing/sparloading.py index 6caef426..8e3fed35 100644 --- a/gpkitmodels/GP/aircraft/wing/sparloading.py +++ b/gpkitmodels/GP/aircraft/wing/sparloading.py @@ -21,20 +21,21 @@ class SparLoading(Model): Mtip 1e-10 [N*m] tip moment throot 1e-10 [-] root deflection angle wroot 1e-10 [m] root deflection - N [-] loading factor Variables of length wing.N -------------------------- - q [N/m] distributed wing loading - S [N] shear along wing - M [N*m] wing section root moment + q self.new_qbarFun [-] distributed wing loading + S [-] shear along wing + Mbar [-] wing section root moment th [-] deflection angle - w [m] wing deflection + w [-] wing deflection Variables of length wing.N-1 ---------------------------- Mtw [N*m] local moment due to twisting + M [N*m] wing section root moment theta [-] twist deflection + EIbar [-] EIbar Upper Unbounded --------------- @@ -43,7 +44,7 @@ class SparLoading(Model): Lower Unbounded --------------- - W, cave + b, W, cave wing.planform.CM (if wingSparJ), qne (if wingSparJ) theta (if not wingSparJ), M (if not wingSparJ) @@ -76,18 +77,21 @@ def setup(self, wing, state): constraints = [ # dimensionalize moment of inertia and young's modulus - N == Nsafety*Nmax, - q >= N*W/b*cbar, - S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), - S[-1] >= Stip, - M[:-1] >= M[1:] + 0.5*deta*(b/2.)*(S[:-1] + S[1:]), - M[-1] >= Mtip, + # N == Nsafety*Nmax, + # q >= cbar, + # S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), + S[:-1] >= S[1:] + 0.5*deta*(q[:-1] + q[1:]), + S[-1] >= 1e-10, + Mbar[:-1] >= Mbar[1:] + 0.5*deta*(S[:-1] + S[1:]), + Mbar[-1] >= 1e-10, + M >= Mbar[:-1]*Nsafety*Nmax*W*b/4, th[0] >= throot, - th[1:] >= th[:1] + 0.5*deta*(b/2.)*(M[1:] + M[:-1])/E/I, - w[0] >= wroot, - w[1:] >= w[:-1] + 0.5*deta*(b/2.)*(th[1:] + th[:-1]), - sigma >= M[:-1]/Sy, - w[-1]/(b/2.) <= kappa, + th[1:] >= th[:1] + 0.5*deta*(Mbar[1:] + Mbar[:-1])/EIbar, + EIbar <= 8*E*I/Nsafety/Nmax/W/b**2, + w[0] >= 1e-10, + w[1:] >= w[:-1] + 0.5*deta*(th[1:] + th[:-1]), + sigma >= M/Sy, + w[-1] <= kappa, ] self.wingSparJ = hasattr(self.wing.spar, "J") From 016a5613b44b9df6ed5c4affbf4edecb36080382 Mon Sep 17 00:00:00 2001 From: mjburton Date: Mon, 16 Apr 2018 20:26:28 -0400 Subject: [PATCH 3/8] move beam function into sparloading --- gpkitmodels/GP/aircraft/wing/gustloading.py | 16 +------ gpkitmodels/GP/aircraft/wing/sparloading.py | 50 ++++++++------------- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/gustloading.py b/gpkitmodels/GP/aircraft/wing/gustloading.py index 465c1c8b..5abcbe7e 100644 --- a/gpkitmodels/GP/aircraft/wing/gustloading.py +++ b/gpkitmodels/GP/aircraft/wing/gustloading.py @@ -24,18 +24,6 @@ class GustL(SparLoading): agust [-] gust angle of attack cosminus1 self.return_cosm1 [-] 1 minus cosine factor - Upper Unbounded - --------------- - v, cl, wing.spar.I, wing.spar.tshear, wing.spar.Sy - J (if wingSparJ) - theta (if not wingSparJ), M (if not wingSparJ) - - Lower Unbounded - --------------- - Ww, wing.planform.cave, b - wing.planform.CM (if wingSparJ), qne (if wingSparJ) - theta (if not wingSparJ), M (if not wingSparJ) - LaTex Strings ------------- vgust V_{\\mathrm{gust}} @@ -58,7 +46,7 @@ def setup(self, wing, state): cbar = self.wing.planform.cbar W = self.W # from SparLoading q = self.q - # N = self.N + N = self.N b = self.b path = os.path.dirname(os.path.abspath(__file__)) @@ -68,7 +56,7 @@ def setup(self, wing, state): constraints = [ # fit for arctan from 0 to 1, RMS = 0.044 FitCS(df, agust, [cosminus1*vgust/v]), - q >= cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), + q >= W*N/b*cbar*(1 + 2*pi*agust/cl*(1+Ww/W)), ] return self.load, constraints diff --git a/gpkitmodels/GP/aircraft/wing/sparloading.py b/gpkitmodels/GP/aircraft/wing/sparloading.py index 8e3fed35..ca0c1b3c 100644 --- a/gpkitmodels/GP/aircraft/wing/sparloading.py +++ b/gpkitmodels/GP/aircraft/wing/sparloading.py @@ -16,6 +16,7 @@ class SparLoading(Model): Nsafety 1.0 [-] safety load factor kappa 0.2 [-] max tip deflection ratio W [lbf] loading weight + N [-] loading factor twmax 30.*pi/180 [-] max tip twist Stip 1e-10 [N] tip loading Mtip 1e-10 [N*m] tip moment @@ -24,30 +25,19 @@ class SparLoading(Model): Variables of length wing.N -------------------------- - q self.new_qbarFun [-] distributed wing loading - S [-] shear along wing - Mbar [-] wing section root moment - th [-] deflection angle - w [-] wing deflection + q [N/m] distributed wing loading + S [N] shear along wing + Mbar [-] wing section root moment + M [N*m] wing section root moment + th [-] deflection angle + w [m] wing deflection Variables of length wing.N-1 ---------------------------- Mtw [N*m] local moment due to twisting - M [N*m] wing section root moment theta [-] twist deflection EIbar [-] EIbar - Upper Unbounded - --------------- - I, Sy, J (if wingSparJ) - theta (if not wingSparJ), M (if not wingSparJ) - - Lower Unbounded - --------------- - b, W, cave - wing.planform.CM (if wingSparJ), qne (if wingSparJ) - theta (if not wingSparJ), M (if not wingSparJ) - LaTex Strings ------------- Nmax N_{\\mathrm{max}} @@ -76,22 +66,18 @@ def setup(self, wing, state): deta = self.wing.planform.deta constraints = [ - # dimensionalize moment of inertia and young's modulus - # N == Nsafety*Nmax, - # q >= cbar, - # S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), - S[:-1] >= S[1:] + 0.5*deta*(q[:-1] + q[1:]), - S[-1] >= 1e-10, - Mbar[:-1] >= Mbar[1:] + 0.5*deta*(S[:-1] + S[1:]), - Mbar[-1] >= 1e-10, - M >= Mbar[:-1]*Nsafety*Nmax*W*b/4, + N == Nsafety*Nmax, + q >= N*W/b*cbar, + S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), + S[-1] >= Stip, + M[:-1] >= M[1:] + 0.5*deta*(b/2)*(S[:-1] + S[1:]), + M[-1] >= Mtip, th[0] >= throot, - th[1:] >= th[:1] + 0.5*deta*(Mbar[1:] + Mbar[:-1])/EIbar, - EIbar <= 8*E*I/Nsafety/Nmax/W/b**2, - w[0] >= 1e-10, - w[1:] >= w[:-1] + 0.5*deta*(th[1:] + th[:-1]), - sigma >= M/Sy, - w[-1] <= kappa, + th[1:] >= th[:-1] + 0.5*deta*(b/2)*(M[1:] + M[:-1])/E/I, + w[0] >= wroot, + w[1:] >= w[:-1] + 0.5*deta*(b/2)*(th[1:] + th[:-1]), + sigma >= M[:-1]/Sy, + w[-1]/(b/2) <= kappa, ] self.wingSparJ = hasattr(self.wing.spar, "J") From bbbd56bec81d2ea341b8034775fbd69fb3e74050 Mon Sep 17 00:00:00 2001 From: mjburton Date: Mon, 16 Apr 2018 21:12:37 -0400 Subject: [PATCH 4/8] allow for outboard weights on wing --- gpkitmodels/GP/aircraft/wing/gustloading.py | 4 +-- gpkitmodels/GP/aircraft/wing/sparloading.py | 30 ++++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/gustloading.py b/gpkitmodels/GP/aircraft/wing/gustloading.py index 5abcbe7e..cfbcbf2b 100644 --- a/gpkitmodels/GP/aircraft/wing/gustloading.py +++ b/gpkitmodels/GP/aircraft/wing/gustloading.py @@ -39,9 +39,9 @@ class GustL(SparLoading): return_cosm1 = lambda self, c: hstack( [1e-10, 1-cos(c[self.wing.planform.eta][1:]*pi/2)]) - def setup(self, wing, state): + def setup(self, wing, state, sp=False): exec parse_variables(GustL.__doc__) - self.load = SparLoading.setup(self, wing, state) + self.load = SparLoading.setup(self, wing, state, sp=sp) cbar = self.wing.planform.cbar W = self.W # from SparLoading diff --git a/gpkitmodels/GP/aircraft/wing/sparloading.py b/gpkitmodels/GP/aircraft/wing/sparloading.py index ca0c1b3c..4b56eb84 100644 --- a/gpkitmodels/GP/aircraft/wing/sparloading.py +++ b/gpkitmodels/GP/aircraft/wing/sparloading.py @@ -1,5 +1,5 @@ " spar loading " -from gpkit import Model, parse_variables +from gpkit import Model, parse_variables, SignomialsEnabled from gpkitmodels.GP.beam.beam import Beam from gpkitmodels.GP.aircraft.tail.tail_boom import TailBoomState from numpy import pi @@ -36,7 +36,8 @@ class SparLoading(Model): ---------------------------- Mtw [N*m] local moment due to twisting theta [-] twist deflection - EIbar [-] EIbar + EIbar [-] EIbar + Sout [N] outboard weights LaTex Strings ------------- @@ -52,7 +53,7 @@ def new_qbarFun(self, c): new_SbarFun = None - def setup(self, wing, state): + def setup(self, wing, state, sp=False): self.wing = wing exec parse_variables(SparLoading.__doc__) @@ -65,19 +66,22 @@ def setup(self, wing, state): sigma = self.wing.spar.material.sigma deta = self.wing.planform.deta + if sp: + print "here" + with SignomialsEnabled(): + shear = S[:-1] >= (S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]) + - Sout) + else: + shear = S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]) + constraints = [ - N == Nsafety*Nmax, - q >= N*W/b*cbar, - S[:-1] >= S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]), - S[-1] >= Stip, - M[:-1] >= M[1:] + 0.5*deta*(b/2)*(S[:-1] + S[1:]), - M[-1] >= Mtip, + N == Nsafety*Nmax, q >= N*W/b*cbar, + shear, S[-1] >= Stip, + M[:-1] >= M[1:] + 0.5*deta*(b/2)*(S[:-1] + S[1:]), M[-1] >= Mtip, th[0] >= throot, th[1:] >= th[:-1] + 0.5*deta*(b/2)*(M[1:] + M[:-1])/E/I, - w[0] >= wroot, - w[1:] >= w[:-1] + 0.5*deta*(b/2)*(th[1:] + th[:-1]), - sigma >= M[:-1]/Sy, - w[-1]/(b/2) <= kappa, + w[0] >= wroot, w[1:] >= w[:-1] + 0.5*deta*(b/2)*(th[1:] + th[:-1]), + sigma >= M[:-1]/Sy, w[-1]/(b/2) <= kappa, ] self.wingSparJ = hasattr(self.wing.spar, "J") From 46955f12da69aabce0e1edecee3c8650fc6e2bb2 Mon Sep 17 00:00:00 2001 From: mjburton Date: Thu, 19 Apr 2018 22:06:58 -0400 Subject: [PATCH 5/8] delete unnecessary lines --- gpkitmodels/GP/aircraft/wing/sparloading.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/sparloading.py b/gpkitmodels/GP/aircraft/wing/sparloading.py index 4b56eb84..471af7ac 100644 --- a/gpkitmodels/GP/aircraft/wing/sparloading.py +++ b/gpkitmodels/GP/aircraft/wing/sparloading.py @@ -27,7 +27,6 @@ class SparLoading(Model): -------------------------- q [N/m] distributed wing loading S [N] shear along wing - Mbar [-] wing section root moment M [N*m] wing section root moment th [-] deflection angle w [m] wing deflection @@ -67,7 +66,6 @@ def setup(self, wing, state, sp=False): deta = self.wing.planform.deta if sp: - print "here" with SignomialsEnabled(): shear = S[:-1] >= (S[1:] + 0.5*deta*(b/2.)*(q[:-1] + q[1:]) - Sout) From 08b419f6781fae2c76d95fb282fa626a2882ac53 Mon Sep 17 00:00:00 2001 From: mjburton Date: Fri, 20 Apr 2018 11:42:48 -0400 Subject: [PATCH 6/8] fix cvxopt runs --- gpkitmodels/GP/aircraft/wing/wing_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/wing_test.py b/gpkitmodels/GP/aircraft/wing/wing_test.py index 18c26d5c..cc82c6a1 100644 --- a/gpkitmodels/GP/aircraft/wing/wing_test.py +++ b/gpkitmodels/GP/aircraft/wing/wing_test.py @@ -39,8 +39,7 @@ def wing_test(): 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}"]: + for v in ["Mtip", "Stip", "wroot", "throot"]: l.substitutions[v] = 1e-3 m = Model(perf.Cd, [ @@ -68,8 +67,7 @@ def box_spar(): 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}"]: + for v in ["Mtip", "Stip", "wroot", "throot"]: l.substitutions[v] = 1e-3 m = Model(perf.Cd, [ From 07c738bcaa3a3e00af29e98a587ade907b1d7d1a Mon Sep 17 00:00:00 2001 From: mjburton Date: Fri, 20 Apr 2018 11:49:00 -0400 Subject: [PATCH 7/8] update tip values to allow for feasible solution with cvxopt --- gpkitmodels/GP/aircraft/wing/wing_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpkitmodels/GP/aircraft/wing/wing_test.py b/gpkitmodels/GP/aircraft/wing/wing_test.py index cc82c6a1..0fc87766 100644 --- a/gpkitmodels/GP/aircraft/wing/wing_test.py +++ b/gpkitmodels/GP/aircraft/wing/wing_test.py @@ -40,7 +40,7 @@ def wing_test(): if settings["default_solver"] == "cvxopt": for l in loading: for v in ["Mtip", "Stip", "wroot", "throot"]: - l.substitutions[v] = 1e-3 + l.substitutions[v] = 1e-1 m = Model(perf.Cd, [ loading[1].v == fs.V, @@ -68,7 +68,7 @@ def box_spar(): if settings["default_solver"] == "cvxopt": for l in loading: for v in ["Mtip", "Stip", "wroot", "throot"]: - l.substitutions[v] = 1e-3 + l.substitutions[v] = 1e-2 m = Model(perf.Cd, [ loading[1].v == fs.V, From 6c6cc701787d73771d32d65f2b0cfe10c4aafcd0 Mon Sep 17 00:00:00 2001 From: mjburton Date: Fri, 20 Apr 2018 13:44:10 -0400 Subject: [PATCH 8/8] add drag margin and number of plys to elliptical fuselage --- gpkitmodels/GP/aircraft/fuselage/elliptical_fuselage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gpkitmodels/GP/aircraft/fuselage/elliptical_fuselage.py b/gpkitmodels/GP/aircraft/fuselage/elliptical_fuselage.py index 310cbed2..c74ece4d 100644 --- a/gpkitmodels/GP/aircraft/fuselage/elliptical_fuselage.py +++ b/gpkitmodels/GP/aircraft/fuselage/elliptical_fuselage.py @@ -12,6 +12,7 @@ class FuselageAero(Model): Cf [-] fuselage skin friction coefficient Re [-] fuselage reynolds number Cd [-] fuselage drag coefficient + mfac 1.0 [-] fuselage drag margin """ def setup(self, static, state): @@ -26,7 +27,7 @@ def setup(self, static, state): constraints = [ Re == V*rho*l/mu, Cf >= 0.455/Re**0.3, - Cd >= Cf*k + Cd/mfac >= Cf*k ] return constraints @@ -47,6 +48,7 @@ class Fuselage(Model): rhofuel 6.01 [lbf/gallon] density of 100LL rhocfrp 1.6 [g/cm^3] density of CFRP t [in] fuselage skin thickness + nply 2 [-] number of plys """ material = cfrpfabric @@ -64,7 +66,7 @@ def setup(self): 3*(S/np.pi)**1.6075 >= 2*(l*R*2)**1.6075 + (2*R)**(2*1.6075), Vol <= 4*np.pi/3*(l/2)*R**2, W/mfac >= S*rhocfrp*t*g, - t >= 2*tmin, + t >= nply*tmin, ] return constraints