From 13cd40209ed501e6e59fa14224867250956adbd0 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Fri, 4 Mar 2016 19:16:44 -0500 Subject: [PATCH 01/10] monolithic .md --- 1682/gas_hale.md | 194 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 1682/gas_hale.md diff --git a/1682/gas_hale.md b/1682/gas_hale.md new file mode 100644 index 00000000..295f7c7d --- /dev/null +++ b/1682/gas_hale.md @@ -0,0 +1,194 @@ +# Gas HALE model +```python +from numpy import pi +from gpkit import VectorVariable, Variable, Model, units +from gpkit.tools import te_exp_minus1 +import gpkit +import numpy as np +gpkit.settings['latex_modelname'] = False + +class GasPoweredHALE(Model): + def setup(self): + constraints = [] +``` + +## Flight segment definitions +```python + + # define number of segments + NSeg = 3 + #Note: NSeg has to be an odd number + # defining indices of different flight segments + NLoiter = (NSeg-1)/2 + if NSeg == 3: + NCruise = [0,2] + elif NSeg == 7: + Nclimb = [0,2,4,6] + NCruise = [1,5] +``` + +# Fuel weight model +```python + MTOW = Variable('MTOW', 'lbf', 'max take off weight') + W_end = VectorVariable(NSeg, 'W_{end}', 'lbf', 'segment-end weight') + W_fuel = VectorVariable(NSeg, 'W_{fuel}', 'lbf', + 'segment-fuel weight') + W_zfw = Variable('W_{zfw}', 'lbf', 'Zero fuel weight') + W_pay = Variable('W_{pay}',10,'lbf', 'Payload weight') + W_avionics = Variable('W_{avionics}', 2, 'lbf', 'Avionics weight') + f_airframe = Variable('f_{airframe}', 0.25, '-', 'airframe weight fraction') + W_airframe = Variable('W_{airframe}', 'lbf', 'airframe weight') + W_begin = W_end.left # define beginning of segment weight + W_begin[0] = MTOW +``` +## Assumptions + +* Mass take off weight is greater than the end of the first segment weight plus that segment fuel weight. +* The end of each flight segment weight must be greater than the next end of flight segment weight plus the fuel weight of the next flight segment. +* The end of the last flight segment weight must be greater than the zero fuel weight +```python + constraints.extend([MTOW >= W_end[0] + W_fuel[0], + W_end[:-1] >= W_end[1:] + W_fuel[1:], + W_end[-1] >= W_zfw, + W_airframe >= f_airframe*MTOW]) +``` + +# Steady level flight model +## Assumptions +* Steady state flight +* Angle of attack zero +* Thrust equals drag +* Lift equals weight +* The weight is approximated by the average weight of the flight segment. +* The average weight can be approximated by: $W_{avg} = \sqrt{W_{begin} W_{end}}$. Where $W_{begin}$ is the beginning of the flight segment and $W_{end}$ is the end of the flight segment. + +```python + CD = VectorVariable(NSeg, 'C_D', '-', 'Drag coefficient') + CL = VectorVariable(NSeg, 'C_L', '-', 'Lift coefficient') + V = VectorVariable(NSeg, 'V', 'm/s','cruise speed') + rho = VectorVariable(NSeg, r'\rho', 'kg/m^3', 'air density') + S = Variable('S', 16, 'ft^2', 'wing area') + eta_prop = VectorVariable(NSeg, r'\eta_{prop}', [0.8,0.6,0.8], '-', + 'propulsive efficiency') + P_shaft = VectorVariable(NSeg, 'P_{shaft}', 'hp', 'Shaft power') +``` +# Climb model +```python + h_dot = Variable(NSeg, 'h_{dot}', [200,0,0], 'ft/min', 'Climb rate') + constraints.extend([P_shaft >= V*(W_end+W_begin)/2*CD/CL/eta_prop + W_begin*h_dot/eta_prop, + 0.5*rho*CL*S*V**2 >= (W_end+W_begin)/2]) +``` +# Engine Model +```python + W_eng = Variable('W_{eng}', 'lbf', 'Engine weight') + W_engtot = Variable('W_{eng-tot}', 'lbf', 'Installed engine weight') + W_engref = Variable('W_{eng-ref}', 4.4107, 'lbf', 'Reference engine weight') + P_shaftref = Variable('P_{shaft-ref}', 2.295, 'hp', 'reference shaft power') +``` +## Engine Weight constraints +```python + constraints.extend([W_eng/W_engref >= 0.5538*(P_shaft/P_shaftref)**1.075, + W_engtot >= 2.572*W_eng**0.922*units('lbf')**0.078]) +``` +# Weight breakdown +```python + constraints.extend([W_airframe >= f_airframe*MTOW, + W_zfw >= W_pay + W_avionics + W_airframe + W_engtot]) +``` +# Breguet Range +## Assumptions +* Constant speed during each flight section +* Constant BSFC +* The $\ln$ can be approximated using a Taylor-series expansion +```python + z_bre = VectorVariable(NSeg, 'z_{bre}', '-', 'breguet coefficient') + BSFC = VectorVariable(NSeg,'BSFC', [0.5,.55,0.6], 'lbf/hr/hp', 'brake specific fuel consumption') + t = VectorVariable(NSeg, 't', 'days', 'time on station') + R = Variable('R', 200, 'nautical_miles', 'range to station') + g = Variable('g', 9.81, 'm/s^2', 'Gravitational acceleration') + + constraints.extend([z_bre >= V*t*BSFC*CD/CL/eta_prop, + R == V[NCruise]*t[NCruise], + t[NLoiter] == 5*units('days'), + W_fuel/W_end >= te_exp_minus1(z_bre, 3)]) +``` +# Aerodynamics model +## Assumptions +* The wing is a box shape. +* The non-wing drag is a constant +* The stall factor is based off standard airfoil polar. +* Reference length for Reynolds number is teh chord. +* The skin friction is based off of Blasius flat plate. +* The form factor for the wing is constant. +```python + + Cd0 = Variable('C_{d0}', 0.02, '-', 'Non-wing drag coefficient') + CLmax = Variable('C_{L-max}', 1.5, '-', 'Maximum lift coefficient') + e = Variable('e', 0.9, '-', 'Spanwise efficiency') + AR = Variable('AR', '-', 'Aspect ratio') + b = Variable('b', 'ft', 'Span') + mu = Variable(r'\mu', 1.5e-5, 'N*s/m^2', 'Dynamic viscosity') + Re = VectorVariable(NSeg, 'Re', '-', 'Reynolds number') + Cf = VectorVariable(NSeg, 'C_f', '-', 'wing skin friction coefficient') + Kwing = Variable('K_{wing}', 1.3, '-', 'wing form factor') + cl_16 = Variable('cl_{16}', 0.0001, '-', 'profile stall coefficient') + + constraints.extend([CD >= Cd0 + 2*Cf*Kwing + CL**2/(pi*e*AR) + cl_16*CL**16, + b**2 == S*AR, +``` +In place of an actual structural model, we impose $AR \leq 20$. +```python + AR <= 20, + CL <= CLmax, + Re == rho*V/mu*(S/AR)**0.5, + Cf >= 0.074/Re**0.2]) +``` +# Atmosphere model +# Assumptions +* Valid only to the top of the troposphere. +## References +[wp:Density of Air](http://en.wikipedia.org/wiki/Density_of_air#Altitude) +```python + + h = VectorVariable(NSeg, 'h', 'ft', 'Altitude') + gamma = Variable(r'\gamma',1.4,'-', 'Heat capacity ratio of air') + p_sl = Variable('p_{sl}', 101325, 'Pa', 'Pressure at sea level') + T_sl = VectorVariable(NSeg, 'T_{sl}', [288.15,288.15,288.15], 'K', + 'Temperature at sea level') + L_atm = Variable('L_{atm}', 0.0065, 'K/m', 'Temperature lapse rate') + T_atm = VectorVariable(NSeg, 'T_{atm}', 'K', 'Air temperature') + a_atm = VectorVariable(NSeg, 'a_{atm}','m/s', 'Speed of sound at altitude') + R_spec = Variable('R_{spec}', 287.058,'J/kg/K', 'Specific gas constant of air') + TH = (g/R_spec/L_atm).value.magnitude # dimensionless + + constraints.extend([#h <= [20000, 20000, 20000]*units.m, + T_sl >= T_atm + L_atm*h, # Temp decreases w/ altitude + rho == p_sl*T_atm**(TH-1)/R_spec/(T_sl**TH), + h[NLoiter] >= 15000*units('ft'), # makes sure that the loiter occurs above minimum h + ]) +``` +# Wind speed model +```python + V_wind = VectorVariable(NSeg, 'V_{wind}', 'm/s', 'wind speed') + wd_cnst = Variable('wd_{cnst}', 0.0015, 'm/s/ft', + 'wind speed constant predicted by model') + #0.002 is worst case, 0.0015 is mean at 45d + wd_ln = Variable('wd_{ln}', 8.845, 'm/s', + 'linear wind speed variable') + #13.009 is worst case, 8.845 is mean at 45deg + h_min = Variable('h_{min}', 11800, 'ft', 'minimum height') + h_max = Variable('h_{max}', 20866, 'ft', 'maximum height') + + constraints.extend([V_wind >= wd_cnst*h + wd_ln, + V >= V_wind, + h[NCruise] >= h_min]) +``` +# Objective and testing +```python + objective = MTOW + return objective, constraints + +if __name__ == '__main__': + M = GasPoweredHALE() + M.solve() +``` From 76baa9076d49473a37c954a1b15bec5906b92c41 Mon Sep 17 00:00:00 2001 From: bqpd Date: Fri, 4 Mar 2016 19:18:35 -0500 Subject: [PATCH 02/10] Update gas_hale.md --- 1682/gas_hale.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/1682/gas_hale.md b/1682/gas_hale.md index 295f7c7d..8843d3c5 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -144,10 +144,11 @@ In place of an actual structural model, we impose $AR \leq 20$. Cf >= 0.074/Re**0.2]) ``` # Atmosphere model -# Assumptions +## Assumptions * Valid only to the top of the troposphere. + ## References -[wp:Density of Air](http://en.wikipedia.org/wiki/Density_of_air#Altitude) +* [wp:Density of Air](http://en.wikipedia.org/wiki/Density_of_air#Altitude) ```python h = VectorVariable(NSeg, 'h', 'ft', 'Altitude') @@ -183,7 +184,7 @@ In place of an actual structural model, we impose $AR \leq 20$. V >= V_wind, h[NCruise] >= h_min]) ``` -# Objective and testing +# Conclusion ```python objective = MTOW return objective, constraints From d72eb831e419616d1e847a4541f92c32f46d490c Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Fri, 4 Mar 2016 19:26:54 -0500 Subject: [PATCH 03/10] update md file --- 1682/gas_hale.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/1682/gas_hale.md b/1682/gas_hale.md index 8843d3c5..fd739bf5 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -1,5 +1,6 @@ # Gas HALE model ```python + from numpy import pi from gpkit import VectorVariable, Variable, Model, units from gpkit.tools import te_exp_minus1 @@ -29,10 +30,10 @@ class GasPoweredHALE(Model): # Fuel weight model ```python + MTOW = Variable('MTOW', 'lbf', 'max take off weight') W_end = VectorVariable(NSeg, 'W_{end}', 'lbf', 'segment-end weight') - W_fuel = VectorVariable(NSeg, 'W_{fuel}', 'lbf', - 'segment-fuel weight') + W_fuel = VectorVariable(NSeg, 'W_{fuel}', 'lbf', 'segment-fuel weight') W_zfw = Variable('W_{zfw}', 'lbf', 'Zero fuel weight') W_pay = Variable('W_{pay}',10,'lbf', 'Payload weight') W_avionics = Variable('W_{avionics}', 2, 'lbf', 'Avionics weight') @@ -47,6 +48,7 @@ class GasPoweredHALE(Model): * The end of each flight segment weight must be greater than the next end of flight segment weight plus the fuel weight of the next flight segment. * The end of the last flight segment weight must be greater than the zero fuel weight ```python + constraints.extend([MTOW >= W_end[0] + W_fuel[0], W_end[:-1] >= W_end[1:] + W_fuel[1:], W_end[-1] >= W_zfw, @@ -63,6 +65,7 @@ class GasPoweredHALE(Model): * The average weight can be approximated by: $W_{avg} = \sqrt{W_{begin} W_{end}}$. Where $W_{begin}$ is the beginning of the flight segment and $W_{end}$ is the end of the flight segment. ```python + CD = VectorVariable(NSeg, 'C_D', '-', 'Drag coefficient') CL = VectorVariable(NSeg, 'C_L', '-', 'Lift coefficient') V = VectorVariable(NSeg, 'V', 'm/s','cruise speed') @@ -74,12 +77,14 @@ class GasPoweredHALE(Model): ``` # Climb model ```python + h_dot = Variable(NSeg, 'h_{dot}', [200,0,0], 'ft/min', 'Climb rate') constraints.extend([P_shaft >= V*(W_end+W_begin)/2*CD/CL/eta_prop + W_begin*h_dot/eta_prop, 0.5*rho*CL*S*V**2 >= (W_end+W_begin)/2]) ``` # Engine Model ```python + W_eng = Variable('W_{eng}', 'lbf', 'Engine weight') W_engtot = Variable('W_{eng-tot}', 'lbf', 'Installed engine weight') W_engref = Variable('W_{eng-ref}', 4.4107, 'lbf', 'Reference engine weight') @@ -87,11 +92,13 @@ class GasPoweredHALE(Model): ``` ## Engine Weight constraints ```python + constraints.extend([W_eng/W_engref >= 0.5538*(P_shaft/P_shaftref)**1.075, W_engtot >= 2.572*W_eng**0.922*units('lbf')**0.078]) ``` # Weight breakdown ```python + constraints.extend([W_airframe >= f_airframe*MTOW, W_zfw >= W_pay + W_avionics + W_airframe + W_engtot]) ``` @@ -101,6 +108,7 @@ class GasPoweredHALE(Model): * Constant BSFC * The $\ln$ can be approximated using a Taylor-series expansion ```python + z_bre = VectorVariable(NSeg, 'z_{bre}', '-', 'breguet coefficient') BSFC = VectorVariable(NSeg,'BSFC', [0.5,.55,0.6], 'lbf/hr/hp', 'brake specific fuel consumption') t = VectorVariable(NSeg, 't', 'days', 'time on station') @@ -114,14 +122,15 @@ class GasPoweredHALE(Model): ``` # Aerodynamics model ## Assumptions -* The wing is a box shape. +* The wing is a box shape. * The non-wing drag is a constant * The stall factor is based off standard airfoil polar. * Reference length for Reynolds number is teh chord. * The skin friction is based off of Blasius flat plate. -* The form factor for the wing is constant. +* The form factor for the wing is constant. ```python + Cd0 = Variable('C_{d0}', 0.02, '-', 'Non-wing drag coefficient') CLmax = Variable('C_{L-max}', 1.5, '-', 'Maximum lift coefficient') e = Variable('e', 0.9, '-', 'Spanwise efficiency') @@ -138,6 +147,7 @@ class GasPoweredHALE(Model): ``` In place of an actual structural model, we impose $AR \leq 20$. ```python + AR <= 20, CL <= CLmax, Re == rho*V/mu*(S/AR)**0.5, @@ -151,6 +161,7 @@ In place of an actual structural model, we impose $AR \leq 20$. * [wp:Density of Air](http://en.wikipedia.org/wiki/Density_of_air#Altitude) ```python + h = VectorVariable(NSeg, 'h', 'ft', 'Altitude') gamma = Variable(r'\gamma',1.4,'-', 'Heat capacity ratio of air') p_sl = Variable('p_{sl}', 101325, 'Pa', 'Pressure at sea level') @@ -170,6 +181,7 @@ In place of an actual structural model, we impose $AR \leq 20$. ``` # Wind speed model ```python + V_wind = VectorVariable(NSeg, 'V_{wind}', 'm/s', 'wind speed') wd_cnst = Variable('wd_{cnst}', 0.0015, 'm/s/ft', 'wind speed constant predicted by model') @@ -186,6 +198,7 @@ In place of an actual structural model, we impose $AR \leq 20$. ``` # Conclusion ```python + objective = MTOW return objective, constraints From 0bbfba0fe795c778e33a3d033ad559e66e12feed Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Fri, 4 Mar 2016 19:54:30 -0500 Subject: [PATCH 04/10] working with solution table --- 1682/default.latex | 263 +++++++++++++++++++++++++++++++++++++++++++++ 1682/gas_hale.md | 12 ++- 1682/sol.tex | 89 +++++++++++++++ 3 files changed, 361 insertions(+), 3 deletions(-) create mode 100644 1682/default.latex create mode 100644 1682/sol.tex diff --git a/1682/default.latex b/1682/default.latex new file mode 100644 index 00000000..bef63549 --- /dev/null +++ b/1682/default.latex @@ -0,0 +1,263 @@ +\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$else$ +\usepackage{lmodern} +$endif$ +$if(linestretch)$ +\usepackage{setspace} +\setstretch{$linestretch$} +$endif$ +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} + \usepackage[utf8]{inputenc} +$if(euro)$ + \usepackage{eurosym} +$endif$ +\else % if luatex or xelatex + \ifxetex + \usepackage{mathspec} + \else + \usepackage{fontspec} + \fi + \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} +$if(euro)$ + \newcommand{\euro}{€} +$endif$ +$if(mainfont)$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$} +$endif$ +$if(mathfont)$ + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ +$if(CJKmainfont)$ + \usepackage{xeCJK} + \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} +$endif$ +\fi +% use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +% use microtype if available +\IfFileExists{microtype.sty}{% +\usepackage{microtype} +\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +$if(geometry)$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$endif$ +\usepackage{hyperref} +$if(colorlinks)$ +\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref +$endif$ +\hypersetup{unicode=true, +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$, + citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$, + urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$, +$else$ + pdfborder={0 0 0}, +$endif$ + breaklinks=true} +\urlstyle{same} % don't use monospace font for urls +$if(lang)$ +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +$if(babel-newcommands)$ + $babel-newcommands$ +$endif$ +\else + \usepackage{polyglossia} + \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$} +$for(polyglossia-otherlangs)$ + \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} +$endfor$ +\fi +$endif$ +$if(natbib)$ +\usepackage{natbib} +\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} +$endif$ +$if(biblatex)$ +\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex} +$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$ +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +$endif$ +$if(listings)$ +\usepackage{listings} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ +$if(tables)$ +\usepackage{longtable,booktabs} +$endif$ +$if(graphics)$ +\usepackage{graphicx,grffile} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +$endif$ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% ADD YOUR \usepackage{...} COMMANDS HERE +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{longtable} +\usepackage{booktabs} + +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +$if(indent)$ +$else$ +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} +$endif$ +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +$if(numbersections)$ +\setcounter{secnumdepth}{5} +$else$ +\setcounter{secnumdepth}{0} +$endif$ +$if(subparagraph)$ +$else$ +% Redefines (sub)paragraphs to behave more like sections +\ifx\paragraph\undefined\else +\let\oldparagraph\paragraph +\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} +\fi +\ifx\subparagraph\undefined\else +\let\oldsubparagraph\subparagraph +\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} +\fi +$endif$ +$if(dir)$ +\ifxetex + % load bidi as late as possible as it modifies e.g. graphicx + $if(latex-dir-rtl)$ + \usepackage[RTLdocument]{bidi} + $else$ + \usepackage{bidi} + $endif$ +\fi +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ + +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +$endif$ +$if(subtitle)$ +\providecommand{\subtitle}[1]{} +\subtitle{$subtitle$} +$endif$ +$if(author)$ +\author{$for(author)$$author$$sep$ \and $endfor$} +$endif$ +\date{$date$} + +\begin{document} +$if(title)$ +\maketitle +$endif$ +$if(abstract)$ +\begin{abstract} +$abstract$ +\end{abstract} +$endif$ + +$for(include-before)$ +$include-before$ + +$endfor$ +$if(toc)$ +{ +$if(colorlinks)$ +\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$} +$endif$ +\setcounter{tocdepth}{$toc-depth$} +\tableofcontents +} +$endif$ +$if(lot)$ +\listoftables +$endif$ +$if(lof)$ +\listoffigures +$endif$ +$body$ + +$if(natbib)$ +$if(bibliography)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} + +$endif$ +$endif$ +$if(biblatex)$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ + +$endif$ +$for(include-after)$ +$include-after$ + +$endfor$ +\end{document} diff --git a/1682/gas_hale.md b/1682/gas_hale.md index fd739bf5..27743c1d 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -197,12 +197,18 @@ In place of an actual structural model, we impose $AR \leq 20$. h[NCruise] >= h_min]) ``` # Conclusion + ```python objective = MTOW return objective, constraints -if __name__ == '__main__': - M = GasPoweredHALE() - M.solve() +if __name__ == "__main__": + M = GasPoweredHALE() + M.solve() + with open("sol.tex", "w") as f: + f.write(M.solution.table(latex=True)) ``` + +# Solution +\input{sol.tex} diff --git a/1682/sol.tex b/1682/sol.tex new file mode 100644 index 00000000..b79379f0 --- /dev/null +++ b/1682/sol.tex @@ -0,0 +1,89 @@ + +{\footnotesize +\begin{longtable}{llll} +\toprule +Free Variables & Value & Units & Description \\ +\midrule +$AR$ & 20 & $ $ & Aspect ratio \\ +$MTOW$ & 196 & $ [lbf] $ & max take off weight \\ +$W_{airframe}$ & 49 & $ [lbf] $ & airframe weight \\ +$W_{eng-tot}$ & 6.381 & $ [lbf] $ & Installed engine weight \\ +$W_{eng}$ & 2.679 & $ [lbf] $ & Engine weight \\ +$W_{zfw}$ & 67.38 & $ [lbf] $ & Zero fuel weight \\ +$b$ & 17.89 & $ [ft] $ & Span \\ +$C_D$ & [ 0.0619 0.0579 0.0538 ] & $ $ & Drag coefficient \\ +$C_L$ & [ 1.21 1.14 1.12 ] & $ $ & Lift coefficient \\ +$C_f$ & [ 0.00532 0.0055 0.00426 ] & $ $ & wing skin friction coefficient \\ +$P_{shaft}$ & [ 2.5 2.29 2.5 ] & $ [hp] $ & Shaft power \\ +$Re$ & [ 5.2e+05 4.39e+05 1.58e+06 ] & $ $ & Reynolds number \\ +$T_{atm}$ & [ 265 258 265 ] & $ [K] $ & Air temperature \\ +$V$ & [ 33.5 31.3 102 ] & $ [m/s] $ & cruise speed \\ +$V_{wind}$ & [ 29.8 31.3 52 ] & $ [m/s] $ & wind speed \\ +$W_{end}$ & [ 192 68.9 67.4 ] & $ [lbf] $ & segment-end weight \\ +$W_{fuel}$ & [ 3.81 123 1.51 ] & $ [lbf] $ & segment-fuel weight \\ +$\rho$ & [ 0.854 0.771 0.854 ] & $ [kg/m^3] $ & air density \\ +$h$ & [ 1.18e+04 1.5e+04 1.18e+04 ] & $ [ft] $ & Altitude \\ +$t$ & [ 0.128 5 0.042 ] & $ [day] $ & time on station \\ +$z_{bre}$ & [ 0.0196 1.05 0.0221 ] & $ $ & breguet coefficient \\ +\bottomrule +\end{longtable}} + +{\footnotesize +\begin{longtable}{llll} +\toprule +Constants & Value & Units & Description \\ +\midrule +$C_{L-max}$ & 1.5 & $ $ & Maximum lift coefficient \\ +$C_{d0}$ & 0.02 & $ $ & Non-wing drag coefficient \\ +$K_{wing}$ & 1.3 & $ $ & wing form factor \\ +$L_{atm}$ & 0.0065 & $ [K/m] $ & Temperature lapse rate \\ +$P_{shaft-ref}$ & 2.295 & $ [hp] $ & reference shaft power \\ +$R$ & 200 & $ [nmi] $ & range to station \\ +$R_{spec}$ & 287.1 & $ [J/K/kg] $ & Specific gas constant of air \\ +$S$ & 16 & $ [ft^2] $ & wing area \\ +$W_{avionics}$ & 2 & $ [lbf] $ & Avionics weight \\ +$W_{eng-ref}$ & 4.411 & $ [lbf] $ & Reference engine weight \\ +$W_{pay}$ & 10 & $ [lbf] $ & Payload weight \\ +$\mu$ & 1.5e-05 & $ [N*s/m^2] $ & Dynamic viscosity \\ +$cl_{16}$ & 0.0001 & $ $ & profile stall coefficient \\ +$e$ & 0.9 & $ $ & Spanwise efficiency \\ +$f_{airframe}$ & 0.25 & $ $ & airframe weight fraction \\ +$h_{dot}$ & 3 & $ [ft/min] $ & Climb rate \\ +$h_{min}$ & 1.18e+04 & $ [ft] $ & minimum height \\ +$p_{sl}$ & 1.013e+05 & $ [Pa] $ & Pressure at sea level \\ +$wd_{cnst}$ & 0.0015 & $ [m/ft/s] $ & wind speed constant predicted by model \\ +$wd_{ln}$ & 8.845 & $ [m/s] $ & linear wind speed variable \\ +$BSFC$ & [ 0.5 0.55 0.6 ] & $ [lbf/hp/hr] $ & brake specific fuel consumption \\ +$T_{sl}$ & [ 288 288 288 ] & $ [K] $ & Temperature at sea level \\ +$\eta_{prop}$ & [ 0.8 0.6 0.8 ] & $ $ & propulsive efficiency \\ +\bottomrule +\end{longtable}} + +{\footnotesize +\begin{longtable}{llll} +\toprule +Sensitivities & Value & Units & Description \\ +\midrule +$f_{airframe}$ & 5.373 & $ $ & airframe weight fraction \\ +$wd_{cnst}$ & 4.916 & $ $ & wind speed constant predicted by model \\ +$C_{d0}$ & 2.816 & $ $ & Non-wing drag coefficient \\ +$BSFC$ & [ 0.135 7.21 0.163 ] & $ $ & brake specific fuel consumption \\ +$K_{wing}$ & 1.999 & $ $ & wing form factor \\ +$wd_{ln}$ & 1.933 & $ $ & linear wind speed variable \\ +$W_{pay}$ & 1.096 & $ $ & Payload weight \\ +$R_{spec}$ & 0.7217 & $ $ & Specific gas constant of air \\ +$W_{eng-ref}$ & 0.6451 & $ $ & Reference engine weight \\ +$\mu$ & 0.3997 & $ $ & Dynamic viscosity \\ +$L_{atm}$ & 0.3118 & $ $ & Temperature lapse rate \\ +$R$ & 0.2985 & $ $ & range to station \\ +$W_{avionics}$ & 0.2193 & $ $ & Avionics weight \\ +$h_{min}$ & 0.1374 & $ $ & minimum height \\ +$T_{sl}$ & [ 0.224 0.182 0.00438 ] & $ $ & Temperature at sea level \\ +$cl_{16}$ & 0.1257 & $ $ & profile stall coefficient \\ +$S$ & -0.5218 & $ $ & wing area \\ +$P_{shaft-ref}$ & -0.6935 & $ $ & reference shaft power \\ +$p_{sl}$ & -0.7217 & $ $ & Pressure at sea level \\ +$\eta_{prop}$ & [ -0.822 -7.21 -0.171 ] & $ $ & propulsive efficiency \\ +$e$ & -3.251 & $ $ & Spanwise efficiency \\ +\bottomrule +\end{longtable}} From 296a1da62f818710e7165415a36318dff236bd5e Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Fri, 4 Mar 2016 19:58:47 -0500 Subject: [PATCH 05/10] linebreaks --- 1682/gas_hale.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/1682/gas_hale.md b/1682/gas_hale.md index 27743c1d..6894c3c2 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -13,6 +13,7 @@ class GasPoweredHALE(Model): constraints = [] ``` + ## Flight segment definitions ```python @@ -28,6 +29,7 @@ class GasPoweredHALE(Model): NCruise = [1,5] ``` + # Fuel weight model ```python @@ -42,6 +44,7 @@ class GasPoweredHALE(Model): W_begin = W_end.left # define beginning of segment weight W_begin[0] = MTOW ``` + ## Assumptions * Mass take off weight is greater than the end of the first segment weight plus that segment fuel weight. @@ -55,6 +58,7 @@ class GasPoweredHALE(Model): W_airframe >= f_airframe*MTOW]) ``` + # Steady level flight model ## Assumptions * Steady state flight @@ -75,6 +79,7 @@ class GasPoweredHALE(Model): 'propulsive efficiency') P_shaft = VectorVariable(NSeg, 'P_{shaft}', 'hp', 'Shaft power') ``` + # Climb model ```python @@ -82,6 +87,7 @@ class GasPoweredHALE(Model): constraints.extend([P_shaft >= V*(W_end+W_begin)/2*CD/CL/eta_prop + W_begin*h_dot/eta_prop, 0.5*rho*CL*S*V**2 >= (W_end+W_begin)/2]) ``` + # Engine Model ```python @@ -90,18 +96,21 @@ class GasPoweredHALE(Model): W_engref = Variable('W_{eng-ref}', 4.4107, 'lbf', 'Reference engine weight') P_shaftref = Variable('P_{shaft-ref}', 2.295, 'hp', 'reference shaft power') ``` + ## Engine Weight constraints ```python constraints.extend([W_eng/W_engref >= 0.5538*(P_shaft/P_shaftref)**1.075, W_engtot >= 2.572*W_eng**0.922*units('lbf')**0.078]) ``` + # Weight breakdown ```python constraints.extend([W_airframe >= f_airframe*MTOW, W_zfw >= W_pay + W_avionics + W_airframe + W_engtot]) ``` + # Breguet Range ## Assumptions * Constant speed during each flight section @@ -120,6 +129,8 @@ class GasPoweredHALE(Model): t[NLoiter] == 5*units('days'), W_fuel/W_end >= te_exp_minus1(z_bre, 3)]) ``` + + # Aerodynamics model ## Assumptions * The wing is a box shape. @@ -145,6 +156,7 @@ class GasPoweredHALE(Model): constraints.extend([CD >= Cd0 + 2*Cf*Kwing + CL**2/(pi*e*AR) + cl_16*CL**16, b**2 == S*AR, ``` + In place of an actual structural model, we impose $AR \leq 20$. ```python @@ -153,6 +165,7 @@ In place of an actual structural model, we impose $AR \leq 20$. Re == rho*V/mu*(S/AR)**0.5, Cf >= 0.074/Re**0.2]) ``` + # Atmosphere model ## Assumptions * Valid only to the top of the troposphere. @@ -179,6 +192,8 @@ In place of an actual structural model, we impose $AR \leq 20$. h[NLoiter] >= 15000*units('ft'), # makes sure that the loiter occurs above minimum h ]) ``` + + # Wind speed model ```python @@ -196,8 +211,9 @@ In place of an actual structural model, we impose $AR \leq 20$. V >= V_wind, h[NCruise] >= h_min]) ``` -# Conclusion + +# Conclusion ```python objective = MTOW @@ -210,5 +226,6 @@ if __name__ == "__main__": f.write(M.solution.table(latex=True)) ``` + # Solution \input{sol.tex} From af9df3b2ab09fa95b4b44280dc53d1a57185a238 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 5 Mar 2016 02:18:09 -0500 Subject: [PATCH 06/10] update gitignore to ignore generated tex files etc --- .gitignore | 5 +++ 1682/gas_hale.md | 4 +-- 1682/sol.tex | 89 ------------------------------------------------ 3 files changed, 7 insertions(+), 91 deletions(-) delete mode 100644 1682/sol.tex diff --git a/.gitignore b/.gitignore index ab983c66..ea8618c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# documentation temp files +*.md.py +*.aux +*.generated.tex + # iPython checkpoint folders .ipynb_checkpoints/ diff --git a/1682/gas_hale.md b/1682/gas_hale.md index 6894c3c2..f42172e8 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -222,10 +222,10 @@ In place of an actual structural model, we impose $AR \leq 20$. if __name__ == "__main__": M = GasPoweredHALE() M.solve() - with open("sol.tex", "w") as f: + with open("sol.generated.tex", "w") as f: f.write(M.solution.table(latex=True)) ``` # Solution -\input{sol.tex} +\input{sol.generated.tex} diff --git a/1682/sol.tex b/1682/sol.tex deleted file mode 100644 index b79379f0..00000000 --- a/1682/sol.tex +++ /dev/null @@ -1,89 +0,0 @@ - -{\footnotesize -\begin{longtable}{llll} -\toprule -Free Variables & Value & Units & Description \\ -\midrule -$AR$ & 20 & $ $ & Aspect ratio \\ -$MTOW$ & 196 & $ [lbf] $ & max take off weight \\ -$W_{airframe}$ & 49 & $ [lbf] $ & airframe weight \\ -$W_{eng-tot}$ & 6.381 & $ [lbf] $ & Installed engine weight \\ -$W_{eng}$ & 2.679 & $ [lbf] $ & Engine weight \\ -$W_{zfw}$ & 67.38 & $ [lbf] $ & Zero fuel weight \\ -$b$ & 17.89 & $ [ft] $ & Span \\ -$C_D$ & [ 0.0619 0.0579 0.0538 ] & $ $ & Drag coefficient \\ -$C_L$ & [ 1.21 1.14 1.12 ] & $ $ & Lift coefficient \\ -$C_f$ & [ 0.00532 0.0055 0.00426 ] & $ $ & wing skin friction coefficient \\ -$P_{shaft}$ & [ 2.5 2.29 2.5 ] & $ [hp] $ & Shaft power \\ -$Re$ & [ 5.2e+05 4.39e+05 1.58e+06 ] & $ $ & Reynolds number \\ -$T_{atm}$ & [ 265 258 265 ] & $ [K] $ & Air temperature \\ -$V$ & [ 33.5 31.3 102 ] & $ [m/s] $ & cruise speed \\ -$V_{wind}$ & [ 29.8 31.3 52 ] & $ [m/s] $ & wind speed \\ -$W_{end}$ & [ 192 68.9 67.4 ] & $ [lbf] $ & segment-end weight \\ -$W_{fuel}$ & [ 3.81 123 1.51 ] & $ [lbf] $ & segment-fuel weight \\ -$\rho$ & [ 0.854 0.771 0.854 ] & $ [kg/m^3] $ & air density \\ -$h$ & [ 1.18e+04 1.5e+04 1.18e+04 ] & $ [ft] $ & Altitude \\ -$t$ & [ 0.128 5 0.042 ] & $ [day] $ & time on station \\ -$z_{bre}$ & [ 0.0196 1.05 0.0221 ] & $ $ & breguet coefficient \\ -\bottomrule -\end{longtable}} - -{\footnotesize -\begin{longtable}{llll} -\toprule -Constants & Value & Units & Description \\ -\midrule -$C_{L-max}$ & 1.5 & $ $ & Maximum lift coefficient \\ -$C_{d0}$ & 0.02 & $ $ & Non-wing drag coefficient \\ -$K_{wing}$ & 1.3 & $ $ & wing form factor \\ -$L_{atm}$ & 0.0065 & $ [K/m] $ & Temperature lapse rate \\ -$P_{shaft-ref}$ & 2.295 & $ [hp] $ & reference shaft power \\ -$R$ & 200 & $ [nmi] $ & range to station \\ -$R_{spec}$ & 287.1 & $ [J/K/kg] $ & Specific gas constant of air \\ -$S$ & 16 & $ [ft^2] $ & wing area \\ -$W_{avionics}$ & 2 & $ [lbf] $ & Avionics weight \\ -$W_{eng-ref}$ & 4.411 & $ [lbf] $ & Reference engine weight \\ -$W_{pay}$ & 10 & $ [lbf] $ & Payload weight \\ -$\mu$ & 1.5e-05 & $ [N*s/m^2] $ & Dynamic viscosity \\ -$cl_{16}$ & 0.0001 & $ $ & profile stall coefficient \\ -$e$ & 0.9 & $ $ & Spanwise efficiency \\ -$f_{airframe}$ & 0.25 & $ $ & airframe weight fraction \\ -$h_{dot}$ & 3 & $ [ft/min] $ & Climb rate \\ -$h_{min}$ & 1.18e+04 & $ [ft] $ & minimum height \\ -$p_{sl}$ & 1.013e+05 & $ [Pa] $ & Pressure at sea level \\ -$wd_{cnst}$ & 0.0015 & $ [m/ft/s] $ & wind speed constant predicted by model \\ -$wd_{ln}$ & 8.845 & $ [m/s] $ & linear wind speed variable \\ -$BSFC$ & [ 0.5 0.55 0.6 ] & $ [lbf/hp/hr] $ & brake specific fuel consumption \\ -$T_{sl}$ & [ 288 288 288 ] & $ [K] $ & Temperature at sea level \\ -$\eta_{prop}$ & [ 0.8 0.6 0.8 ] & $ $ & propulsive efficiency \\ -\bottomrule -\end{longtable}} - -{\footnotesize -\begin{longtable}{llll} -\toprule -Sensitivities & Value & Units & Description \\ -\midrule -$f_{airframe}$ & 5.373 & $ $ & airframe weight fraction \\ -$wd_{cnst}$ & 4.916 & $ $ & wind speed constant predicted by model \\ -$C_{d0}$ & 2.816 & $ $ & Non-wing drag coefficient \\ -$BSFC$ & [ 0.135 7.21 0.163 ] & $ $ & brake specific fuel consumption \\ -$K_{wing}$ & 1.999 & $ $ & wing form factor \\ -$wd_{ln}$ & 1.933 & $ $ & linear wind speed variable \\ -$W_{pay}$ & 1.096 & $ $ & Payload weight \\ -$R_{spec}$ & 0.7217 & $ $ & Specific gas constant of air \\ -$W_{eng-ref}$ & 0.6451 & $ $ & Reference engine weight \\ -$\mu$ & 0.3997 & $ $ & Dynamic viscosity \\ -$L_{atm}$ & 0.3118 & $ $ & Temperature lapse rate \\ -$R$ & 0.2985 & $ $ & range to station \\ -$W_{avionics}$ & 0.2193 & $ $ & Avionics weight \\ -$h_{min}$ & 0.1374 & $ $ & minimum height \\ -$T_{sl}$ & [ 0.224 0.182 0.00438 ] & $ $ & Temperature at sea level \\ -$cl_{16}$ & 0.1257 & $ $ & profile stall coefficient \\ -$S$ & -0.5218 & $ $ & wing area \\ -$P_{shaft-ref}$ & -0.6935 & $ $ & reference shaft power \\ -$p_{sl}$ & -0.7217 & $ $ & Pressure at sea level \\ -$\eta_{prop}$ & [ -0.822 -7.21 -0.171 ] & $ $ & propulsive efficiency \\ -$e$ & -3.251 & $ $ & Spanwise efficiency \\ -\bottomrule -\end{longtable}} From 993936feff0ae3fe2b9371e73501b469926cce07 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 5 Mar 2016 14:09:18 -0500 Subject: [PATCH 07/10] use new #inPDF flag --- 1682/gas_hale.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/1682/gas_hale.md b/1682/gas_hale.md index f42172e8..f332b99d 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -1,5 +1,6 @@ # Gas HALE model ```python +#inPDF: skip from numpy import pi from gpkit import VectorVariable, Variable, Model, units @@ -222,10 +223,12 @@ In place of an actual structural model, we impose $AR \leq 20$. if __name__ == "__main__": M = GasPoweredHALE() M.solve() - with open("sol.generated.tex", "w") as f: - f.write(M.solution.table(latex=True)) ``` # Solution -\input{sol.generated.tex} +```python +#inPDF: replace with sol.generated.tex + with open("sol.generated.tex", "w") as f: + f.write(M.solution.table(latex=True)) +``` From f7b0423143bc16c12e6d2842a3b3d05fdfd62b20 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 5 Mar 2016 14:13:35 -0500 Subject: [PATCH 08/10] add build script --- 1682/build.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 1682/build.sh diff --git a/1682/build.sh b/1682/build.sh new file mode 100755 index 00000000..80124871 --- /dev/null +++ b/1682/build.sh @@ -0,0 +1,4 @@ +python -c 'import gpkit; exec gpkit.mdmake("gas_hale.md")' +pandoc --template default.latex gas_hale.md.tex.md -o gas_hale.pdf + + From 465cdd35b1cb0964824b2b361d716d82fc990931 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 5 Mar 2016 14:35:27 -0500 Subject: [PATCH 09/10] add interim tex files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ea8618c3..34976985 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.md.py *.aux *.generated.tex +*.md.tex.md # iPython checkpoint folders .ipynb_checkpoints/ From 2f5fac548f55cd83dfd14c81eda29f363b350e0d Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 5 Mar 2016 14:44:47 -0500 Subject: [PATCH 10/10] add lines after bulleted lists --- 1682/gas_hale.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/1682/gas_hale.md b/1682/gas_hale.md index f332b99d..69d0ddb0 100644 --- a/1682/gas_hale.md +++ b/1682/gas_hale.md @@ -51,6 +51,7 @@ class GasPoweredHALE(Model): * Mass take off weight is greater than the end of the first segment weight plus that segment fuel weight. * The end of each flight segment weight must be greater than the next end of flight segment weight plus the fuel weight of the next flight segment. * The end of the last flight segment weight must be greater than the zero fuel weight + ```python constraints.extend([MTOW >= W_end[0] + W_fuel[0], @@ -117,6 +118,7 @@ class GasPoweredHALE(Model): * Constant speed during each flight section * Constant BSFC * The $\ln$ can be approximated using a Taylor-series expansion + ```python z_bre = VectorVariable(NSeg, 'z_{bre}', '-', 'breguet coefficient') @@ -140,6 +142,7 @@ class GasPoweredHALE(Model): * Reference length for Reynolds number is teh chord. * The skin friction is based off of Blasius flat plate. * The form factor for the wing is constant. + ```python @@ -173,6 +176,7 @@ In place of an actual structural model, we impose $AR \leq 20$. ## References * [wp:Density of Air](http://en.wikipedia.org/wiki/Density_of_air#Altitude) + ```python