Coder Social home page Coder Social logo

OPTALG solve crash about optalg HOT 9 CLOSED

martinzellner avatar martinzellner commented on May 23, 2024
OPTALG solve crash

from optalg.

Comments (9)

ttinoco avatar ttinoco commented on May 23, 2024

This is interesting. It would be helpful if you somehow give me that matrix
you are using so I can recreate the problem, fix the issue and add a
unittest.
Tomas

On Sun, May 8, 2016 at 2:22 PM, Martin Zellner [email protected]
wrote:

OPTALG slove() crashes with the following error (which is not caught as
an Python Exception):

lda must be >= MAX(N,1): lda=5 N=6BLAS error: Parameter number 7 passed to
cblas_dtrsv had an invalid value

Probably there is something odd with my matrix structure, however this
should not lead to a crash without any Python output.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1

from optalg.

martinzellner avatar martinzellner commented on May 23, 2024

I hope saving the matrices worked:
crash.npz.zip

Here is what I do:
screen shot 2016-05-08 at 20 09 29

from optalg.

martinzellner avatar martinzellner commented on May 23, 2024

It might be platform specific though (OpenBLAS vs. Apple Accelerate)..

from optalg.

ttinoco avatar ttinoco commented on May 23, 2024

There are several odd things in the code above:

  1. variables need to be specified before constructing a problem (as an example, see the DCOPF problem construction in GRIDOPT). Your optimization problem has no variables.
  2. generator Q participations are not needed since Q should not be variables,
  3. generator P participations are needed when there is more than one generator connected to a bus (unless the objective function removes extra degrees of freedom)
  4. you are missing the LBOUND constraint to get l <= Gx <= u with G=identity
  5. p.gphi is not equal to the g argument of the QP problem. gphi(x) is equal to g + Hx
  6. in your problem above, p.l and p.u are meaningless since no inequality constraints have been constructed.

from optalg.

martinzellner avatar martinzellner commented on May 23, 2024

Thanks for the remarks. I will change the code accordingly. Mostly your points are taken care of within the MPProblem class at the moment (e.g. variable definition). This needs to be changed, but the problem should not be affected by this.
Concerning 5): Can I get gsomehow?

from optalg.

ttinoco avatar ttinoco commented on May 23, 2024

Yes, use the identity given in the previous comment: g + Hx = gphi(x),
solve for g

On Sun, May 8, 2016 at 8:46 PM, Martin Zellner [email protected]
wrote:

Thanks for the remarks. I will change the code accordingly. Mostly your
points are taken care of within the MPProblem class at the moment (e.g.
variable definition). This needs to be changed, but the problem should not
be affected by this.
Concerning 5): Can I get gsomehow?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#1 (comment)

from optalg.

martinzellner avatar martinzellner commented on May 23, 2024

Just as a remark: The crash only occurs when I add the battery energy constraints. So I assume something is odd with my A matrix...

from optalg.

martinzellner avatar martinzellner commented on May 23, 2024

I could track it down further. This happens when a all-zero column appears in the A matrix (which shouldn't happen).
I think there should be an Exception complaining about the matrix being rank deficient.

from optalg.

ttinoco avatar ttinoco commented on May 23, 2024

It is not as simple as that. Rank of A is not the rank the optimization algorithm cares about, but the rank of the KKT matrix. I suspect the linear solver is throwing the error. The linear solver should be throwing a python exception. If not, then the wrapper has a bug (either superlu or mumps, I am not sure which one you are using). The wrappers are external to optalg. However, I am sure some checks can be added at the beginning of the solve method to check bad data easily. I will take care of this as soon as I have time.

from optalg.

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.