fm_xfirst.m

来自「这是一个很适合研究和学习用的电力系统仿真软件」· M 代码 · 共 59 行

M
59 行
字号
function fm_xfirst
% FM_XFIRST initialize state variables for components included
%           in power flow computations
%
% FM_XFIRST
%
%Author:    Federico Milano
%Date:      11-Nov-2002
%Version:   1.0.0
%
%E-mail:    fmilano@thunderbox.uwaterloo.ca
%Web-site:  http://thunderbox.uwaterloo.ca/~fmilano
%
% Copyright (C) 2002-2006 Federico Milano

global DAE Settings

global Mot
if Mot.n
  DAE.x(Mot.slip) = 0;
  a = find(Mot.dat(:,12) == 0);
  if ~isempty(a), DAE.x(Mot.slip(a)) = 1; end
  ord3 = find(Mot.con(:,5) == 3);
  ord5 = find(Mot.con(:,5) == 5);
  if ~isempty(ord3)
    DAE.x(Mot.e1r(ord3)) = 0.05;
    DAE.x(Mot.e1m(ord3)) = 0.9;
  end
  if ~isempty(ord5)
    DAE.x(Mot.e1r(ord5)) = 0.05;
    DAE.x(Mot.e1m(ord5)) = 0.9;
    DAE.x(Mot.e2r(ord5)) = 0.05;
    DAE.x(Mot.e2m(ord5)) = 0.9;
  end
end

global Hvdc
if Hvdc.n
  DAE.x(Hvdc.xr) = 0.5*ones(Hvdc.n,1);
  DAE.x(Hvdc.xi) = 0.5*ones(Hvdc.n,1);
end

global Phs
if Phs.n
  DAE.x(Phs.alpha) = 0;
  DAE.x(Phs.Pm) = 0; %Phs.con(:,10);
  idx = find(Phs.con(:,7)==0);
  if ~isempty(idx), Phs.con(idx,7) = 1e-3; end
end

global Ltc
if Ltc.n, DAE.x(Ltc.m) = ones(Ltc.n,1); end

global Pmu
if Pmu.n
  DAE.x(Pmu.vm) = ones(Pmu.n,1);
  DAE.x(Pmu.thetam) = zeros(Pmu.n,1);
end

⌨️ 快捷键说明

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