## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Ned Burnell
@bqpd

Welcome to gitter.im/gpkit-users

Hopefully you find this chatroom useful for asking questions about gpkit syntax, bugs, and best practices. I'll be keeping an eye on the chat to provide support and advice, and occasionally be starting design discussions or posting requests for comment.

Cheers, Ned

Warren Hoburg
@whoburg

We're pleased to announce the release of GPkit version 0.5.0, featuring a new gpkit.Vectorize environment, an experimental debug() method for Model objects, and several additional improvements. If you have an older version, you can update via pip install --upgrade gpkit.

If you’ve been writing Model.__init__ methods, please take a look at the release notes (http://gpkit.readthedocs.io/en/latest/releasenotes.html) where we’re proposing a new method that is faster and clearer. We look forward to any feedback you may have.

We’ve also expanded the documentation, including new sections on debugging models and on building complex models.

Let us know what goes wrong and what goes right!

Ned Burnell
@bqpd
Today we're releasing GPkit v0.5.2, starring interactive plotting in Jupyter Notebook, and the ability to filter various things (solution tables, controlpanel sliders) by giving them an iterable of variables. Check it out at http://gpkit.readthedocs.io/en/latest/visint.html
Lewis-Lu
@Lewis-Lu
Wow
Lewis-Lu
@Lewis-Lu
should I rebuild gpkit?
just from here
Error all the way LOL
Ned Burnell
@bqpd
@Lewis-Lu, try updating your MOSEK license; if that doesn't fix this, go into the gpkit directory and run python -c "from build import build_gpkit; build_gpkit()".
Lewis-Lu
@Lewis-Lu
Why I cannot receive the e-mail from MOSEK ...
I have tried twice using my academic mail address .... || _ ||
Lewis-Lu
@Lewis-Lu
Already sent an e-mail to MOSEK...
@bqpd Thx
Lewis-Lu
@Lewis-Lu
@bqpd @whoburg Sorry to interrupt but it seems still doesn't work
Lewis-Lu
@Lewis-Lu
version of MOSEK and it is installed in this dir automatically (Win)
does that matter?
Lochie Ferrier
@lochieferrier
Does anyone have any pointers on using inheritance in GPkit?
So let's say I have a transportation trip made up of a number of different legs, which may be a drive, walk or bike or whatever.
There are a number of things common to these legs, such as cost, time and distance.
You could make a leg model that looks something like this:
class Leg(Model):
"A portion of a trip"
def setup(self):
self.time = Variable("time","min","total leg time")
self.cost = Variable("cost","-")
self.distance = Variable("distance","km")
But when I try to create sub classes of that, such as:
class Drive(Leg):
def setup(self):
print self.__dict__
self.car = Car()
self.costPerMile = Variable("costPerMile",200,"1/mile")
self.speed = Variable("speed",70,"miles/hour")
return [self.cost == self.costPerMile*self.distance]
I get that the sub class Drive can't pick up the variables from the upper class, Leg, so it doesn't know what cost is
any pointers on this @bqpd ?
Ned Burnell
@bqpd

The fix to this is to do

class Drive(Leg):
def setup(self):
leg_constraints = Leg.setup()
print self.__dict__
self.car = Car()
self.costPerMile = Variable("costPerMile",200,"1/mile")
self.speed = Variable("speed",70,"miles/hour")
return [self.cost == self.costPerMile*self.distance]

and you can save yourself from all the self.'s by using the parse_variables notation. Both inheritance and parse_Variables are done in https://github.com/convexengineering/gplibrary/blob/master/gpkitmodels/GP/aircraft/tail/horizontal_tail.py

Warren Hoburg
@whoburg
@Lewis-Lu following up on your message that "it seems still doesn't work" -- that looks like a good mosek install! It's just saying you don't have an input file which is expected when you only type mosek.
kyounes14
@kyounes14
Hello everyone. I'm fairly new to the GPKit tool and I've been toying around with a code to minimize energy expenditures during hover conditions for a given electric VTOL configuration/geometry. I ran into some sensitivity issues whilst changing some of the variables that I can't seem to overcome. Any ideas/advice would be appreciated. I replicated the model on paper above, as well as, I summarized the issues in red. Not sure if this is a bug or there's something wrong with my logic. Thanks in advance!
Ned Burnell
@bqpd
@kyounes14 your $r_{max}^2$ constraint looks signomial, I wonder if that might be a cause? Or it might be making it harder to debug the underlying cause.
The issues in red seem like primal infeasibilities; consider adding a relaxation term to those bounds + your cost function to check if that's a good framework for exploring this in.
kyounes14
@kyounes14
@bqpd yes, you are completely right. It is indeed a signomial and I am using .localsolve() instead of .solve() for my solver. Relaxation does the job. I find that when I relax my 3rd inequality, it works just fine. But, it is very sensitive to the relaxation factor I use; I need to constantly tweak it for convergence. I was just wondering as to why that was the case, as it seems perhaps counter-intuitive to me on first sight.
Ned Burnell
@bqpd
It probably means that your problem as posed is impossible; there is not a single feasible solution. Do you know of a feasible solution within those bounds? If you do then it might be that the signomial constraint is getting squirrely (i.e. numerical issues with very large or small exponents in monomial approximations)
Lewis-Lu
@Lewis-Lu
what I should pay attention to when I'm in polynomial program...
oh sorry.. posynomial
Lewis-Lu
@Lewis-Lu
@bqpd
Ned Burnell
@bqpd
your 1 there doesn't have the units of $m^3$, hence the error. I'll write a better error message for this!
Lewis-Lu
@Lewis-Lu
oh！yep thanks a lot
Ned Burnell
@bqpd
I've created an issue for it: convexengineering/gpkit#1269
bqpd GPkit v0.7 has been released
marcav95
@marcav95
Hi everyone :) I want to make a sweep of a parameter 'p' that is not a GP compatible variable, is this possible with GPkit?
My problem becomes a GP once I fix 'p', but I also have to find the optimal 'p' value.