Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mjburton
committed
Oct 25, 2017
1 parent
288aa00
commit f4aab0b
Showing
2 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
" wing test " | ||
from gpkitmodels.GP.aircraft.wing.wing import Wing | ||
from gpkit import Variable, Model | ||
|
||
class FlightState(Model): | ||
" state variables " | ||
def setup(self): | ||
|
||
V = Variable("V", 50, "m/s", "airspeed") | ||
rho = Variable("\\rho", 1.255, "kg/m^3", "air density") | ||
mu = Variable("\\mu", 1.5e-5, "N*s/m**2", "air viscosity") | ||
|
||
constraints = [V == V, rho == rho, mu == mu] | ||
|
||
return constraints | ||
|
||
def wing_test(): | ||
" test wing models " | ||
|
||
Wcent = Variable("W_{cent}", 100, "lbf", "center weight") | ||
|
||
W = Wing() | ||
W.substitutions[W.topvar("W")] = 50 | ||
fs = FlightState() | ||
perf = W.flight_model(W, fs) | ||
loading = W.loading(W, Wcent, W.topvar("W"), fs["V"], perf["C_L"]) | ||
|
||
m = Model(perf["C_d"], [W, fs, perf, loading]) | ||
m.solve("mosek") | ||
|
||
if __name__ == "__main__": | ||
wing_test() |