I'm trying to use cvxpy (and hence cvxopt) to model optimal power flow in a relatively simple network with 28 nodes and 37 lines, but getting a "Rank(A) < p or Rank([G; A]) < n" error.
(Using the same code, I can find the optimal solution for a much simpler network with 4 nodes and 4 lines.)
I've checked very carefully that the constraints are not inconsistent (using my answer to this question on Stack Overflow: Check constraints are ok in cvxpy with actual values )
Here is the traceback:
File "main.py", line 201, in test_simple_optimisation
p, bids, offers = optimize_flow(bids, offers, lines, nodes, injections_from_schedule, shift_factors, admittance.T)
File "main.py", line 143, in optimize_flow
p.solve()
File "build/bdist.macosx-10.8-intel/egg/cvxpy/programs.py", line 169, in solve
obj,valid = solve_prog(new_p,quiet)
File "build/bdist.macosx-10.8-intel/egg/cvxpy/procedures/solve_prog.py", line 44, in solve_prog
sol = call_solver(p_expanded,quiet)
File "build/bdist.macosx-10.8-intel/egg/cvxpy/procedures/call_solver.py", line 78, in call_solver
r = solvers.conelp(c,G,h,dims,A,b)
File "/Library/Python/2.7/site-packages/cvxopt/coneprog.py", line 687, in conelp
raise ValueError("Rank(A) < p or Rank([G; A]) < n")
ValueError: Rank(A) < p or Rank([G; A]) < n
When I look at /Library/Python/2.7/site-packages/cvxopt/coneprog.py", line 687, it is actually rescuing an arithmetic error
685 try: f = kktsolver(W)
686 except ArithmeticError:..
687 raise ValueError("Rank(A) < p or Rank([G; A]) < n")
Does that make sense? Why would an arithmetic error i.e. something like an OverflowError
, ZeroDivisionError
, FloatingPointError
, unless cvxpy has extended ArithmeticError mean that the problem is ill described i.e. has Rank(A) < p or Rank([G; A]) < n"?