convexengineering / SPaircraft

Models for commercial aircraft design
http://spaircraft.readthedocs.org
25 stars 17 forks source link

post_process changes, and model closes again. #139

Closed 1ozturkbe closed 4 years ago

1ozturkbe commented 4 years ago

now tests fail because of some other issue @bqpd, when solving using mosek_conif. Here is what I see:

Solving took 0.333 seconds.
Traceback (most recent call last):
  File "SPaircraft.py", line 97, in <module>
    sol = test()
  File "SPaircraft.py", line 89, in test
    sol = optimize_aircraft(m, substitutions, fixedBPR, pRatOpt, mutategparg)
  File "SPaircraft.py", line 65, in optimize_aircraft
    sol = m_relax.localsolve(solver='mosek_conif', verbosity=2, iteration_limit=200, reltol=0.01, mutategp=mutategparg)#, x0 = x0)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\prog_factories.py", line 124, in solvefn
    result = progsolve(solver, verbosity, **kwargs)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\sgp.py", line 169, in localsolve
    self.result = gp.generate_result(solver_out, verbosity)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\gp.py", line 211, in generate_result
    result = self._compile_result(solver_out)  # NOTE: SIDE EFFECTS
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\gp.py", line 298, in _compile_result
    % cost.varkeys.keys())
ValueError: cost contains unsolved variables dict_keys([Mission.FlightState.Relax.\gamma[3,0], Mission.FlightState.Relax.\gamma[4,0], Mission.FlightState.Atmosphere.Relax.C_1[0,0], Mission.FlightState.Atmosphere.Relax.p_{sl}[2,0], Mission.FlightState.Relax.R[1,0], Mission.FlightState.Atmosphere.Relax.M_{atm}[3,0], Mission.FlightState.Atmosphere.Relax.C_1[4,0], Mission.FlightState.Atmosphere.Relax.R_{atm}[2,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{t}}[3,0], Mission.FlightState.Atmosphere.Relax.M_{atm}[4,0], Mission.FlightSegment.FlightP.AircraftP.Relax.W_{Load_{max}}[2,0], Mission.FlightState.Atmosphere.Relax.T_{sl}[3,0], Mission.FlightSegment.FlightP.Relax.RC_{min}[0,0], Mission.FlightState.Atmosphere.Relax.p_{sl}[4,0], Mission.Aircraft.Engine.EnginePerformance.CombustorPerformance.Relax.M_{4a}[0,0], Mission.FlightSegment.FlightP.AircraftP.Relax.V_{stall}[2,0], Mission.FlightSegment.FlightP.AircraftP.Relax.W_{Load_{max}}[4,0], Mission.FlightState.Atmosphere.Relax.T_{sl}[2,0], Mission.FlightSegment.FlightP.AircraftP.Relax.V_{stall}[3,0], Mission.Aircraft.Engine.EnginePerformance.CombustorPerformance.Relax.M_{4a}[4,0], Mission.FlightState.Atmosphere.Relax.M_{atm}[1,0], Mission.FlightState.Atmosphere.Relax.T_s[1,0], Mission.FlightState.Atmosphere.Relax.R_{atm}[4,0], Mission.Aircraft.Engine.EnginePerformance.CombustorPerformance.Relax.M_{4a}[2,0], Mission.FlightState.Atmosphere.Relax.L_{atm}[3,0], Mission.FlightState.Atmosphere.Relax.T_s[0,0], Mission.FlightState.Atmosphere.Relax.T_s[4,0], Mission.FlightState.Atmosphere.Relax.C_1[2,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{t}}[0,0], Mission.FlightSegment.FlightP.AircraftP.Relax.V_{stall}[0,0], Mission.FlightSegment.FlightP.AircraftP.Relax.W_{Load_{max}}[0,0], Mission.FlightState.Atmosphere.Relax.p_{sl}[3,0], Mission.FlightState.Atmosphere.Relax.C_1[3,0], Mission.FlightState.Atmosphere.Relax.L_{atm}[2,0], Mission.FlightSegment.FlightP.Relax.RC_{min}[4,0], Mission.FlightState.Relax.R[2,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{o}}[1,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{o}}[2,0], Mission.FlightState.Atmosphere.Relax.R_{atm}[3,0], Mission.FlightState.Atmosphere.Relax.R_{atm}[0,0], Mission.FlightSegment.FlightP.Relax.RC_{min}[3,0], Mission.FlightState.Atmosphere.Relax.T_{sl}[1,0], Mission.FlightSegment.FlightP.AircraftP.Relax.W_{Load_{max}}[1,0], Mission.FlightState.Atmosphere.Relax.T_s[3,0], Mission.FlightState.Relax.R[3,0], Mission.FlightState.Atmosphere.Relax.L_{atm}[1,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{o}}[0,0], Mission.Aircraft.Engine.EnginePerformance.CombustorPerformance.Relax.M_{4a}[1,0], Mission.FlightState.Atmosphere.Relax.L_{atm}[0,0], Mission.FlightSegment.FlightP.Relax.RC_{min}[1,0], Mission.FlightState.Atmosphere.Relax.M_{atm}[2,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{t}}[1,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{o}}[4,0], Mission.FlightState.Relax.R[0,0], Mission.FlightState.Atmosphere.Relax.R_{atm}[1,0], Mission.FlightState.Atmosphere.Relax.M_{atm}[0,0], Mission.FlightSegment.FlightP.AircraftP.Relax.W_{Load_{max}}[3,0], Mission.FlightSegment.FlightP.AircraftP.Relax.V_{stall}[4,0], Mission.FlightSegment.FlightP.Relax.RC_{min}[2,0], Mission.FlightState.Atmosphere.Relax.T_{sl}[4,0], Mission.FlightState.Atmosphere.Relax.p_{sl}[0,0], Mission.FlightState.Atmosphere.Relax.C_1[1,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{t}}[2,0], Mission.FlightSegment.FlightP.AircraftP.Relax.V_{stall}[1,0], Mission.FlightState.Relax.\gamma[1,0], Mission.FlightState.Relax.\gamma[0,0], Mission.FlightState.Relax.R[4,0], Mission.FlightState.Atmosphere.Relax.L_{atm}[4,0], Mission.FlightState.Atmosphere.Relax.T_s[2,0], Mission.FlightState.Relax.\gamma[2,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{t}}[4,0], Mission.FlightState.Atmosphere.Relax.p_{sl}[1,0], Mission.FlightSegment.FlightP.AircraftP.WingPerformance.Relax.f_{L_{o}}[3,0], Mission.FlightState.Atmosphere.Relax.T_{sl}[0,0], Mission.Aircraft.Engine.EnginePerformance.CombustorPerformance.Relax.M_{4a}[3,0], Mission.Aircraft.Fuselage.Relax.n_{pass}[0]])

unsolved variables? Haven't seen this one before.

bqpd commented 4 years ago

huh, why are variables in the cost that are not in constraints?

1ozturkbe commented 4 years ago

@bqpd for some reason GPkit does weird things sometimes. With other solvers it does not throw this error. Those slack variables are actually in the models.

bqpd commented 4 years ago

I don't think it's GPkit rolling the dice just for kicks; the error indicates that not all free variables in the cost are in the results.

1ozturkbe commented 4 years ago

Well, I can't figure out why that occurs with mosek_conif and not mosek_cli... There is zero difference in the formulation.

1ozturkbe commented 4 years ago

Alright, model now closes again on the working machines (all but Windows). Turns out this was an issue with substitutions in turbofan somehow falling through when it was integrated into SPaircraft.