ncp_sigmoid/NCP函数法/snd_setting.m

28 lines
1.3 KiB
Matlab
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function [secondBegin,m,r,l,u,z,w,y,Gama,Arlfa,meritF,firstT,firstcapK,firstfx,Gap,mu,Vfirst,Pgfirst,Qgfirst]=...
snd_setting(secondBegin,transNum,T,m,r,capNum,capK,para1,para2,fx,centrPara,e,f,Pg,Qg)
%程序功能:光滑处理过程重新初始化
%编写时间2010年11月
%% 光滑处理阶段,各变量重新赋值
secondBegin=secondBegin-1;
Gama=para2;
Arlfa=para1;
meritF=[]; %初始化求最优步长时的效益函数
m=m+transNum+capNum; %等式约束个数增加变压器变比、电容器可调档位对应的凝聚函数
r=r-transNum-capNum; %不等式约束条件个数,考虑有功无功约束、节点电压约束、线路功率约束,变压器变比、电容器可调档位上下限约束不再需要
clear l u z w y;
s=1; %松弛因子和拉格朗日乘子重新赋值
l=s*ones(r,1);
u=l;
z=l;
w=-l;
y=sparse(m,1);
Gap=l'*z-u'*w; %计算互补间隙
mu=(centrPara*Gap)/(2*r); %计算扰动因子
%% 保留预计算结果
firstT=T;
firstcapK=capK;
firstfx=fx;
Vfirst=sqrt(e.*e+f.*f);
Pgfirst=Pg;
Qgfirst=Qg;