亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? runpf.m

?? 電力潮流計算程序 很有用處 可以大家學習哈
?? M
字號:
function [MVAbase, bus, gen, branch, success, et] = ...    			runpf(casename, mpopt, fname, solvedcase)%RUNPF  Runs a power flow.%%   [baseMVA, bus, gen, branch, success, et] = ...%           runpf(casename, mpopt, fname, solvedcase)%%   Runs a power flow (full AC Newton's method by default) and optionally%   returns the solved values in the data matrices, a flag which is true if%   the algorithm was successful in finding a solution, and the elapsed time%   in seconds. All input arguments are optional. If casename is provided it%   specifies the name of the input data file or struct (see also 'help%   caseformat' and 'help loadcase') containing the power flow data. The%   default value is 'case9'. If the mpopt is provided it overrides the%   default MATPOWER options vector and can be used to specify the solution%   algorithm and output options among other things (see 'help mpoption' for%   details). If the 3rd argument is given the pretty printed output will be%   appended to the file whose name is given in fname. If solvedcase is%   specified the solved case will be written to a case file in MATPOWER%   format with the specified name. If solvedcase ends with '.mat' it saves%   the case as a MAT-file otherwise it saves it as an M-file.%%   If the ENFORCE_Q_LIMS options is set to true (default is false) then if%   any generator reactive power limit is violated after running the AC power%   flow, the corresponding bus is converted to a PQ bus, with Qg at the%   limit, and the case is re-run. The voltage magnitude at the bus will%   deviate from the specified value in order to satisfy the reactive power%   limit. If the reference bus is converted to PQ, the first remaining PV%   bus will be used as the slack bus for the next iteration. This may%   result in the real power output at this generator being slightly off%   from the specified values.%   MATPOWER%   $Id: runpf.m,v 1.14 2006/09/29 19:23:07 ray Exp $%   by Ray Zimmerman, PSERC Cornell%   Enforcing of generator Q limits inspired by contributions%   from Mu Lin, Lincoln University, New Zealand (1/14/05).%   Copyright (c) 1996-2005 by Power System Engineering Research Center (PSERC)%   See http://www.pserc.cornell.edu/matpower/ for more info.%%-----  initialize  -----%% define named indices into bus, gen, branch matrices[PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...    VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;[F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...    TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...    ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;[GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...    MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...    QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;%% default argumentsif nargin < 4    solvedcase = '';                %% don't save solved case    if nargin < 3        fname = '';                 %% don't print results to a file        if nargin < 2            mpopt = mpoption;       %% use default options            if nargin < 1                casename = 'case9'; %% default data file is 'case9.m'            end        end    endend%% optionsverbose = mpopt(31);qlim = mpopt(6);                    %% enforce Q limits on gens?dc = mpopt(10);                     %% use DC formulation?%% read data & convert to internal bus numbering[baseMVA, bus, gen, branch] = loadcase(casename);[i2e, bus, gen, branch] = ext2int(bus, gen, branch);%% get bus index lists of each type of bus[ref, pv, pq] = bustypes(bus, gen);%% generator infoon = find(gen(:, GEN_STATUS) > 0);      %% which generators are on?gbus = gen(on, GEN_BUS);                %% what buses are they at?%%-----  run the power flow  -----t0 = clock;if dc                               %% DC formulation    %% initial state    Va0 = bus(:, VA) * (pi/180);        %% build B matrices and phase shift injections    [B, Bf, Pbusinj, Pfinj] = makeBdc(baseMVA, bus, branch);        %% compute complex bus power injections (generation - load)    %% adjusted for phase shifters and real shunts    Pbus = real(makeSbus(baseMVA, bus, gen)) - Pbusinj - bus(:, GS) / baseMVA;        %% "run" the power flow    Va = dcpf(B, Pbus, Va0, ref, pv, pq);        %% update data matrices with solution    branch(:, [QF, QT]) = zeros(size(branch, 1), 2);    branch(:, PF) = (Bf * Va + Pfinj) * baseMVA;    branch(:, PT) = -branch(:, PF);    bus(:, VM) = ones(size(bus, 1), 1);    bus(:, VA) = Va * (180/pi);    %% update Pg for swing generator (note: other gens at ref bus are accounted for in Pbus)    %%      Pg = Pinj + Pload + Gs    %%      newPg = oldPg + newPinj - oldPinj    refgen = find(gbus == ref);             %% which is(are) the reference gen(s)?    gen(on(refgen(1)), PG) = gen(on(refgen(1)), PG) + (B(ref, :) * Va - Pbus(ref)) * baseMVA;        success = 1;else                                %% AC formulation    %% initial state    % V0    = ones(size(bus, 1), 1);            %% flat start    V0  = bus(:, VM) .* exp(sqrt(-1) * pi/180 * bus(:, VA));    V0(gbus) = gen(on, VG) ./ abs(V0(gbus)).* V0(gbus);        if qlim        ref0 = ref;                         %% save index and angle of        Varef0 = bus(ref0, VA);             %%   original reference bus        limited = [];                       %% list of indices of gens @ Q lims        fixedQg = zeros(size(gen, 1), 1);   %% Qg of gens at Q limits    end    repeat = 1;    while (repeat)        %% build admittance matrices        [Ybus, Yf, Yt] = makeYbus(baseMVA, bus, branch);                %% compute complex bus power injections (generation - load)        Sbus = makeSbus(baseMVA, bus, gen);                %% run the power flow        alg = mpopt(1);        if alg == 1            [V, success, iterations] = newtonpf(Ybus, Sbus, V0, ref, pv, pq, mpopt);        elseif alg == 2 | alg == 3            [Bp, Bpp] = makeB(baseMVA, bus, branch, alg);            [V, success, iterations] = fdpf(Ybus, Sbus, V0, Bp, Bpp, ref, pv, pq, mpopt);        elseif alg == 4            [V, success, iterations] = gausspf(Ybus, Sbus, V0, ref, pv, pq, mpopt);        else            error('Only Newton''s method, fast-decoupled, and Gauss-Seidel power flow algorithms currently implemented.');        end                %% update data matrices with solution        [bus, gen, branch] = pfsoln(baseMVA, bus, gen, branch, Ybus, Yf, Yt, V, ref, pv, pq);                if qlim             %% enforce generator Q limits            %% find gens with violated Q constraints            mx = find( gen(:, GEN_STATUS) > 0 & gen(:, QG) > gen(:, QMAX) );            mn = find( gen(:, GEN_STATUS) > 0 & gen(:, QG) < gen(:, QMIN) );                        if ~isempty(mx) | ~isempty(mn)  %% we have some Q limit violations                if isempty(pv)                	if verbose                		if ~isempty(mx)			                	fprintf('Gen %d (only one left) exceeds upper Q limit : INFEASIBLE PROBLEM\n', mx);                		else		                	fprintf('Gen %d (only one left) exceeds lower Q limit : INFEASIBLE PROBLEM\n', mn);                		end	                end                	success = 0;                	break;                end                if verbose & ~isempty(mx)                    fprintf('Gen %d at upper Q limit, converting to PQ bus\n', mx);                end                if verbose & ~isempty(mn)                    fprintf('Gen %d at lower Q limit, converting to PQ bus\n', mn);                end                                %% save corresponding limit values                fixedQg(mx) = gen(mx, QMAX);                fixedQg(mn) = gen(mn, QMIN);                mx = [mx;mn];                                %% convert to PQ bus                gen(mx, QG) = fixedQg(mx);      %% set Qg to binding limit                gen(mx, GEN_STATUS) = 0;        %% temporarily turn off gen,                for i = 1:length(mx)            %% (one at a time, since                    bi = gen(mx(i), GEN_BUS);   %%  they may be at same bus)                    bus(bi, [PD,QD]) = ...      %% adjust load accordingly,                        bus(bi, [PD,QD]) - gen(mx(i), [PG,QG]);                end                bus(gen(mx, GEN_BUS), BUS_TYPE) = PQ;   %% & set bus type to PQ                                %% update bus index lists of each type of bus                ref_temp = ref;                [ref, pv, pq] = bustypes(bus, gen);                if verbose & ref ~= ref_temp                    fprintf('Bus %d is new slack bus\n', ref);                end                limited = [limited; mx];            else                repeat = 0; %% no more generator Q limits violated            end        else            repeat = 0;     %% don't enforce generator Q limits, once is enough        end    end    if qlim & ~isempty(limited)        %% restore injections from limited gens (those at Q limits)        gen(limited, QG) = fixedQg(limited);    %% restore Qg value,        for i = 1:length(limited)               %% (one at a time, since            bi = gen(limited(i), GEN_BUS);      %%  they may be at same bus)            bus(bi, [PD,QD]) = ...              %% re-adjust load,                bus(bi, [PD,QD]) + gen(limited(i), [PG,QG]);        end        gen(limited, GEN_STATUS) = 1;               %% and turn gen back on        if ref ~= ref0            %% adjust voltage angles to make original ref bus correct            bus(:, VA) = bus(:, VA) - bus(ref0, VA) + Varef0;        end    endendet = etime(clock, t0);%%-----  output results  -----%% convert back to original bus numbering & print results[bus, gen, branch] = int2ext(i2e, bus, gen, branch);if fname    [fd, msg] = fopen(fname, 'at');    if fd == -1        error(msg);    else        printpf(baseMVA, bus, gen, branch, [], success, et, fd, mpopt);        fclose(fd);    endendprintpf(baseMVA, bus, gen, branch, [], success, et, 1, mpopt);%% save solved caseif solvedcase    savecase(solvedcase, baseMVA, bus, gen, branch);end%% this is just to prevent it from printing baseMVA%% when called with no output argumentsif nargout, MVAbase = baseMVA; endreturn;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区3| 久久精品国产成人一区二区三区| 精品粉嫩aⅴ一区二区三区四区| 欧美性极品少妇| 色综合久久九月婷婷色综合| 99re成人在线| 成人的网站免费观看| 成人av资源网站| 日韩欧美久久久| 国产亚洲欧美在线| 欧美国产日韩亚洲一区| 中文字幕在线视频一区| 国产视频一区不卡| 日韩经典一区二区| 美女视频网站久久| 国产精品亚洲第一| 不卡区在线中文字幕| 精品国产污污免费网站入口| 手机精品视频在线观看| 色婷婷综合五月| 中文字幕在线观看一区| 黄网站免费久久| 色一情一伦一子一伦一区| 久久精品日韩一区二区三区| 美女视频免费一区| 日韩欧美综合在线| 国产欧美日韩精品a在线观看| 一区二区三区在线免费播放| 青青草国产精品97视觉盛宴| 成人综合婷婷国产精品久久蜜臀| 在线亚洲精品福利网址导航| 91精品国产福利在线观看| 亚洲欧美影音先锋| 成人中文字幕合集| 国产欧美日韩中文久久| 国产一区二区视频在线播放| 欧美亚洲一区三区| 亚洲一区二区三区四区在线| 色欲综合视频天天天| 亚洲欧美另类小说视频| 精品夜夜嗨av一区二区三区| 色天天综合色天天久久| 亚洲欧美国产三级| 色噜噜狠狠一区二区三区果冻| 精品久久久久久综合日本欧美| 洋洋成人永久网站入口| 一本大道av伊人久久综合| 亚洲欧美一区二区三区国产精品 | 青青青伊人色综合久久| 欧美精品久久天天躁| 中文字幕高清不卡| 成人综合日日夜夜| 亚洲色图另类专区| 国产精品99久久久久久宅男| 久久久久久久综合色一本| 日韩中文欧美在线| 欧美一级黄色片| 国内精品伊人久久久久av一坑| 久久久久免费观看| bt7086福利一区国产| 久久久精品免费网站| 国产成人啪午夜精品网站男同| 日韩欧美高清dvd碟片| 精一区二区三区| 国产欧美日韩综合| 色综合一区二区| 中文字幕国产精品一区二区| 99国产精品久久久| 亚洲国产精品自拍| 色综合久久综合网97色综合| 亚洲午夜久久久久| 91.com在线观看| 一区二区免费在线| 6080yy午夜一二三区久久| 精久久久久久久久久久| 国产精品伦理一区二区| 国产乱人伦偷精品视频免下载| 中文一区一区三区高中清不卡| 99re这里只有精品首页| 午夜精品久久久久影视| 欧美性大战久久久久久久 | 亚洲欧美另类久久久精品2019| 欧洲国产伦久久久久久久| 欧美bbbbb| 国产欧美一区二区三区在线老狼| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲bt欧美bt精品777| 91福利精品视频| 麻豆成人免费电影| 亚洲人成影院在线观看| 91精品午夜视频| 成人教育av在线| 天天综合色天天综合色h| 国产女主播视频一区二区| 91电影在线观看| 国产在线一区二区综合免费视频| 亚洲女人****多毛耸耸8| 日韩精品一区二区三区中文不卡| 99久久伊人精品| 蜜臀av一区二区| 亚洲少妇中出一区| 精品国产一区二区三区四区四| 色综合天天综合在线视频| 乱中年女人伦av一区二区| 亚洲精品欧美激情| 欧美色成人综合| 奇米影视在线99精品| 国产精品天干天干在线综合| 91精品国产日韩91久久久久久| 国产成人精品免费网站| 日韩精品一区第一页| 中文字幕一区日韩精品欧美| 欧美va亚洲va国产综合| 在线精品视频免费观看| 国产成人综合精品三级| 日本美女视频一区二区| 久久五月婷婷丁香社区| 成人一级片网址| 美女爽到高潮91| 亚洲影院理伦片| 中文字幕一区二区三区在线观看| 欧美电影精品一区二区| 欧美男生操女生| 国产资源精品在线观看| 亚洲va国产天堂va久久en| 综合中文字幕亚洲| 久久精品免费在线观看| 日韩欧美自拍偷拍| 欧美精品久久一区二区三区 | 久热成人在线视频| 亚洲国产精品一区二区久久恐怖片| 国产精品美女一区二区| 精品国产成人系列| 日韩小视频在线观看专区| 欧美日韩精品一区视频| 欧洲视频一区二区| 99re热视频这里只精品| 成人av网站在线观看| 成人午夜视频福利| 国产一区不卡视频| 久久激情五月激情| 麻豆91在线观看| 日韩电影一区二区三区| 午夜视频久久久久久| 一区二区三区四区五区视频在线观看| 国产精品久久毛片a| 欧美经典一区二区| 久久精品免费在线观看| 国产婷婷精品av在线| 久久夜色精品一区| 2022国产精品视频| 国产亚洲视频系列| 国产精品网站在线观看| 国产精品久久久久久久蜜臀| 国产在线精品不卡| 激情五月婷婷综合网| 寂寞少妇一区二区三区| 激情都市一区二区| 国产成人在线网站| av高清久久久| 色欧美片视频在线观看在线视频| 色偷偷久久人人79超碰人人澡 | 国产一本一道久久香蕉| 国产尤物一区二区| 国产电影一区二区三区| 成人一区二区三区| 91丝袜美女网| 国产一区二区三区在线看麻豆| 黄页视频在线91| 床上的激情91.| 91日韩一区二区三区| 在线观看日产精品| 69久久99精品久久久久婷婷| 欧美一级生活片| 精品sm捆绑视频| 欧美激情在线看| 亚洲蜜臀av乱码久久精品| 亚洲一线二线三线视频| 天堂午夜影视日韩欧美一区二区| 日本成人中文字幕在线视频| 久久草av在线| 国产激情精品久久久第一区二区| 99国产精品久久久久久久久久| 在线免费观看视频一区| 91精品国产综合久久久蜜臀图片| 欧美xxxx在线观看| 欧美国产97人人爽人人喊| 中文字幕一区二区三区在线播放| 一区二区三区成人在线视频| 日本中文一区二区三区| 国产一区二区三区四区五区美女| 成人午夜免费av| 欧美日韩免费电影| 久久网这里都是精品| 亚洲精品欧美激情| 激情综合网激情| 91视频一区二区三区| 欧美一区日韩一区| 日本一区二区三区四区| 亚洲国产乱码最新视频|