gpkit: unknown solution status dependent on constraint list ordering
I just ran into some behavior I really don’t understand. These are the constraints for my combustor model, and everything works fine with them.
constraints = [
#flow through combustor
Pt4 == pib * Pt3, #B.145
ht4 == Cpc * Tt4,
TCS([f*hf >= (1-ac)*ht4-(1-ac)*ht3+Cpfuel*f*(Tt4-Ttf)]),
#making f+1 GP compatible --> needed for convergence
SignomialEquality(fp1,f+1),
ht41 == Cpc * Tt41,
]
constraints.extend([
#compute Tt41...mixing causes a temperature drop
#had to include Tt4 here to prevent it from being pushed down to zero
TCS([ht41 <= ((1-ac)*ht4 +ac*ht3+Cpfuel*f*(Tt4-Ttf) + Cpfuel*Ttf*f)/fp1]),
#comptue the rest of the station 4.1 variables
SignomialEquality(fp1*u41, (u4a*(1-ac)+f*u4a+ac*uc)),
#this is a stagnation relation...need to fix it to not be signomial
TCS([T41 >= Tt41-.5*(u41**2)/Cpc]),
#here we assume no pressure loss in mixing so P41=P4a
Pt41 == P4a*(Tt41/T41)**(1.313/.313),
#compute station 4a quantities, assumes a gamma value of 1.313 (air @ 1400K)
u4a == M4a*((1.313*R*Tt4)**.5)/hold4a,
uc == ruc*u4a,
P4a == Pt4*hold4a**(-1.313/.313),
])
however, these constraints cause the model to return unknown
constraints = [
#flow through combustor
Pt4 == pib * Pt3, #B.145
ht4 == Cpc * Tt4,
#making f+1 GP compatible --> needed for convergence
SignomialEquality(fp1,f+1),
ht41 == Cpc * Tt41,
]
constraints.extend([
TCS([f*hf >= (1-ac)*ht4-(1-ac)*ht3+Cpfuel*f*(Tt4-Ttf)]),
#compute Tt41...mixing causes a temperature drop
#had to include Tt4 here to prevent it from being pushed down to zero
TCS([ht41 <= ((1-ac)*ht4 +ac*ht3+Cpfuel*f*(Tt4-Ttf) + Cpfuel*Ttf*f)/fp1]),
#comptue the rest of the station 4.1 variables
SignomialEquality(fp1*u41, (u4a*(1-ac)+f*u4a+ac*uc)),
#this is a stagnation relation...need to fix it to not be signomial
TCS([T41 >= Tt41-.5*(u41**2)/Cpc]),
#here we assume no pressure loss in mixing so P41=P4a
Pt41 == P4a*(Tt41/T41)**(1.313/.313),
#compute station 4a quantities, assumes a gamma value of 1.313 (air @ 1400K)
u4a == M4a*((1.313*R*Tt4)**.5)/hold4a,
uc == ruc*u4a,
P4a == Pt4*hold4a**(-1.313/.313),
])
the only difference is that this constraint TCS([f*hf >= (1-ac)*ht4-(1-ac)*ht3+Cpfuel*f*(Tt4-Ttf)]),
was moved from the constraints = [] to constraints.extend([])…any idea what’s going on here?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 34 (26 by maintainers)
Try it on the
fastsub
orsetsubs
branches, it should get a little bit faster. Once you’re happy it’s working again we can close this issue…