Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError: (34, 'Result too large') #1301

Closed
norheim opened this issue Apr 23, 2018 · 8 comments
Closed

OverflowError: (34, 'Result too large') #1301

norheim opened this issue Apr 23, 2018 · 8 comments

Comments

@norheim
Copy link

norheim commented Apr 23, 2018

The code to reproduce the problem is a little long, so posting a link to it:
https://github.com/norheim/smallsat/blob/master/notebooks/minimalspace.ipynb

I'm getting a float overflow problem from a Signomial localsolve():

C:\Users\johan\Miniconda2\envs\gpsat\lib\site-packages\gpkit\nomials\math.pyc in mono_approximation(self, x0)
    123             e = val*diff/c0
    124             exp[vk] = e
--> 125             c /= val**e
    126         hmap = NomialMap({exp: c})
    127         hmap.units = self.units

OverflowError: (34, 'Result too large')
@bqpd
Copy link
Contributor

bqpd commented Apr 23, 2018

Solves for me with all solvers, if you remove the middle GP solve.

The error you're seeing is because variables with specified values now give those values up to the first model they're a part of; I'd recommend creating these variables inside a Model object if you want to keep the code-block organization you have going here, so that you create new copies for the new model.

@bqpd bqpd closed this as completed Apr 23, 2018
@norheim
Copy link
Author

norheim commented Apr 23, 2018

Got it thanks a lot Ned!

@bqpd
Copy link
Contributor

bqpd commented Apr 23, 2018 via email

@norheim
Copy link
Author

norheim commented Apr 23, 2018

Ned, wanted to reopen the issue, as the Error code is the same, its just that the error comes from the formulation. I introduced a new variable(called it dummy to make it clear which one it is, but it's not a dummy variable). Actually the original constraint P comes from a linearization of this relationship, but I wanted to see if I could include the raw relationship(constraint with dummy and P2). During the signomial solve it definitly seems to hit the float overflow problem this time, even when I do Bounded(countraints). Let me know if you understand what's going on(from a modelling side, or a solver side)!

Just FYI, SingleSignomialEquality(dummy, R_earth+h), which is the actual constraint, still results in the same problem.

https://github.com/norheim/smallsat/blob/master/notebooks/minimalspace.ipynb

@bqpd
Copy link
Contributor

bqpd commented Apr 23, 2018

The problem was that earth radius was in meters and gigantic, and the SP heuristic (since it assumes everything is close to 1) overflowed trying to raise it to a large power. Put the earth radius in kilometers and it works, and I'll add an error message to make this clearer next time!

@norheim
Copy link
Author

norheim commented Apr 23, 2018

Man, good insight!! :) and thank you so much for being so quick, its all working on my end too!

@bqpd
Copy link
Contributor

bqpd commented Apr 23, 2018

Pull the new master and tell me what you think of the error message!

@norheim
Copy link
Author

norheim commented Apr 24, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants