%% input Qgen Pelec V 注意:Qgen不是注入节点的无功,应该是暂态电抗后的无功
V4=abs(Vwinit(co_node)); %Voltage at WTG bus
Vterm4=V4;
Qgen4=Qgen4abs(co_node)/Sbasem4; %Initial reactive power
%pu mach
Pelec4=Pelec4abs(co_node)/Sbasem4; %Initial active power
%disp('Complex power after shunt reactance Xsec')
Sgen4=Pelec4+1i*Qgen4;
%disp('Reactive power into shunt reactance Xsec')
Sx4=(abs(Vwinit(co_node)))^2/(-1i*Xsec);
%disp('Complex power in front of shunt reactance Xsec')
Selec4=Sgen4+Sx4;
s0gc=Xsec*imag(Selec4)/Vterm4; %Eq
s1gc=real(Selec4)/Vterm4; %Ip
,
s1cc=s0gc; %Eqcmd
s0cc=Vterm4; %Vref
图中状态变量的初始化见下面的代码
Pord=s1gc*Vterm4; %=Pelec4 in the case that Vterm4=V(4)=real number.
Qord=Qgen4;
s6cc=Pelec4;
s7cc=0; %Q droop
s5cc=Qord;
s2cc=0;
s4cc=s5cc-s2cc;
%s3cc=Vreg4;
风电惯量控制:
%Wind inertia control
s13wt=0;
s12wt=0;
%Power response rate limiter
s10wt=0;
Pinp的初始化
pinp=Pord;
s4wt=pinp;
s2wt=s4wt/w(co_node); %Tcmd0
s11wt=Pmech4;
%Pitch compensation and pitch controller
if (pinp-pstl) < 0
s3wt=-Kpc*(pinp-pstl); %Initial values of pitch compensator
s1wt=0; %Inital value of pitch controller
else
s3wt=theta(co_node);
s1wt=0;
end
wref=w(co_node);
s5wt=wref;