目录
1 部分复现
2 概述
3 运行结果
4 Matlab代码实现
1 部分复现
2 概述
从控制策略上电压无功控制主要分为全局控制和分散控制。其中全局控制策略是指由调度中心统一下发指令,例如文献通过求解一个全同性的优化问题集中控制配电网的电压无功设备。基于数据驱动方法实现配电网的统一无功优化。
而分散控制是指不同电压无功控制设备协同优化,例如文献提出了两级协调控制模式以实现DG的分层优化。文献[2]利用一致性算法协调DG的有功无功出力,实现了配电网电压和功率的分布式协同优化。文献以无功补偿设备容量利用比为一致性变量,通过协同优化算法实现配电网电压无功优化控制。
3 运行结果
利用IEEE33测试节点算例说明二阶锥松弛的准确性
CPXPARAM_MIP_Display 1
Tried aggregator 1 time.
QCP Presolve eliminated 9408 rows and 1704 columns.
Aggregator did 336 substitutions.
Reduced QCP has 7728 rows, 5712 columns, and 17808 nonzeros.
Reduced QCP has 768 quadratic constraints.
Presolve time = 0.01 sec. (6.80 ticks)
Parallel mode: using up to 16 threads for barrier.
Number of nonzeros in lower triangle of A*A' = 34104
Using Approximate Minimum Degree ordering
Total time for automatic ordering = 0.00 sec. (2.49 ticks)
Summary statistics for Cholesky factor:Threads = 16Rows in Factor = 7728Integer space required = 12264Total non-zeros in factor = 83880Total FP ops to factor = 1017720Itn Primal Obj Dual Obj Prim Inf Upper Inf Dual Inf Inf Ratio0 3.0337406e+02 -7.6106781e-01 7.30e+03 0.00e+00 6.21e+03 1.00e+001 3.0427107e+01 1.6560187e+00 7.30e+03 0.00e+00 6.21e+03 5.54e-012 5.5432810e+00 2.6608161e-01 7.32e+02 0.00e+00 6.22e+02 2.69e+003 8.5159524e-01 -9.6574600e-02 1.35e+02 0.00e+00 1.15e+02 1.50e+014 1.4611180e-01 -6.8774608e-02 2.43e+01 0.00e+00 2.06e+01 6.92e+015 5.7055442e-02 -8.7266983e-04 5.49e+00 0.00e+00 4.67e+00 3.22e+026 2.8129625e-02 1.9071094e-02 1.46e+00 0.00e+00 1.24e+00 2.37e+037 2.5320794e-02 2.3848906e-02 2.27e-01 0.00e+00 1.93e-01 1.82e+048 2.5013002e-02 2.4772517e-02 3.65e-02 0.00e+00 3.11e-02 1.42e+059 2.4971013e-02 2.4933730e-02 5.92e-03 0.00e+00 5.03e-03 1.32e+0610 2.4964786e-02 2.4958751e-02 9.10e-04 0.00e+00 7.74e-04 1.07e+0711 2.4963608e-02 2.4963505e-02 1.47e-04 0.00e+00 1.25e-04 1.63e+0912 2.4963589e-02 2.4963588e-02 2.48e-06 0.00e+00 2.11e-06 3.29e+11
时间已过 3.339317 秒。
Ploss_total =
2.4964
4 Matlab代码实现
%定义变量
U=sdpvar(33,24);%电压的平方
I=sdpvar(32,24);%电流的平方
P=sdpvar(32,24);%线路有功
Q=sdpvar(32,24);%线路无功
Pg=sdpvar(33,24);%发电机有功
Qg=sdpvar(33,24);%发电机无功
Pin=-father*P+father*(I.*(r*ones(1,24)))+son*P;%节点注入有功
Qin=-father*Q+father*(I.*(x*ones(1,24)))+son*Q;%节点注入无功
Ploss_total=sum(sum(I.*(r*ones(1,24))));%目标函数,网损最小
%约束条件
C1=[U>=Umin,U<=Umax,Pg>=-Pgmax,Pg<=Pgmax,Qg>=-Qgmax,Qg<=Qgmax];%电压边界
C1=[C1,I>=0,I<=0.11,P>=-0.11,P<=0.11,Q>=-0.11,Q<=0.11];%电流和功率边界
C2=[Pin+Pload-Pg==0];%有功KCL约束
C3=[Qin+Qload-Qg==0];%无功KCL约束
C4=[U(Line(:,2),:)==U(Line(:,1),:)-2*(r*ones(1,24)).*P-2*(x*ones(1,24)).*Q+((r.^2+x.^2)*ones(1,24)).*I];%电压降落约束
C5=[U(Line(:,1),:).*I>=P.^2+Q.^2];%二阶锥约束
C=[C1,C2,C3,C4,C5];
toc%建模时间
ops=sdpsettings('solver','cplex');
result=solvesdp(C,Ploss_total,ops);
toc%求解时间
Ploss_total=100*double(Ploss_total)
P=double(P);Q=double(Q);U=double(U);I=double(I);
error=P.^2+Q.^2-U(Line(:,1),:).*I;
boxplot(error')
%% 完整代码:
链接:https://pan.baidu.com/s/1PyoZmsbf26VU9zNLeDw0gw
提取码:t5f9
--来自百度网盘超级会员V2的分享
son(1,18)=1;son(2,22)=1;son(5,25)=1;son(33,1)=1;
Umax=[1.07*1.07*ones(32,24);1.05*1.05*ones(1,24)];
Umin=[0.93*0.93*ones(32,24);1.05*1.05*ones(1,24)];
Pgmax=[zeros(32,24);ones(1,24)];
Qgmax=[zeros(32,24);ones(1,24)];