Comments (9)
Aw, shucks, I think I know what's happening here: for general compatibility, sometimes an equality constraint will return a True or a False instead of a Constraint Object. What's the code that's causing this failure? We'll turn it into a unit test.
from gpkit.
I'm running a slightly modified version of the simple_sweep.py example.
from gpkit.
In order of method-awesomeness, could you create a pull request with your failing file as a unit test, post your modifications, or email me the whole modified file?
from gpkit.
Going with the (hopefully?) somewhat-awesome option b. Four changes:
The constants are a little different:
constants = {
'rho': (0.38, "kg m^3", "density of air"), ##Stanford standard atm tool
'mu': (1.4e-5, "kg/m*s", "viscosity of air"), ##Engineering tooldbox/standard atm tool
'S_wetratio_w': (2.06, "wetted area ratio"), ##Stanford wetted area calculation (assuming S_ref ~ S_exposed)
'S_wet_f': (356, "m^2","fuselage wetted area ratio"), ##NASAPerfEval
'k_w': (1.45, "wing form factor"), ## Martins Paper (Torenbeek)
'k_f': (1.09, "fuselage form factor"), ## Martins Paper (Torenbeek)
'e': (0.875, "Oswald efficiency factor"), #???
'W_0': (701694, "N", "aircraft weight excluding wing"), ## NASAPerfEval
'N_ult': (2.5, "ultimate load factor"), ## keep same (FAA metric)
'tau': (0.149, "airfoil thickness to chord ratio"), ##NASAPerfEval
'C_Lmax': (2.5, "max CL with flaps down"), #b737.org.uk (~average of takeoff and landing Clmax for 737-500) ????
'V_min': (73, "m/s", "takeoff speed"), #jane's (also stall speed from answers.com)
}
The addition of V to free variables
free_variables = {
'A': "aspect ratio",
'S': ["m^2", "total wing area"],
'C_D': "Drag coefficient of wing",
'C_L': "Lift coefficent of wing",
'C_f': "skin friction coefficient",
'Re': "Reynold's number",
'W': ["N", "total aircraft weight"],
'W_w': ["N", "wing weight"],
'V' : ["m/s", "cruising speed"]
}
Drag modelling is slightly different:
C_D_fuse = k_f*C_f*S_wet_f/S
C_D_wpar = k_w*C_f*S_wetratio_w
Lines 62-64 are how they were previously (with equality constraints)
W == W_0 + W_w,
W_w == W_w_surf + W_w_strc,
C_D == C_D_fuse + C_D_wpar + C_D_ind
from gpkit.
(Option B was totes awesome. Option A might be a good future policy.)
Ah. Interesting. @whoburg and I were just discussing whether the interface should allow equality constraints between monomials and posynomials; a week ago this would have worked, but now it throws this mysterious error that really means "invalid constraint".
I'll add a better error message, but I'm also curious to know how you came to use ==
for these constraints.
For now, shift 'em back to >=
constraints, which more accurately represents the solver's state; in the future we'll need to decide whether such Mono/Posy equality 'constraints' (which will require post-solve checking, and hence aren't quite 'constraints', though mathematically there should be no problem) are acceptable.
from gpkit.
I only used ==
because I was using the old simple_sweep.py as the template for the example I'm working on.
I'll change them to >=
from gpkit.
Heh, sorry about that fast switch. How useful / intuitive do you think W == W_0 + W_w
and such would be?
from gpkit.
Well, although it might be bending some definitions, intuitively it would be nice to have the equalities in there. Especially for things that qualitatively can be considered more like definitions as opposed to constraints (like Weight = wing_weight + fuselage_weight +...
and Total drag = parasite drag + induced drag
etc.).
That's not really taking into account a potential (if I'm understanding things correctly?) loss of robustness/increase in complexity though ....
from gpkit.
Moving discussion to #64.
from gpkit.
Related Issues (20)
- Deprecation warning in tests
- Missing ipynbsankeywidget from dependencies? HOT 2
- It's time for a new GPkit logo HOT 2
- refactor solution printing
- RuntimeWarning: The primal solution was not returned. HOT 3
- Unexpected issue building model in parallel HOT 2
- Redundant equality constraint causes issues with CVXOPT HOT 6
- JSON Solution Save and Diff Save Format HOT 2
- Last PR causing PCCP solve to terminate early? HOT 6
- Fresh install: name 'long' is not defined (dependency issue) HOT 5
- Need to add plotly dependency to setup.py
- migrate to different automatic differentiation package HOT 2
- installation instructions still mention Mosek 8 HOT 5
- API documentation is empty HOT 1
- GPkit HOT 1
- Process finished with exit code -1073741571 (0xC00000FD) HOT 3
- ConstraintSet should override list and return NotImplemented for addition and multiplication HOT 8
- Possible fix for your broken unittests HOT 11
- Not free HOT 1
- aircraft \geometric programming
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpkit.