加入变压器支路

This commit is contained in:
facat
2013-04-22 21:56:16 +08:00
parent 27bd5cb77c
commit 03865e7b64
9 changed files with 119 additions and 92 deletions

View File

@@ -20,6 +20,11 @@ classdef SEOpti
Balance=NaN;
mnle=NaN;
mnlrhs=NaN;
mTransP=NaN;
mTransQ=NaN;
transI=NaN;
transJ=NaN;
newwordParameter=NaN;
end
methods

View File

@@ -10,7 +10,7 @@ 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.Busnum+this.Balance)];
out_arg=[out_arg;x(this.Balance+this.Busnum)];
out_arg=full(out_arg);
this.mnle=zeros(2*length(this.zerosInjectionIndex)+1,1);
this.mnlrhs=this.mnle;

28
@SEOpti/fun.asv Normal file
View File

@@ -0,0 +1,28 @@
function [ Objective ] = fun(this, x )
%FUN Summary of this function goes here
% Detailed explanation goes here
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;
% %% 支路电流
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);%%电流
%% 线路功率
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);
%% 变压器
newwordParameter=th
transP=TransPower( newwordParameter,cmpY,Volt,VAngel );
%% 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)));
end

View File

@@ -1,6 +1,7 @@
function [ Objective ] = fun(this, x )
%FUN Summary of this function goes here
% Detailed explanation goes here
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);%
@@ -8,17 +9,24 @@ Objective=(SEVolt-this.mVolt)'*(1./this.sigma^2*eye(length(this.mVolt)))*(SEVolt
% %%
cmpSEV=SEVolt.*exp(1j*SEVAngel); %
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%
SEBranchI=real(cmpSEBranchI).^2+imag(cmpSEBranchI).^2;%
Objective=Objective+(SEBranchI-this.mBranchI.^2)'*(1./this.sigma^2*eye(length(this.mBranchI)))*(SEBranchI-this.mBranchI.^2);%%
%%
SEBranchI=abs(cmpSEBranchI);%
Objective=Objective+sum((SEBranchI-this.mBranchI.^2).^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+(SEBranchP-this.mBranchP)'*(1./this.sigma^2*eye(length(this.mBranchP)))*(SEBranchP-this.mBranchP);
Objective=Objective+(SEBranchQ-this.mBranchQ)'*(1./this.sigma^2*eye(length(this.mBranchQ)))*(SEBranchQ-this.mBranchQ);
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);
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.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+(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)));
end

View File

@@ -1,4 +1,4 @@
function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectionIndex,cmpY,onlyPG,onlyQG,mPG,mQG,Balance,mBranchI,mBranchP,mBranchQ)
function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectionIndex,cmpY,onlyPG,onlyQG,mPG,mQG,Balance,mBranchI,mBranchP,mBranchQ,mTransP,mTransQ)
%INIT Summary of this function goes here
% Detailed explanation goes here
this.mVolt=mVolt;
@@ -19,6 +19,10 @@ function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectio
this.mBranchI=mBranchI;
this.mBranchP=mBranchP;
this.mBranchQ=mBranchQ;
this.mTransP=mTransP;
this.mTransQ=mTransQ;
this.newwordParameter=newwordParameter;
% this.Y=Y;
% this.Yangle=Yangle;
% this.r=r;