convexengineering / gplibrary

Useful subsystem models
MIT License
10 stars 11 forks source link

Commercial sizing #73

Closed mayork closed 7 years ago

mayork commented 8 years ago

Code to simulate flight path of a commercial aircraft - work in progress

TODO

mayork commented 8 years ago

@whoburg thought you might be interested to know I think your idea of fitting atmospheric quantities will work nicely. Pressure and density can be fit almost exactly. Temp and viscosity don't work too well but temperature can be found pretty accurately with ideal gas law and viscosity with Philippe's sutherland class. I'm going to try and proceed down this path for the commercial sizing model

image

image

image

mayork commented 8 years ago

note - last commit is not fully functional...premature declaration

mayork commented 8 years ago

@whoburg or @bqpd can you run the file Commerical_Sizing_Profile.py in commit 386de40 with mosek and tell me what happens? I can't get mosek to work on athena right now, and it just took over hour for cvxopt to hit the iteration limit on my computer...

mayork commented 8 years ago

@whoburg could you run commit 5627dce w/Mosek and see if the constraints are tight? I have a feeling a few still might not be...

whoburg commented 8 years ago

It's dual infeasible. Here are the variables that the boundedness debugging tool says are sensitive to the bounds:

defaultdict(list,
            {'sensitive to lower bound': [\pi_{HPT}_EngineOnDesign, CommercialAircraft,
              M_7_EngineOffDesign5, CommercialAircraft,
              hft_CommericalMissionConstraints, CommercialAircraft_(0,),
              F_8_EngineOffDesign2, CommercialAircraft,
              T_{t_8}_EngineOffDesign6, CommercialAircraft,
              h_8_EngineOffDesign, CommercialAircraft,
              T_{t_4.5}_EngineOffDesign2, CommercialAircraft,
              p_{tildf}_EngineOffDesign5, CommercialAircraft,
              m_{fan}_EngineOffDesign4, CommercialAircraft,
              m_{f}_EngineOffDesign3, CommercialAircraft,
              u_6_EngineOffDesign, CommercialAircraft,
              h_{t_8}_EngineOnDesign, CommercialAircraft,
              h_{t_5}_EngineOffDesign3, CommercialAircraft,
              T_{t_4}_EngineOffDesign5, CommercialAircraft,
              RngClimb_CommercialAircraft_(1,),
              W_{end}_CommericalMissionConstraints, CommercialAircraft_(0,),
              T_{6}_EngineOffDesign5, CommercialAircraft,
              h_{t_8}_EngineOffDesign5, CommercialAircraft,
              h_{t_4.1}_EngineOffDesign5, CommercialAircraft,
              P_{t_0}_EngineOffDesign2, CommercialAircraft,
              T_{5}_EngineOffDesign6, CommercialAircraft,
              T_{t_4.1}_EngineOffDesign6, CommercialAircraft,
              M_0_EngineOffDesign2, CommercialAircraft,
              P_{t_3}_EngineOffDesign5, CommercialAircraft,
              P_{t_6}_EngineOffDesign6, CommercialAircraft,
              m_{f}_EngineOffDesign5, CommercialAircraft,
              W_{end}_CommercialAircraft_(5,),
              h_{t_1.8}_EngineOffDesign3, CommercialAircraft,
              h_{t_0}_EngineOffDesign6, CommercialAircraft,
              RngClimb_CommercialAircraft_(3,)],
             'sensitive to upper bound': [T_{t_2}_EngineOnDesign, CommercialAircraft,
              T_{t_{4spec}}_EngineOffDesign4, CommercialAircraft,
              a_0_EngineOffDesign2, CommercialAircraft,
              P_{t_4}_EngineOffDesign3, CommercialAircraft,
              T_CommericalMissionConstraints, CommercialAircraft_(0,),
              F_EngineOffDesign, CommercialAircraft,
              T_{t_6}_EngineOffDesign5, CommercialAircraft,
              h_8_EngineOffDesign, CommercialAircraft,
              TSFC_E2_CommercialAircraft,
              F_{spec6}_CommercialAircraft,
              P_8_EngineOffDesign5, CommercialAircraft,
              m_{f}_EngineOffDesign3, CommercialAircraft,
              u_6_EngineOffDesign, CommercialAircraft,
              h_{t_4.1}_EngineOffDesign5, CommercialAircraft,
              P_{t_0}_EngineOffDesign2, CommercialAircraft,
              T_{5}_EngineOffDesign6, CommercialAircraft,
              T_{7}_EngineOffDesign3, CommercialAircraft,
              P_{t_6}_EngineOffDesign6, CommercialAircraft,
              m_{fan}_EngineOffDesign6, CommercialAircraft]})
whoburg commented 8 years ago

@mayork does the version of determine_unbounded_variables that you copied to the commercial_sizing branch include the bugfix introduced by 39402d5fb5c34d39c2136992e9bf85a0e4ca6540 (https://github.com/hoburg/gpkit/pull/571/commits/39402d5fb5c34d39c2136992e9bf85a0e4ca6540)? If not, you should copy that over.

whoburg commented 8 years ago

looks like it does include the bugfix...

mayork commented 8 years ago

hmm cvxopt is actually solving that commit I pushed...there's no variables at the bound?

bqpd commented 7 years ago

(note, we have a new BoundedConstraintSet implementation)

mayork commented 7 years ago

the code at commit 3d147fe runs with ReqRng of 500 while bounded but unbounded just iterates for 100 iterations with no solution. Solves unbounded for ReqRng of 3000. Need to the investigate the possibility of potentially solving occasionally with ReqRng of 500 unbounded. I will investigate this more thoroughly post Langley presentation

mayork commented 7 years ago

the code at commit 67d579e solves to slightly different solutions when bounded. need to review this after langley. Solving two times in a row in once case a constraint was 8.4% away from being tight...the next solve the least tight constraint was .021%...note these were the same constraints

Warning: Constraint [1e-06*h_{t_3}_EngineOnDesign, ...] is not tight because the left hand side evaluated to 1.68595092037 megajoule / kilogram but the right hand side evaluated to 1685600.0 joule / kilogram (Allowable error: 0.0001%, Actual error: 0.021%)
mayork commented 7 years ago

the code at commit aa40d4a solved unbounded...same code as commit 67d579e except for increasing ReqRng to 6000 (was 300 in 67d579e)

mayork commented 7 years ago

commit b767f33 again has the odd behavior...see commit message

mayork commented 7 years ago

disregard previous commit committed wrong stuff

mayork commented 7 years ago

run altitude sweeps at 859e452 for non deterministic behavior

mayork commented 7 years ago

alt_sweep code at 2256aea recreates the issuse discussed in https://github.com/hoburg/gpkit/issues/808

mayork commented 7 years ago

in the D8 repo