-
Notifications
You must be signed in to change notification settings - Fork 40
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
Showing
44 changed files
with
2,245 additions
and
394 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import 'theme.css'; | ||
|
||
div[class^='highlight-breakdowns'] pre { | ||
line-height: 1.2 !important; | ||
} |
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
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 |
---|---|---|
@@ -1,27 +1,23 @@ | ||
|
||
Optimal Cost | ||
------------ | ||
1.621 | ||
┃┓ ┓ ┓ ┓ ┓ | ||
┃┃ ┃ ┃ ┃ ┣╸th[2]╶⎨ | ||
┃┃ ┃ ┃ ┣╸w[2] ┛ (0.285) | ||
┃┃ ┃ ┃ ┃ (0.384m) ┣╸th[1]╶⎨ | ||
┃┃ ┃ ┣╸w[3] ┛ ┣╸w[1]╶⎨ | ||
┃┃ ┃ ┃ (0.76m) ┣╸th[3] ┣╸th[2]╶⎨ | ||
┃┃ ┃ ┃ ┛ (0.341) ┛ | ||
┃┃ ┣╸w[4] ┃ ┣╸th[2]╶⎨ | ||
┃┃ ┃ (1.18m) ┛ ┛ | ||
Cost╺┫┃ ┃ ┣╸th[3] ┣╸th[2]╶⎨ | ||
(1.62m) ┃┣╸w[5] ┃ ┛ ┛ | ||
┃┃ (1.62m) ┃ ┓ ┓ | ||
┃┃ ┃ ┣╸th[4] ┣╸th[2]╶⎨ | ||
┃┃ ┛ ┛ (0.363) ┛ | ||
┃┃ ┓ ┓ | ||
┃┃ ┣╸th[5] ┣╸th[2]╶⎨ | ||
┃┃ ┛ (0.367) ┛ | ||
┃┃ ┓ ┓ | ||
┃┃ ┣╸th[4] ┣╸th[2]╶⎨ | ||
┃┛ ┛ ┛ | ||
|
||
Free Variables | ||
-------------- | ||
dx : 1.2 [m] Length of an element | ||
M : [ 1.98e+03 1.27e+03 713 317 79.2 0.0002 ] [N·m] Internal moment | ||
V : [ 660 528 396 264 132 0.0002 ] [N] Internal shear | ||
th : [ 0.0002 0.177 0.285 0.341 0.363 0.367 ] Slope | ||
w : [ 0.0002 0.107 0.384 0.76 1.18 1.62 ] [m] Displacement | ||
|
||
Most Sensitive Variables | ||
------------------------ | ||
L : +4 Overall beam length | ||
EI : -1 Bending stiffness | ||
q : [ +0.0072 +0.042 +0.12 +0.23 +0.37 +0.22 ] Distributed load | ||
|
||
Most Sensitive Constraints | ||
-------------------------- | ||
+4 : L = 5·dx | ||
+1 : w[5] ≥ w[4] + 0.5·dx·(th[5] + th[4]) | ||
+0.74 : th[2] ≥ th[1] + 0.5·dx·(M[2] + M[1])/EI | ||
+0.73 : w[4] ≥ w[3] + 0.5·dx·(th[4] + th[3]) | ||
+0.64 : M[1] ≥ M[2] + 0.5·dx·(V[1] + V[2]) | ||
|
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,40 @@ | ||
"An example to show off Breakdowns" | ||
import pickle | ||
from gpkit.breakdowns import Breakdowns | ||
|
||
# the code to create solar.p is in ./breakdowns/solartest.py | ||
sol = pickle.load(open("solar.p", "rb")) | ||
bds = Breakdowns(sol) | ||
|
||
print("Cost breakdown (you may be familiar with this from solution tables)") | ||
print("==============") | ||
bds.plot("cost") | ||
|
||
print("Variable breakdowns (note the two methods of access)") | ||
print("===================") | ||
varkey, = sol["variables"].keymap[("Mission.FlightSegment.AircraftPerf" | ||
".AircraftDrag.Poper")] | ||
bds.plot(varkey) | ||
bds.plot("AircraftPerf.AircraftDrag.MotorPerf.Q") | ||
|
||
print("Combining the two above by increasing maxwidth") | ||
print("----------------------------------------------") | ||
bds.plot("AircraftPerf.AircraftDrag.Poper", maxwidth=105) | ||
|
||
print("Model sensitivity breakdowns (note the two methods of access)") | ||
print("============================") | ||
bds.plot("model sensitivities") | ||
bds.plot("Aircraft") | ||
|
||
print("Exhaustive variable breakdown traces (and configuration arguments)") | ||
print("====================================") | ||
# often useful as a reference point when reading traces | ||
bds.plot("AircraftPerf.AircraftDrag.Poper", height=12) | ||
# includes factors, can be useful for reading traces as well | ||
bds.plot("AircraftPerf.AircraftDrag.Poper", showlegend=True) | ||
print("\nPermissivity = 2 (the default)") | ||
print("----------------") | ||
bds.trace("AircraftPerf.AircraftDrag.Poper") | ||
print("\nPermissivity = 1 (stops at Pelec = v·i)") | ||
print("----------------") | ||
bds.trace("AircraftPerf.AircraftDrag.Poper", permissivity=1) |
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,6 @@ | ||
from solar.solar import * | ||
Vehicle = Aircraft(Npod=3, sp=True) | ||
M = Mission(Vehicle, latitude=[20]) | ||
M.cost = M[M.aircraft.Wtotal] | ||
|
||
M.localsolve().save("solar.p") |
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,210 @@ | ||
Cost breakdown (you may be familiar with this from solution tables) | ||
============== | ||
|
||
┃┓ ┓ ┓ ┓ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┣╸Battery.W ┣╸Battery.E ┣╸AircraftPerf.AircraftDrag.Poper╶⎨ | ||
┃┃ ┃ (370lbf) ┃ (165,913kJ) ┃ (3,194W) | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
Cost╺┫┃ ┃ ┃ ┛ | ||
(699lbf) ┃┣╸Wtotal ┛ ┛ ┣╸SolarCells.S | ||
┃┃ (699lbf) ┓ ┓ | ||
┃┃ ┃ ┣╸Wing.BoxSpar.W╶⎨ | ||
┃┃ ┣╸Wing.W ┛ (96.1lbf) | ||
┃┃ ┛ (139lbf) ┣╸Wing.WingSecondStruct.W╶⎨ | ||
┃┃ ┣╸Motor.W╶⎨ | ||
┃┃ ┣╸SolarCells.W╶⎨ | ||
┃┃ ┣╸Empennage.W | ||
┃┃ ┣╸Wavn | ||
┃┛ ┣╸[6 terms] | ||
|
||
Variable breakdowns (note the two methods of access) | ||
=================== | ||
|
||
┃┓ ┓ ┓ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┣╸MotorPerf.Q╶⎨ | ||
AircraftPerf.AircraftDrag.Poper╺┫┣╸MotorPerf.Pelec ┣╸MotorPerf.i ┃ (4.8N·m) | ||
(3,194W) ┃┃ (0.685kW) ┃ (36.8A) ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┛ | ||
┃┃ ┃ ┣╸i0 | ||
┃┛ ┛ ┛ (4.5A, fixed) | ||
┃┣╸Pavn | ||
┃┣╸Ppay | ||
|
||
|
||
┃┓ | ||
AircraftPerf.AircraftDrag.MotorPerf.Q╺┫┃ | ||
(4.8N·m) ┃┣╸..ActuatorProp.CP | ||
┃┛ (0.00291) | ||
|
||
Combining the two above by increasing maxwidth | ||
---------------------------------------------- | ||
|
||
┃┓ ┓ ┓ ┓ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┣╸MotorPerf.Q ┣╸ActuatorProp.CP | ||
AircraftPerf.AircraftDrag.Poper╺┫┣╸MotorPerf.Pelec ┣╸MotorPerf.i ┃ (4.8N·m) ┃ (0.00291) | ||
(3,194W) ┃┃ (0.685kW) ┃ (36.8A) ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┛ ┛ | ||
┃┃ ┃ ┣╸i0 | ||
┃┛ ┛ ┛ (4.5A, fixed) | ||
┃┣╸Pavn | ||
┃┣╸Ppay | ||
|
||
Model sensitivity breakdowns (note the two methods of access) | ||
============================ | ||
|
||
┃┓ ┓ ┓ ┓ ┓ | ||
┃┃ ┃ ┃ ┃ ┃ | ||
┃┃ ┃ ┃ ┃ ┣╸ActuatorProp╶⎨ | ||
┃┃ ┃ ┃ ┃ ┛ | ||
┃┃ ┃ ┣╸AircraftPerf ┣╸AircraftDrag ┣╸MotorPerf╶⎨ | ||
┃┃ ┃ ┃ ┃ ┓ | ||
┃┣╸Mission ┣╸FlightSegment ┃ ┃ ┣╸[17 terms] | ||
┃┃ ┃ ┛ ┛ ┛ | ||
┃┃ ┃ ┣╸FlightState╶⎨ | ||
Model╺┫┃ ┃ ┣╸GustL╶⎨ | ||
┃┃ ┃ ┣╸SteadyLevelFlight╶⎨ | ||
┃┃ ┛ ┣╸[49 terms] | ||
┃┛ ┣╸Climb╶⎨ | ||
┃┓ | ||
┃┃ | ||
┃┃ | ||
┃┣╸Aircraft╶⎨ | ||
┃┃ | ||
┃┛ | ||
┃┣╸g = 9.81m/s² | ||
|
||
|
||
┃┓ ┣╸etadischarge = 0.98 | ||
┃┃ ┛ | ||
┃┃ ┣╸W ≥ E·minSOC/hbatt/etaRTE/etapack·g | ||
┃┃ ┣╸etaRTE = 0.95 | ||
┃┣╸Battery ┣╸etapack = 0.85 | ||
┃┃ ┣╸hbatt = 350W·hr/kg | ||
┃┃ ┣╸minSOC = 1.03 | ||
┃┛ ┛ | ||
┃┓ | ||
Aircraft╺┫┃ | ||
┃┣╸Wing╶⎨ | ||
┃┃ | ||
┃┛ | ||
┃┣╸Wtotal/mfac ≥ Fuselage.W[0,0] + Fuselage.W[1,0] + Fuselage.W[2,0] … | ||
┃┛ | ||
┃┣╸mfac = 1.05 | ||
┃┛ | ||
┃┣╸Empennage╶⎨ | ||
┃┣╸[23 terms] | ||
┃┛ | ||
|
||
Exhaustive variable breakdown traces (and configuration arguments) | ||
==================================== | ||
|
||
┃┓ ┓ ┓ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
AircraftPerf.AircraftDrag.Poper╺┫┣╸MotorPerf.Pelec ┣╸MotorPerf.i ┣╸MotorPerf.Q╶⎨ | ||
(3,194W) ┃┃ (0.685kW) ┃ (36.8A) ┃ (4.8N·m) | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┃ | ||
┃┃ ┃ ┛ | ||
┃┛ ┛ ┣╸i0 | ||
┃┣╸Pavn | ||
|
||
|
||
┃╤╤┯╤┯╤┯┯╤┓ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│DCBA┣╸ActuatorProp.CP | ||
AircraftPerf.AircraftDrag.Poper╺┫╎HGFE╎││╎┃ (0.00291) | ||
(3,194W) ┃J╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╎││╎┃ | ||
┃╎╎│╎│╧┷┷╧┛ | ||
┃╎╎│╎│┣╸i0 (4.5A, fixed) | ||
┃╎╧┷╧┷┛ | ||
┃╎┣╸Pavn (200W, fixed) | ||
┃╧┣╸Ppay (100W, fixed) | ||
|
||
A 4.53e-05·FlightState.rho·ActuatorProp.omega²·Propeller.R⁵ ×1,653N·m [free factor] | ||
B ActuatorProp.Q = 4.8N·m | ||
C MotorPerf.Q = 4.8N·m | ||
D Kv ×64.2rpm/V [free factor] | ||
E MotorPerf.i = 36.8A | ||
F MotorPerf.v ×18.6V [free factor] | ||
G MotorPerf.Pelec = 0.685kW | ||
H Nprop ×4, fixed | ||
J mpower ×1.05, fixed | ||
|
||
Permissivity = 2 (the default) | ||
---------------- | ||
|
||
AircraftPerf.AircraftDrag.Poper (3,194W) | ||
which in: Poper/mpower ≥ Pavn + Ppay + Pelec·Nprop (sensitivity +5.6) | ||
{ through a factor of AircraftPerf.AircraftDrag.mpower (1.05, fixed) } | ||
breaks down into 3 monomials: | ||
1) forming 90% of the RHS and 90% of the total: | ||
{ through a factor of Nprop (4, fixed) } | ||
AircraftPerf.AircraftDrag.MotorPerf.Pelec (0.685kW) | ||
which in: Pelec = v·i (sensitivity -5.1) | ||
breaks down into: | ||
{ through a factor of AircraftPerf.AircraftDrag.MotorPerf.v (18.6V) } | ||
AircraftPerf.AircraftDrag.MotorPerf.i (36.8A) | ||
which in: i ≥ Q·Kv + i0 (sensitivity +5.4) | ||
breaks down into 2 monomials: | ||
1) forming 87% of the RHS and 79% of the total: | ||
{ through a factor of Kv (64.2rpm/V) } | ||
AircraftPerf.AircraftDrag.MotorPerf.Q (4.8N·m) | ||
which in: Q = Q (sensitivity -4.7) | ||
breaks down into: | ||
AircraftPerf.AircraftDrag.ActuatorProp.Q (4.8N·m) | ||
which in: CP ≤ Q·omega/(0.5·rho·(omega·R)³·π·R²) (sensitivity +4.7) | ||
{ through a factor of 4.53e-05·FlightState.rho·AircraftPerf.AircraftDrag.ActuatorProp.omega²·Propeller.R⁵ (1,653N·m) } | ||
breaks down into: | ||
AircraftPerf.AircraftDrag.ActuatorProp.CP (0.00291) | ||
2) forming 12% of the RHS and 11% of the total: | ||
i0 (4.5A, fixed) | ||
2) forming 6% of the RHS and 6% of the total: | ||
AircraftPerf.AircraftDrag.Pavn (200W, fixed) | ||
3) forming 3% of the RHS and 3% of the total: | ||
AircraftPerf.AircraftDrag.Ppay (100W, fixed) | ||
|
||
Permissivity = 1 (stops at Pelec = v·i) | ||
---------------- | ||
|
||
AircraftPerf.AircraftDrag.Poper (3,194W) | ||
which in: Poper/mpower ≥ Pavn + Ppay + Pelec·Nprop (sensitivity +5.6) | ||
{ through a factor of AircraftPerf.AircraftDrag.mpower (1.05, fixed) } | ||
breaks down into 3 monomials: | ||
1) forming 90% of the RHS and 90% of the total: | ||
{ through a factor of Nprop (4, fixed) } | ||
AircraftPerf.AircraftDrag.MotorPerf.Pelec (0.685kW) | ||
which in: Pelec = v·i (sensitivity -5.1) | ||
breaks down into: | ||
AircraftPerf.AircraftDrag.MotorPerf.i·AircraftPerf.AircraftDrag.MotorPerf.v (685A·V) | ||
2) forming 6% of the RHS and 6% of the total: | ||
AircraftPerf.AircraftDrag.Pavn (200W, fixed) | ||
3) forming 3% of the RHS and 3% of the total: | ||
AircraftPerf.AircraftDrag.Ppay (100W, fixed) |
Oops, something went wrong.