Code Monkey home page Code Monkey logo

Comments (8)

rwl avatar rwl commented on July 19, 2024

I have push up an old version that I think I must have used:

https://github.com/rwl/pyipopt

However, it seems that PyIPOPT has received a considerable amount of attention since I last looked at it:

https://github.com/xuy/pyipopt

I will leave this issue open until PYPOWER has been updated to use that branch. Ultimately, platform specific eggs should be available here:

https://pypi.python.org/pypi/pyipopt

from pypower.

rockg avatar rockg commented on July 19, 2024

Running the latest pyipopt with Ipopt 3.11.1 and removing the 2nd argument (m) now results in a segmentation fault in Ipopt running the t_opf_ipopt.py test. It's not clear where the issue is (pypower, pyipopt, ipopt)...lots of moving parts. I will try your uploaded pyipopt to see if that changes things (obviously you got it working at one point).

from pypower.

rockg avatar rockg commented on July 19, 2024

Unfortunately, I still get errors using rwl/pyipopt (in fact it segfaults when creating the problem) which would suggest some api change in Ipopt that I have versus the version that pyipopt works with.

from pypower.

rwl avatar rwl commented on July 19, 2024

I just remembered that I wrote this guide for setting up external solvers:

https://github.com/rwl/PYPOWER/blob/master/doc/solvers.rst

It looks like I was using Ipopt 3.9.3.

from pypower.

rockg avatar rockg commented on July 19, 2024

I tried this from scratch at home using the Ipopt 3.11.5 and pyipopt from the current github master and was able to run the optimization part successfully by simply just removing the (m) argument and the modifying the output arguments (zg is moved). So clearly the segfaults are something on my end.

from pypower.

kennyvinente avatar kennyvinente commented on July 19, 2024

I don't know if any user still have this problem.. but if so, i found a solution for this problem: change the output of eval_jac_g and eval_h functions when flag=True to: return ((Js.row).astype(int), (Js.col).astype(int)) and return ((Hs.row).astype(int), (Hs.col).astype(int)), respectively. Apparentely without this the solver returns a segmentation fault.

from pypower.

daetzm avatar daetzm commented on July 19, 2024

Hi kennyvinente, how did you solve the original problem:
x, zl, zu, obj, status, zg = nlp.solve(x0, m, userdata) (TypeError: function takes at most 2 arguments (3 given))
Did you also remove the m? I tried removing the m but then zg is an integer and not an array. This results in my script crashing here:
muSf[il] = 2 * info['lmbda'][2 * nb + arange(nl2)] * branch[il, RATE_A] / baseMVA (TypeError: 'int' object has no attribute 'getitem')
I am using ipopt version 3.12.7

from pypower.

kennyvinente avatar kennyvinente commented on July 19, 2024

Hello @daetzm .. some changes that i performed was:
x, zl, zu, zg, obj, status, = nlp.solve(x0, userdata) (there is a change in the outputs, probably because of the ipopt version). Also, i'm using ipopt version 3.12.12 and python3.6
And most important.. check the return of all functions, specially the eval_g and eval_h functions..check if they are running correctly.. for example, try with a 3bus system (easy to analise).

the seg fault problem is because this functions are not returning the results appropriately, so i did those changes and now its fine..

here is an image with ipopt running an opf problem

Captura de tela de 2019-04-16 09-30-43

from pypower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.