Skip to content

Commit

Permalink
Removing relaxed_constants once and for all.
Browse files Browse the repository at this point in the history
  • Loading branch information
1ozturkbe committed Apr 20, 2020
1 parent 12683fb commit 4c7a0f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 61 deletions.
13 changes: 3 additions & 10 deletions SPaircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from gpkit import Variable, Model, units, SignomialsEnabled, SignomialEquality, Vectorize
from gpkit.constraints.bounded import Bounded

# Constant relaxation heuristic for SP solve
from relaxed_constants import relaxed_constants, post_process

# Mission model
from aircraft import Mission

Expand Down Expand Up @@ -60,10 +57,8 @@ def optimize_aircraft(m, substitutions, fixedBPR=False, pRatOpt=True, mutategpar
del substitutions['\pi_{hc_D}']

m.substitutions.update(substitutions)
m_relax = Model(m.cost, Bounded(m), m.substitutions)
m_relax = relaxed_constants(m_relax)
sol = m_relax.localsolve(verbosity=2, iteration_limit=200, reltol=0.01, mutategp=mutategparg)#, x0 = x0)
post_process(sol)
m = Model(m.cost, Bounded(m), m.substitutions)
sol = m.localsolve(verbosity=2, iteration_limit=200, reltol=0.01, mutategp=mutategparg)
return sol

def test():
Expand All @@ -87,11 +82,9 @@ def test():
pRatOpt = True
mutategparg = False
sol = optimize_aircraft(m, substitutions, fixedBPR, pRatOpt, mutategparg)
Nclimb = m.Nclimb
percent_diff(sol, config, Nclimb)
post_compute(sol, Nclimb)
if sys.version_info.major < 3:
sol.savetxt()
sol.savetxt()
return sol

sol = test()
51 changes: 0 additions & 51 deletions relaxed_constants.py

This file was deleted.

0 comments on commit 4c7a0f5

Please sign in to comment.