question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TightConstraintSet.process_result not being called with SignomialsEnabled

See original GitHub issue

The first constraint in the model below is slack, but it doesn’t trigger an error. In fact TCS.process_result() doesn’t seem to get called at all.

from gpkit import Variable, Model, SignomialsEnabled, units
from gpkit.constraints.tight import TightConstraintSet as TCS
from numpy import pi, tan

alpha = Variable('\\alpha', '-')
ARh  = Variable('AR_h', '-')
amax = Variable('\\alpha_{max}', '-')
eta  = Variable('\\eta', '-')
CLah = Variable('C_{L_{ah}}', '-')
CLaw = Variable('C_{L_{aw}}', '-')
CLh  = Variable('C_{L_h}', '-')
CLw  = Variable('C_{L_w}', '-')
cma  = Variable('\\bar{c}', 'm')
Cmac = Variable('C_{m_{ac}}', '-')
lh   = Variable('l_h', 'm')
lfuse= Variable('l_{fuse}', 'm')
Sh   = Variable('S_h', 'm^2')
Sw   = Variable('S_w', 'm^2')
SM   = Variable('S.M.', '-')
SMmin= Variable('S.M._{min}', '-')
tanLh= Variable('\\tan(\\Lambda_h)', '-')
xCG  = Variable('x_{CG}', 'm')
xw   = Variable('x_w', 'm')
W    = Variable('W', 'N')


objective = W

with SignomialsEnabled():
    constraints = [
                   # Stability
                   TCS([SM + xw/cma >= CLah*Sh*lh/(CLaw*Sw*cma)]),
                   SM >= SMmin,

                   # Trim
                   CLh*Sh*lh/(Sw*cma) >= Cmac + CLw*xw/cma,

                   TCS([xCG + lh <= lfuse]),

                   # DATCOM formula (Mach number makes it SP)
                   TCS([(ARh/eta)**2 * (1 + tanLh**2) + 8*pi*ARh/CLah
                        <= (2*pi*ARh/CLah)**2]),
                   CLh == CLah*alpha,
                   alpha <= amax,

                   W >= 100*Sh*units.Pa
                  ]

substitutions = {
                 '\\alpha_{max}': 0.1, # (6 deg)
                 'AR_h': 4,
                 '\\eta': 0.97,
                 'C_{m_{ac}}': 0.1,
                 'C_{L_{aw}}': 2*pi,
                 'C_{L_w}': 0.5,
                 '\\bar{c}': 5,
                 'l_{fuse}': 40,
                 'S_w': 125,
                 'S.M._{min}': 0.05,
                 '\\tan(\\Lambda_h)': tan(30*pi/180),
                 'x_{CG}': 20,
                 'x_w': 2,
                }

m = Model(objective, constraints, substitutions)

m.localsolve()

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
whoburgcommented, Mar 25, 2016

now it is

0reactions
whoburgcommented, Mar 25, 2016

… but that isn’t merged yet

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found