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