In this example, we modify the simple wing model proposed by Prof. Warren Hoburg in his thesis to create a simple aircraft model compatible with signomial programming (SP).
from gpkit import Model, Variable, SignomialsEnabled, VarKey, units
import numpy as np
import matplotlib.pyplot as plt
class SimPleAC(Model):
def setup(self):
# Variable definitions...
The simple aircraft borrows a majority of its aerodynamic model from Prof. Warren Hoburg's thesis, with some minor adjustments to make the model a SP. The aircraft is assumed to be in steady-level flight so that thrust equals drag, and the lift equals the weight.
The total weight of the aircraft is the sum of the payload weight
\begin{equation} W \geq W_0 + W_w + W_f \end{equation}
We use the naive
\begin{equation} W_0 + W_w + 0.5 W_f \leq \frac{1}{2} \rho S C_L V^2 \end{equation}
where the lift of the aircraft is equal to weight of the aircraft with half-fuel. We would also like the fully-fueled aircraft to be able to fly at a minimum speed of
\begin{equation} W \leq \frac{1}{2} \rho V_{min}^2 S C_{L_{max}} \end{equation}
The time of flight of the aircraft, which is a useful metric of performance, is simply the range over velocity:
\begin{equation} T_{flight} \geq \frac{Range}{V} \end{equation}
The lift-to-drag ratio is also defined:
\begin{equation}
L/D = \frac{C_L}{C_D}
\end{equation}
# Weight and lift model
constraints += [W >= W_0 + W_w + W_f,
W_0 + W_w + 0.5 * W_f <=
0.5 * rho * S * C_L * V ** 2,
W <= 0.5 * rho * S * C_Lmax * V_min ** 2,
T_flight >= Range / V,
LoD == C_L/C_D]
We assume a constant thrust specific fuel consumption (TSFC) for the 'engine' of the aircraft, which is assumed to provide as much thrust as needed. Since
\begin{equation} W_f \geq TSFC \times T_{flight} \times D \end{equation}
the fuel weight required is the product of the TSFC, time of flight, and the total drag on the aircraft. The drag of the aircraft is the product of dynamic pressure (
\begin{equation} D \geq \frac{1}{2} \rho V^2 S C_D \label{e:d} \end{equation}
The drag coefficient of the aircraft is assumed to be the sum of the fuselage drag, the wing profile drag, and the wing induced drag coefficients:
\begin{equation} C_D \geq C_{D_{fuse}} + C_{D_{wpar}} + C_{D_{ind}} \label{e:cd} \end{equation}
The fuselage drag is a function of its drag area
\begin{equation} C_{D_{fuse}} = \frac{CDA_0}{S} \label{e:cdfuse} \end{equation}
where the
\begin{equation} V_{f_{fuse}} \leq 10 CDA_0 \times meters \label{e:vffuse} \end{equation}
Note that we correct the dimensionality of the volume here, since GPkit automatically checks units.
The wing profile drag is the product of the form factor, the friction drag coefficient, and the wetted area ratio of the wing,
\begin{equation} C_{D_{wpar}} = k C_f S_{wetratio} \label{e:cdwpar} \end{equation}
The Reynolds number of the aircraft wing is approximated
\begin{equation} Re \leq \frac{\rho}{\mu} V \sqrt{\frac{S}{AR}} \label{e:re} \end{equation}
and used to find the friction drag coefficient of wing. We approximate the
\begin{equation} C_f \geq \frac{0.074} {Re^{0.2}} \end{equation}
The induced drag of the wing is calculated with a span efficiency factor e, and is a function of the
\begin{equation} C_{D_{induced}} = \frac{C_L^2}{\pi AR e} \label{e:cdinduced} \end{equation}
# Thrust and drag model
C_D_fuse = CDA0 / S
C_D_wpar = k * C_f * S_wetratio
C_D_ind = C_L ** 2 / (np.pi * A * e)
constraints += [W_f >= TSFC * T_flight * D,
D >= 0.5 * rho * S * C_D * V ** 2,
C_D >= C_D_fuse + C_D_wpar + C_D_ind,
V_f_fuse <= 10*units('m')*CDA0,
Re <= (rho / mu) * V * (S / A) ** 0.5,
C_f >= 0.074 / Re ** 0.2]
The fuel volume model is the main difference between simpleWing and SimPleAC, and introduces the only signomial constraints in the model. Firstly we define the required fuel volume using fuel density
\begin{equation} V_f = \frac{W_f } {\rho_f g} \label{e:vf} \end{equation}
We consider wing fuel tanks and fuselage fuel tanks. The fuselage fuel was defined in the aerodynamic model, where the fuel volume contributes to drag.
\begin{equation} V_{f_{wing}}^2 \leq 0.0009 \frac{S \tau^2}{AR} \label{e:vfwing} \end{equation}
The signomial constraint is introduced here, where the available fuel volume is upper-bounded by the sum of the fuselage and wing fuel volumes.
\begin{equation} V_{f_{avail}} \leq V_{f_{wing}} + V_{f_{fuse}} \label{vfavail} \end{equation}
We constrain the total fuel volume to be less than the available fuel volume.
\begin{equation} V_{f_{avail}} \geq V_{f} \label{e:vfineq} \end{equation}
# Fuel volume model
with SignomialsEnabled():
constraints +=[V_f == W_f / g / rho_f,
V_f_wing**2 <= 0.0009*S**3/A*tau**2,
# linear with b and tau, quadratic with chord
V_f_avail <= V_f_wing + V_f_fuse, #[SP]
V_f_avail >= V_f]
The wing surface weight is a function of the planform area of the wing.
\begin{equation} W_{w_{surf}} \geq W_{w_{coeff2}} S \label{e:wwsurf} \end{equation}
The wing structural weight is a complex posynomial expression that takes into account the root bending moment and shear relief due to presence of fuel in the wings.
\begin{equation} W_{w_{strc}}^2 \geq \frac{W_{w_{coeff1}}^2}{\tau^2} (N_{ult}^2 AR ^ 3 ((W_0+\rho_fgV_{f_{fuse}}) W S)) \label{e:wwstrc} \end{equation}
The total wing weight is lower-bounded.
\begin{equation} W_w \geq W_{w_{surf}} + W_{w_{strc}} \label{e:ww} \end{equation}
# Wing weight model
constraints += [W_w_surf >= W_W_coeff2 * S,
W_w_strc**2. >= W_W_coeff1**2./ tau**2. *
(N_ult**2. * A ** 3. * ((W_0+V_f_fuse*g*rho_f) * W * S)),
W_w >= W_w_surf + W_w_strc]
We have tested a variety of potential objectives for the SimpPleAC model, some of which are as follows:
\begin{itemize}
\item main
method.
\item