Closed 1ozturkbe closed 7 years ago
As a teaser, here is the VSP image of the solve (with set npax and ReqRng) Wonky, ey? Also, I don't know exactly what happened with y_{eng}.
Oh, because there is no y_{eng} sub in D8_eng_wing. I think your merge conflict overwrote my fix :P Will add again.
oh shoot, sorry!
this looks really neat! @1ozturkbe do you want to meet up tomorrow and outline what we want to present Tuesday?
Sounds good. I'm free pretty much all day, but I would prefer the afternoon. I can also meet today if you are free; before 1pm works best.
I want to keep this issue open until we resolve the vector subs issues. Currently, we have to comment out the n_{pax} 'substitution' equations within D8.py to be able to run with a PRFC objective. Hopefully we should no longer have to do this soon.
tomorrow is best for me. There's a chance we might fly JHO saturday so I'd need to verify the plane is ready in the late afternoon..how's 1pm?
Cool, let's do it.
@bqpd could you give us an example of the right way to do one of these vector subs?
What you were doing before should work fine! [5*units("m")]
. np,array([1, 2, 3])*units("m")
should also work.
Cool, will implement this.
I can't get the subs to work with BCS or relaxed_constants. I created new branch vectorsubs until we can resolve this, because I can't run any of the models with the recent changes I made. the error is:
run SP_aircraft
Backend Qt4Agg is interactive backend. Turning interactive mode on.
D8_eng_wing executing...
Traceback (most recent call last):
File "C:\Users\Berk\Anaconda2\lib\site-packages\IPython\core\interactiveshell.py", line 2666, in safe_execfile
self.compile if kw['shell_futures'] else None)
File "C:\Users\Berk\Anaconda2\lib\site-packages\IPython\utils\py3compat.py", line 276, in execfile
exec(compiler(scripttext, filename, 'exec'), glob, loc)
File "C:\Users\Berk\Dropbox (MIT)\MIT Graduate School\D8\d8\SP_aircraft.py", line 562, in <module>
m = Model(m.cost,BCS(m))
File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\bounded.py", line 73, in __init__
self.bounded_varkeys = tuple(vk for vk in constraints.varkeys
File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\bounded.py", line 74, in <genexpr>
if vk not in constraints.substitutions)
File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\keydict.py", line 106, in __contains__
% (key, dict.__getitem__(self, key)))
TypeError: n_{pax}_Mission, Aircraft, Fuselage has an idx, but its value in this KeyDict is the scalar 180.0.
@1ozturkbe can we close this since it isn't really an issue?
I guess the issue is in vector substitutions, and PRFC works anyways. CLosing.
Hmm, it worked with the example code @mayork posted. I'll add an issue.
@mayork this is a heads-up that I am adding a new objective function for payload-range fuel consumption. For this objective, we remove the ReqRng and n_{pax} substitutions, and let the model figure out what the optimal mission is for the given configuration. it's a work in progress (I got a pretty funny result for the first solve with D8_eng_wing, but the results should be valuable).