改了初值,效果很好.

Signed-off-by: facat <dugg@21cn.com>
This commit is contained in:
facat
2013-04-23 11:43:35 +08:00
parent 03865e7b64
commit 202e7e62af
15 changed files with 81 additions and 36 deletions

View File

@@ -10,9 +10,10 @@ PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
% PQ2=diag(SEVolt)*(this.Y.*sin(YAngle))*SEVolt;
out_arg=[real(PQ(this.zerosInjectionIndex));imag(PQ(this.zerosInjectionIndex));];
% out_arg=[PQ1(this.zerosInjectionIndex);PQ2(this.zerosInjectionIndex);];
% out_arg=[out_arg;x(this.Balance+this.Busnum)];
out_arg=[out_arg;x(this.Balance+this.Busnum)];
out_arg=full(out_arg);
this.mnle=zeros(2*length(this.zerosInjectionIndex)+1,1);
this.mnle=zeros(length(out_arg),1);
this.mnlrhs=this.mnle;
end

View File

@@ -4,9 +4,8 @@ function [ Objective ] = fun(this, x )
Objective=0;
SEVolt=x(1:this.Busnum);
SEVAngel=x(this.Busnum+1:2*this.Busnum);
Objective=(SEVolt-this.mVolt)'*(1./this.sigma^2*eye(length(this.mVolt)))*(SEVolt-this.mVolt);%电压
% Objective=0;
% %% 支路电流
Objective=sum(((SEVolt-this.mVolt)./this.sigma).^2);%电压
%% 支路电流
cmpSEV=SEVolt.*exp(1j*SEVAngel); %复数电压
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%复数支路电流
SEBranchI=abs(cmpSEBranchI);% 支路电流幅值
@@ -17,12 +16,16 @@ SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
Objective=Objective+sum((SEBranchP-this.mBranchP).^2/this.sigma^2);
Objective=Objective+sum((SEBranchQ-this.mBranchQ).^2/this.sigma^2);
%% 变压器
newwordParameter=th
transP=TransPower( newwordParameter,cmpY,Volt,VAngel );
newwordParameter=this.newwordParameter;
cmpY=this.cmpY;
transP=TransPower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transP-this.mTransP).^2/this.sigma^2);
transQ=TransReactivePower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transQ-this.mTransQ).^2/this.sigma^2);
%% 0注入节点
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
%% 发电机注入功率
% Objective=Objective+(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))'*(1./this.sigma^2*eye(length(this.mPG(this.onlyPG))))*(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)));
Objective=Objective+(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))/this.sigmas.onlyPG)-real(PQ(this.onlyPG)));
% Objective=Objective+(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)))'*(1./this.sigma^2*eye(length(this.mQG(this.onlyQG))))*(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)));
end

View File

@@ -4,29 +4,30 @@ function [ Objective ] = fun(this, x )
Objective=0;
SEVolt=x(1:this.Busnum);
SEVAngel=x(this.Busnum+1:2*this.Busnum);
Objective=(SEVolt-this.mVolt)'*(1./this.sigma^2*eye(length(this.mVolt)))*(SEVolt-this.mVolt);%
% Objective=0;
% %%
Objective=sum(((SEVolt-this.mVolt)./this.sigma).^2);%
%%
cmpSEV=SEVolt.*exp(1j*SEVAngel); %
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%
SEBranchI=abs(cmpSEBranchI);%
Objective=Objective+sum((SEBranchI-this.mBranchI.^2).^2./this.sigma^2);%%
% (SEBranchI-this.mBranchI).^2./(this.sigma^2)
Objective=Objective+sum((SEBranchI-this.mBranchI).^2./(this.sigma^2));%%
%% 线
SEBranchP=real((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
Objective=Objective+sum((SEBranchP-this.mBranchP).^2/this.sigma^2);
Objective=Objective+sum((SEBranchQ-this.mBranchQ).^2/this.sigma^2);
% (SEBranchP-this.mBranchP).^2/(this.sigma^2)./(this.mBranchP.^2);
Objective=Objective+sum((SEBranchP-this.mBranchP).^2/(this.sigma^2));
Objective=Objective+sum((SEBranchQ-this.mBranchQ).^2/(this.sigma^2));
%%
newwordParameter=this.newwordParameter;
cmpY=this.cmpY;
transP=TransPower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transP-this.mTransP).^2/this.sigma^2);
Objective=Objective+sum((transP-this.mTransP).^2/(this.sigma^2));
transQ=TransReactivePower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transQ-this.mTransQ).^2/this.sigma^2);
Objective=Objective+sum((transQ-this.mTransQ).^2/(this.sigma^2));
%% 0
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
%%
% Objective=Objective+(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))'*(1./this.sigma^2*eye(length(this.mPG(this.onlyPG))))*(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)));
% Objective=Objective+(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)))'*(1./this.sigma^2*eye(length(this.mQG(this.onlyQG))))*(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)));
% Objective=Objective+sum(((this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))/this.sigma).^2);
% Objective=Objective+sum(((this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)))./this.sigma).^2);
end