diff --git a/ObjectiveFun.m b/ObjectiveFun.m index 1bb55aa..3dfec63 100644 --- a/ObjectiveFun.m +++ b/ObjectiveFun.m @@ -1,10 +1,6 @@ function [out_arg]=ObjectiveFun(PG,PG0,PGi,QG,QG0,PVi,PD,PD0,QD,QD0,wPG,wQG,wPD,wQD,Loadi) -t1=PG(PGi)-PG0(PGi); -t2=wPG.*t1.*t1; -t1=QG(PVi)-QG0(PVi); -t3=wQG.*t1.*t1; t4=wPD.*(PD(PD0~=0)-PD0(PD0~=0)).^2; t5=wQD.*(QD(QD0~=0)-QD0(QD0~=0)).^2; -out_arg= sum(t2)+sum(t3)+sum(t4)+sum(t5); +out_arg=sum(t4)+sum(t5); end \ No newline at end of file diff --git a/Run_YALMIP.m b/Run_YALMIP.m index 628fdb5..4f323e5 100644 --- a/Run_YALMIP.m +++ b/Run_YALMIP.m @@ -59,13 +59,9 @@ Loadi=PD0~=0 | QD0~=0; Constraints = [%AngleIJ-sparse(r,c,UAngel(r)-UAngel(c)-Angle,Busnum,Busnum)==0, ... dP==0, ... dQ==0, ... - PG(setxor(1:Busnum, PGi) )==0, ... - QG(setxor(1:Busnum, PVi) )==0, ... PD(PD0==0)==0, ... QD(QD0==0)==0, ... 0.9*ones(Busnum,1)<=Volt<=1.1*ones(Busnum,1), ... - -60*ones(Busnum,1)<=PG<=60*ones(Busnum,1), ... - -60*ones(Busnum,1)<=QG<=60*ones(Busnum,1) ]; options = sdpsettings('verbose',2,'showprogress',1,'debug',0,'solver','ipopt','usex0','1'); sol = solvesdp(Constraints,Objective,options);