I am trying to code a problem solves B(2,1)
under LMI constraints.
R(2,1)=R0(2,1)+H(2,2)*B(2,1)
Vc is a scalar variable
It keeps getting
> "DCPError: Problem does not follow DCP rules."
import numpy as np
import cvxpy as cp
H = np.random.rand(2,2)
R0 = np.random.rand(2,1)
B=cp.Variable((2,1), complex=True)
Rf=cp.diag(R0+H*B)
RRf=cp.real(Rf)
IRf=cp.imag(Rf)
Vc=cp.Variable()
Vc2= (Vc**2)
z=np.zeros((Rf.shape[0],Rf.shape[1]))
I=np.eye(Rf.shape[0])
objective3=cp.Minimize(Vc2)
LMI =cp.bmat( [
[Vc2*I, RRf, z, -IRf],
[RRf, I, IRf, z],
[z, IRf, Vc2*I, RRf],
[-IRf, z, RRf, I]
])
const1 = LMI >=0
const2 = Vc >=0
prob=cp.Problem(objective3,[const1,const2])
print(prob.is_dcp())
[1]: https://i.stack.imgur.com/IQpxh.png
I am really stuck with this issue for weeks by now. I am a mechanical engineer not a programmer but this code would be a great help at work. – Maged Eltorkoman Apr 28 '20 at 20:17