parent
56724685da
commit
e64070e9a1
|
|
@ -20,6 +20,8 @@ classdef Opti
|
|||
cl=NaN;%opti toolbox大于小于等于
|
||||
cu=NaN;%等式、不等式约束右边的值
|
||||
Balance=NaN;
|
||||
rPD=NaN;
|
||||
rQD=NaN;
|
||||
end
|
||||
|
||||
methods
|
||||
|
|
|
|||
15
@Opti/equ.m
15
@Opti/equ.m
|
|
@ -24,14 +24,21 @@ VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
|||
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
||||
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||
output_args=[dP;dQ;VAngel(Balance)];
|
||||
%% 开始增加不等式约束-电压\PD\QD
|
||||
%电压不等式约束
|
||||
this.cu=zeros(length(output_args),1);
|
||||
this.cl=this.cu;
|
||||
%% 开始增加不等式约束-电压\PD\QD
|
||||
%电压不等式约束
|
||||
output_args=[output_args;Volt];
|
||||
output_args=full(output_args);
|
||||
%电压
|
||||
this.cu=[this.cu;1.1*ones(length(Volt),1)];
|
||||
this.cl=[this.cl;0.9*ones(length(Volt),1)];
|
||||
%% PD
|
||||
rPD=this.rPD;
|
||||
rQD=this.rQD;
|
||||
output_args=[output_args;PD];
|
||||
this.cu=[this.cu;1.2*rPD];
|
||||
this.cl=[this.cl;0.8*rPD];
|
||||
output_args=full(output_args);
|
||||
this.cu=full(this.cu);
|
||||
this.cl=full(this.cl);
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function [ this ] = init( this,Volt0,PDi,QDi,wPD,wQD,PD0,QD0,Y,Angel,r,c,PG,QG,Balance )
|
||||
function [ this ] = init( this,Volt0,PDi,QDi,wPD,wQD,PD0,QD0,Y,Angel,r,c,PG,QG,Balance,rPD,rQD )
|
||||
%INIT Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
this.PDi=PDi;
|
||||
|
|
@ -15,5 +15,7 @@ this.PG=PG;
|
|||
this.QG=QG;
|
||||
this.Balance=Balance;
|
||||
this.Volt0=Volt0;
|
||||
this.rPD=rPD;
|
||||
this.rQD=rQD;
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ QDi=find(QD~=0);
|
|||
% PD0=PD0(PDi);
|
||||
% QD0=QD0(QDi);
|
||||
seOpti=Opti();
|
||||
seOpti=seOpti.init(Volt0,PDi,QDi,wPD,wQD,PD0,QD0,Y,Angle,r,c,PG,QG,Balance);
|
||||
seOpti=seOpti.init(Volt0,PDi,QDi,wPD,wQD,PD0,QD0,Y,Angle,r,c,PG,QG,Balance,rPD(PDi),rQD(QDi));
|
||||
opts = optiset('solver','filtersd');
|
||||
opts.maxiter=85500;
|
||||
opts.maxtime=3000;
|
||||
|
|
|
|||
Loading…
Reference in New Issue