convexengineering / gplibrary

Useful subsystem models
MIT License
10 stars 11 forks source link

Dapca4 cost model #16

Closed mjburton11 closed 8 years ago

mjburton11 commented 8 years ago

Has comments about assumptions of the DAPCA4 Model and allows the user to specify the cost of the engine, if applicable.

whoburg commented 8 years ago

@bqpd, just reviewed this with @mjburton11; we're both ready to merge it. Take a quick glance and press merge if you like it?

bqpd commented 8 years ago

Commented on units stuff, otherwise looks great!

bqpd commented 8 years ago

Oh, I think this model should have a test function

bqpd commented 8 years ago

(like the Troposhere one)

whoburg commented 8 years ago

The main method of cost.py is currently failing:

Traceback (most recent call last):
  File "cost.py", line 105, in <module>
    DAPCA4Cost().test()
  File "cost.py", line 98, in test
    C_D = sol('C_{D}')
  File "/Users/whoburg/anaconda/envs/gpkit/lib/python2.7/site-packages/gpkit/solution_array.py", line 60, in __call__
    return mag(self.subinto(p).c)
  File "/Users/whoburg/anaconda/envs/gpkit/lib/python2.7/site-packages/gpkit/solution_array.py", line 70, in subinto
    return p.sub(self["variables"])
AttributeError: 'str' object has no attribute 'sub'
bqpd commented 8 years ago

Ack, I should add a better error message. That probably means that the variable name was C_D not C_{D}

mjburton11 commented 8 years ago

Response to code review.