fcall.m

来自「用于电力系统的一个很好的分析软件」· M 代码 · 共 34 行

M
34
字号
function fcall(p)global DAEif ~p.n, return, endvcs = DAE.x(p.vcs);vcs_max = p.con(:,8);vcs_min = p.con(:,9);ty3 = find(p.con(:,2) == 3);if ty3     global Line  [Ps,Qs,Pr,Qr] = flows(Line,'pq',p.line);  [Ps,Qs,Pr,Qr] = flows(p,Ps,Qs,Pr,Qr,'sssc');  Kin = p.con(:,12);  tp = ty3(find(p.con(ty3,10) == 1));  ta = ty3(find(p.con(ty3,10) == 2));      if tp    DAE.f(p.vpi(tp)) = p.u(tp).*Kin(tp).*(DAE.y(p.pref(tp))-Ps(tp));  end  if ta    DAE.f(p.vpi(ta)) = p.u(ta).*Kin(ta).*(DAE.y(p.pref(ta))-Ps(ta)-Pr(ta));  endendu = ~(vcs >= vcs_max & DAE.f(p.vcs) > 0) & ...    ~(vcs <= vcs_min & DAE.f(p.vcs) < 0);DAE.f(p.vcs) = p.u.*u.*(DAE.y(p.v0)-vcs)./p.con(:,7);DAE.x(p.vcs) = min(vcs_max,DAE.x(p.vcs));DAE.x(p.vcs) = max(vcs_min,DAE.x(p.vcs));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?