convexengineering / SPaircraft

Models for commercial aircraft design
http://spaircraft.readthedocs.org
25 stars 17 forks source link

Can't run sweeps with multimission #40

Open 1ozturkbe opened 7 years ago

1ozturkbe commented 7 years ago

Using commit d39b91a9, if I try to run single-mission sweep on n_pax, I get the following error:

run D8
Backend Qt4Agg is interactive backend. Turning interactive mode on.
737-800 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\D8.py", line 1624, in <module>
    m = relaxed_constants(m)
  File "C:\Users\Berk\Dropbox (MIT)\MIT Graduate School\D8\d8\relaxed_constants.py", line 23, in relaxed_constants
    constsrelaxed = ConstantsRelaxed(model, include_only, exclude)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\constraints\relax.py", line 112, in __init__
    constraints.substitutions)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\nomials\substitution.py", line 23, in parse_subs
    append_sub(sub, keys, constants, sweep, linkedsweep)
  File "c:\users\berk\dropbox (mit)\mit graduate school\code\gpkit\gpkit\nomials\substitution.py", line 59, in append_sub
    value = sub[idx]
IndexError: too many indices for array

I'm in class right now, so can't really dig very deep atm. But if you have ideas @mayork , please lmk.

mayork commented 7 years ago

I think this is because even for the single mission i am vecotrizing Npax with a length of 1 making it an array so sweep substitutions is failing. Will attempt to verify and then rectify.

bqpd commented 7 years ago

You should be able to sweep a vectorvariable!

mayork commented 7 years ago

i couldn't sub into the vector variables so i was hard coding them in the constraints, hence why the sweeping that variable wouldn't work