33
@SEOpti/SEOpti.m
Normal file
33
@SEOpti/SEOpti.m
Normal file
@@ -0,0 +1,33 @@
|
||||
classdef SEOpti
|
||||
properties
|
||||
mVolt=0;
|
||||
mVAngel=0;
|
||||
mBranchI=0;
|
||||
mBranchP=0;
|
||||
mBranchQ=0;
|
||||
onlyPG=0;
|
||||
onlyQG=0;
|
||||
PG=0;
|
||||
QG=0;
|
||||
sigma=0;
|
||||
Busnum=0;
|
||||
lineI=0;
|
||||
lineJ=0;
|
||||
lineR=0;
|
||||
lineX=0;
|
||||
lineB2=0;
|
||||
zerosInjectionIndex=0;
|
||||
cmpY=0;
|
||||
Balance=0;
|
||||
end
|
||||
|
||||
methods
|
||||
function [this]=SEOpti()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
13
@SEOpti/equ.m
Normal file
13
@SEOpti/equ.m
Normal file
@@ -0,0 +1,13 @@
|
||||
function [ out_arg ] = 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);
|
||||
% Constraints=[SEVAngel(Balance)==0,PQ(zerosInjectionIndex)==0];
|
||||
out_arg=[real(PQ(this.zerosInjectionIndex));imag(PQ(this.zerosInjectionIndex));];
|
||||
|
||||
out_arg=[out_arg;x(this.Busnum+this.Balance)];
|
||||
end
|
||||
|
||||
25
@SEOpti/fun.m
Normal file
25
@SEOpti/fun.m
Normal file
@@ -0,0 +1,25 @@
|
||||
function [ Objective ] = fun(this, x )
|
||||
%FUN Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
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);%电压
|
||||
%% 支路电流
|
||||
cmpSEV=SEVolt.*exp(1j*SEVAngel); %复数电压
|
||||
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%复数支路电流
|
||||
SEBranchI=abs(cmpSEBranchI);% 支路电流幅值
|
||||
Objective=Objective+(SEBranchI-this.mBranchI)'*(1./this.sigma^2*eye(length(this.mBranchI)))*(SEBranchI-this.mBranchI);%%电流
|
||||
%% 支路功率
|
||||
SEBranchP=real((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(SEBranchI));
|
||||
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(SEBranchI));
|
||||
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);
|
||||
% %% 0注入节点
|
||||
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
|
||||
% zeroInjP=real(PQ(this.zerosInjectionIndex));%% 0注入节点
|
||||
% zeroInjQ=imag(PQ(this.zerosInjectionIndex));%% 0注入节点
|
||||
%% 发电机注入功率
|
||||
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)));
|
||||
end
|
||||
|
||||
21
@SEOpti/init.m
Normal file
21
@SEOpti/init.m
Normal file
@@ -0,0 +1,21 @@
|
||||
function [ this ] = init(this,Busnum, mVolt,sigma,newwordParameter,zerosInjectionIndex,cmpY,onlyPG,onlyQG,PG,QG,Balance )
|
||||
%INIT Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
this.mVolt=mVolt;
|
||||
this.sigma=sigma;
|
||||
this.Busnum=Busnum;
|
||||
this.lineI=newwordParameter.line.lineI;
|
||||
this.lineJ=newwordParameter.line.lineJ;
|
||||
this.lineR=newwordParameter.line.lineR;
|
||||
this.lineX=newwordParameter.line.lineX;
|
||||
this.lineB2=newwordParameter.line;
|
||||
this.zerosInjectionIndex=zerosInjectionIndex;
|
||||
this.cmpY=cmpY;
|
||||
this.onlyPG=onlyPG;
|
||||
this.onlyQG=onlyQG;
|
||||
this.PG=PG;
|
||||
this.QG=QG;
|
||||
this.Balance=Balance;
|
||||
|
||||
end
|
||||
|
||||
7
@SEOpti/nle.m
Normal file
7
@SEOpti/nle.m
Normal file
@@ -0,0 +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);
|
||||
|
||||
end
|
||||
|
||||
7
@SEOpti/nlrhs.m
Normal file
7
@SEOpti/nlrhs.m
Normal file
@@ -0,0 +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);
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user