gcall.m

来自「基于PSAT 软件的多目标最优潮流计算用于中小型电力系统的分析和管理」· M 代码 · 共 61 行

M
61
字号
function p = gcall(p)global Bus DAE Settings Varname PVif ~p.n, return, endDAE.gp(p.bus) = 0;if ~Settings.pv2pq   DAE.gq(p.bus) = 0;     returnend% ================================================% check reactive power limits% ================================================% find max mismatch errorif 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 + =
减小字号Ctrl + -
显示快捷键?