⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fm_xfirst.m

📁 电力系统的psat
💻 M
字号:
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-2005 Federico Milano%% This toolbox is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU% General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.global DAE Settingsglobal Motif Mot.n  DAE.x(Mot.slip) = 0;  a = find(Mot.con(:,6) == 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.3;    DAE.x(Mot.e1m(ord3)) = 0.8;  end  if ~isempty(ord5)    DAE.x(Mot.e1r(ord5)) = 0.3;    DAE.x(Mot.e1m(ord5)) = 0.8;    DAE.x(Mot.e2r(ord5)) = 0.3;    DAE.x(Mot.e2m(ord5)) = 0.8;  endendglobal Hvdcif Hvdc.n  DAE.x(Hvdc.xr) = 0.5*ones(Hvdc.n,1);  DAE.x(Hvdc.xi) = 0.5*ones(Hvdc.n,1);endglobal Statcomif Statcom.n  DAE.x(Statcom.Vdc) = Statcom.con(:,7);  DAE.x(Statcom.alpha) = zeros(Statcom.n,1);  DAE.x(Statcom.m) = sqrt(8/3)*Statcom.con(:,6)./Statcom.con(:,7);  DAE.x(Statcom.Vmdc) = Statcom.con(:,7);  DAE.x(Statcom.Vmac) = Statcom.con(:,6);endglobal Ssscif Sssc.n  DAE.x(Sssc.Vdc) = Sssc.con(:,21);  DAE.x(Sssc.beta) = -1.57; %4.7124*ones(Sssc.n,1);  DAE.x(Sssc.m) = sqrt(8/3)*ones(Sssc.n,1);  DAE.x(Sssc.Pmac) = Sssc.con(:,22);  DAE.x(Sssc.Vmdc) = Sssc.con(:,21);endglobal Upfcif Upfc.n  DAE.x(Upfc.Vmdc) = Upfc.con(:,15);  DAE.x(Upfc.Vmac) = Upfc.con(:,14);  DAE.x(Upfc.Vdc) = Upfc.con(:,15);  DAE.x(Upfc.alpha) = zeros(Upfc.n,1);  DAE.x(Upfc.m) = sqrt(8/3)*Upfc.con(:,14)./Upfc.con(:,15);  DAE.x(Upfc.Imd) = sqrt(2)*Upfc.con(:,26);  DAE.x(Upfc.Imq) = sqrt(2)*Upfc.con(:,27);  Ka = Settings.rad*(Upfc.con(:,20)+Upfc.con(:,22))./(Upfc.con(:,21)+Upfc.con(:,23));  DAE.x(Upfc.x1) = Ka.*DAE.x(Upfc.Imd);  DAE.x(Upfc.x2) = Ka.*DAE.x(Upfc.Imq);endglobal RLCfor i = 1:RLC.n  ord = RLC.con(i,6);  switch ord   case 1    DAE.x(RLC.vd(i)) = 0;    DAE.x(RLC.vq(i)) = 0;   case 2    DAE.x(RLC.id(i)) = 0;    DAE.x(RLC.iq(i)) = 0;   case 3    DAE.x(RLC.vd(i)) = 0;    DAE.x(RLC.vq(i)) = 0;    DAE.x(RLC.id(i)) = 0;    DAE.x(RLC.iq(i)) = 0;  endendglobal Phsif 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; endendglobal Ltcif Ltc.n, DAE.x(Ltc.m) = ones(Ltc.n,1); endglobal Pmuif 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -