From 4db769846c9fd6b3e1239e96504c981ceb682daa Mon Sep 17 00:00:00 2001 From: facat Date: Sat, 6 Apr 2013 21:53:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=99=AA=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: facat --- OPF_Init.m | 4 ++-- Run_YALMIP.m | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OPF_Init.m b/OPF_Init.m index 305b176..344a4f6 100644 --- a/OPF_Init.m +++ b/OPF_Init.m @@ -33,8 +33,8 @@ wQG=1*ones(size(PVi,1),1); %randInt=randperm(size(Loadi,1)); %randPDind=randInt(1:10); randPDind=0; -wPD=1*ones(sum(PD~=0),1); -wQD=1.5*ones(sum(QD~=0),1); +wPD=1/0.05^2*ones(sum(PD~=0),1); +wQD=1/0.05^2*ones(sum(QD~=0),1); %wD(randPDind)=0;%一些负荷不约束 %wD(7)=0; % wD(11)=0; diff --git a/Run_YALMIP.m b/Run_YALMIP.m index 52e881a..e0b96d1 100644 --- a/Run_YALMIP.m +++ b/Run_YALMIP.m @@ -41,6 +41,9 @@ UAngel=sdpvar(Busnum,1); PD=sdpvar(Busnum,1); QD=sdpvar(Busnum,1); AngleIJ=sdpvar(Busnum,Busnum,'full'); +%% 加噪音 +PD0=(1+normrnd(0,0.05,length(PD0),1)).*PD0; +QD0=(1+normrnd(0,0.05,length(QD0),1)).*QD0; %% 目标函数 Objective=ObjectiveFun(PG,PG0,PGi,QG,QG0,PVi,PD,PD0,QD,QD0,wPG,wQG,wPD,wQD,Loadi); %AngleIJ=sparse(r,c,UAngel(r)-UAngel(c)-Angle,Busnum,Busnum);