setup.m

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

M
47
字号
function a = setup(a,varargin)global Settingsswitch nargin case 2  Bus = varargin{1}; otherwise  global Busendif isempty(a.con), return, enda.n = length(a.con(:,1));[a.bus1,a.v1] = getbus(Bus,a.con(:,1));[a.bus2,a.v2] = getbus(Bus,a.con(:,2));if length(a.con(1,:)) < a.ncol  a.u = ones(a.n,1);else  a.u = a.con(:,a.ncol);enda.iters = zeros(a.n,1);a.delay = zeros(a.n,1);a.store = a.con;% initialize delay functiona.iters = 0;a.delay = 0;% fix remote control bus numbera.vr = a.v2;idx = find(a.con(:,16) == 3);if ~isempty(idx)  a.vr(idx) = getvint(Bus,a.con(idx,15));  %a.con(idx,16) = 1;end% fix nominal tap ratioidx = find(a.con(:,6) == 0);if ~isempty(idx)  a.dat(idx,6) = 1;endSettings.nseries = Settings.nseries + a.n;

⌨️ 快捷键说明

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