From 7b85093fb16a361218ce437fb1ea02d8f2528109 Mon Sep 17 00:00:00 2001 From: facat Date: Sat, 6 Apr 2013 21:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E7=BA=A6=E6=9D=9FPD=EF=BC=8CQD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ObjectiveFun.m | 6 +----- Run_YALMIP.m | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) 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);