@@ -6,8 +6,8 @@ classdef SEOpti
|
||||
mBranchQ=NaN;
|
||||
onlyPG=NaN;
|
||||
onlyQG=NaN;
|
||||
PG=NaN;
|
||||
QG=NaN;
|
||||
mPG=NaN;
|
||||
mQG=NaN;
|
||||
sigma=NaN;
|
||||
Busnum=NaN;
|
||||
lineI=NaN;
|
||||
@@ -18,6 +18,12 @@ classdef SEOpti
|
||||
zerosInjectionIndex=NaN;
|
||||
cmpY=NaN;
|
||||
Balance=NaN;
|
||||
mnle=NaN;
|
||||
mnlrhs=NaN;
|
||||
Y=NaN;
|
||||
Yangle=NaN;
|
||||
r=NaN;
|
||||
c=NaN;
|
||||
end
|
||||
|
||||
methods
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
function [ out_arg ] = equ(this, x )
|
||||
function [ out_arg,this ] = equ(this, x )
|
||||
%EQU Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
SEVolt=x(1:this.Busnum);
|
||||
SEVAngel=x(this.Busnum+1:2*this.Busnum);
|
||||
cmpSEV=SEVolt.*exp(1j*SEVAngel); %¸´Êýµçѹ
|
||||
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
|
||||
out_arg=[real(PQ(this.zerosInjectionIndex));imag(PQ(this.zerosInjectionIndex));];
|
||||
|
||||
YAngle=sparse(this.r,this.c,SEVAngel(this.r)-SEVAngel(this.c)-this.Yangle,this.Busnum,this.Busnum);
|
||||
PQ1=diag(SEVolt)*(this.Y.*cos(YAngle))*SEVolt;
|
||||
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=full(out_arg);
|
||||
this.mnle=zeros(2*length(this.zerosInjectionIndex)+1,1);
|
||||
this.mnlrhs=this.mnle;
|
||||
end
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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);%复数支路电流
|
||||
@@ -18,7 +18,7 @@ Objective=Objective+(SEBranchQ-this.mBranchQ)'*(1./this.sigma^2*eye(length(this.
|
||||
%% 0注入节点
|
||||
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
|
||||
%% 发电机注入功率
|
||||
Objective=Objective+(this.PG(this.onlyPG)-real(PQ(this.onlyPG)))'*(1./this.sigma^2*eye(length(this.PG(this.onlyPG))))*(this.PG(this.onlyPG)-real(PQ(this.onlyPG)));
|
||||
Objective=Objective+(this.QG(this.onlyQG)-imag(PQ(this.onlyQG)))'*(1./this.sigma^2*eye(length (this.QG(this.onlyQG))))*(this.QG(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
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectionIndex,cmpY,onlyPG,onlyQG,PG,QG,Balance,mBranchI,mBranchP,mBranchQ )
|
||||
function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectionIndex,cmpY,onlyPG,onlyQG,mPG,mQG,Balance,mBranchI,mBranchP,mBranchQ,Y,Yangle,r,c )
|
||||
%INIT Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
this.mVolt=mVolt;
|
||||
@@ -13,12 +13,15 @@ function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectio
|
||||
this.cmpY=cmpY;
|
||||
this.onlyPG=onlyPG;
|
||||
this.onlyQG=onlyQG;
|
||||
this.PG=PG;
|
||||
this.QG=QG;
|
||||
this.mPG=mPG;
|
||||
this.mQG=mQG;
|
||||
this.Balance=Balance;
|
||||
this.mBranchI=mBranchI;
|
||||
this.mBranchP=mBranchP;
|
||||
this.mBranchQ=mBranchQ;
|
||||
|
||||
this.Y=Y;
|
||||
this.Yangle=Yangle;
|
||||
this.r=r;
|
||||
this.c=c;
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function [ output_args ] = nle( this )
|
||||
%NLE Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=zeros(2*length(this.zerosInjectionIndex)+1,1);
|
||||
output_args=this.mnle;
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function [ output_args ] = nlrhs( this )
|
||||
%NLRHS Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=zeros(2*length(this.zerosInjectionIndex)+1,1);
|
||||
output_args=this.mnlrhs;
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user