Too long solution time

Hello! I am trying to solve the following problem:

function [W,Es,Pgi,cvx_optval,es,rs,Cl,Cst]=mpopf(cir,n,Rsmax,Vmax,Vmin,Pload,Qload,Pgen,Qgen,ESSloc,Pijmax,dt,p);
ESSloc=ESSloc(ESSloc~=0);
ESSnumb=size(ESSloc,2);
T=size(Pload,2);
ybus=full(makeYbus(cir));
g=graph(abs(ybus));
edges(:,1)=cir.branch(:,1);
edges(:,2)=cir.branch(:,2);
l=length(edges);
cvx_begin
variable W(n,n,T) complex semidefinite;
variable Pgi(n,T);
variable Qgi(n,T);
variable Es(n);
variable es(n,T);
variable bs(n,T);
variable rs(n,T);
variable Cl;
variable Cst;
minimize p*Cst+Cl;
subject to
Cst==sum(Es);
Cl==sum(sum(Pgi-Pload-rs))*dt/T;
for i=1:ESSnumb
es(ESSloc(i),1)==0;
end
for i=1:n
if not(any(i==ESSloc))
bs(i,:)==0;
es(i,:)==0;
rs(i,:)==0; %mhdenizw tis times twn metavlhtwn stous zygous pou den periexoun ESS
Es(i,:)==0;
end
end
for i=1:n
for j=1:n
for t=1:T
real(-conj(ybus(i,j))*W(i,i,t)+conj(ybus(i,j))*W(i,j,t))<=Pijmax; %oria grammwn
end
end
end
for i=1:n
for y=1:T
Vmin^2<=(W(i,i,y))<=Vmax^2;
W(:,:,y)==hermitian_semidefinite(n);
Pgi(i,y)-Pload(i,y)-rs(i,y)==real(W(i,:,y)*ybus(i,:)’) %isozygia isxios
Qgi(i,y)-Qload(i,y)-bs(i,y)==imag(W(i,:,y)*ybus(i,:)’)
-Rsmax<=rs(i,:)<= Rsmax;
0<= es(i,:)<=Es(i);
-0.2<=bs(i,:)<=0.2;
sum(rs(i,:))==0;
if i~=1

      Pgi(i,:)==Pgen(i,:);  
      Qgi(i,:)==Qgen(i,:);
     end
     if y~=T
     es(i,y+1)==es(i,y)+rs(i,y)*dt; 
     end
   end
  end
  W(1,1,:)==1;

cvx_end
Pgi=full(Pgi);
es=full(es);
rs=full(rs);
cvx_optval=p*Cst+Cl;
end

When i enter the matrices Pload,Qload,Pgen,Qgen with dimensions 17x24 or 17x48 the problem is solved in about 5-6 minutes with sedumi or mosek solvers. When i enter dimensions 17x96 it is stacked before matlab starts the iterations…I know its too big problem for sdp optimization but is there anything i can do to reduce the complexity or is there any other toolbox to use it for my purpose?(such as YALMIP is faster?)…Maybe my ram is not enough?(8gb ram) :confused:

Do you have idea about how much time is spend in MOSEK or SeDuMi out the total time.

Full logoutput from say CVX+MOSEK says quite a bit more than your program btw.

I reduced a lot the runtime by decreasing the for loops, i am trying to replace for loops with vectorazation!!