📄 gcall.m
字号:
function p = gcall(p)global DAE Bus Settingsif ~p.n, return, endK = p.u.*(1+DAE.kg*p.con(:,10));DAE.g(p.bus) = DAE.g(p.bus) - K.*p.con(:,4);if ~Settings.pv2pq DAE.g(p.vbus(find(p.u))) = 0; returnend% ================================================% check reactive power limits% ================================================% find max mismatch errorif isempty(DAE.g) prev_err = inf;else prev_err = 2*max(abs(DAE.g));endp.newpq = 0;% Q min% ================================================% Limit check improved by Lars L. 2006-01.[tmp,idx] = max(p.u.*(p.con(:,7) - DAE.g(p.vbus) - prev_err)); if tmp > 0 if ~p.pq(idx) fm_disp(['Switch PV bus <', ... Bus.names{p.bus(idx)}, ... '> to PQ bus: Min Qg reached']) end p.qg(idx) = p.con(idx,7); p.pq(idx) = 1; p.newpq = 1;end% Q max% ================================================% Limit check improved by Lars L. 2006-01.[tmp,idx] = min(p.u.*(p.con(:,6) - DAE.g(p.vbus) + prev_err));if tmp < 0 & ~p.newpq if ~p.pq(idx) fm_disp(['Switch PV bus <', ... Bus.names{p.bus(idx)}, ... '> to PQ bus: Max Qg reached']) end p.qg(idx) = p.con(idx,6); p.pq(idx) = 1; p.newpq = 1;end% Generator reactive powers% ================================================DAE.g(p.vbus) = DAE.g(p.vbus) - p.u.*p.qg;DAE.g(p.vbus(find(~p.pq & p.u))) = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -