设为首页收藏本站|繁體中文 快速切换版块

 找回密码
 立即加入
搜索
查看: 3016|回复: 11

最优潮流

  [复制链接]

该用户从未签到

尚未签到

发表于 2011-9-8 17:17:59 | 显示全部楼层 |阅读模式

马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!

您需要 登录 才可以下载或查看,没有账号?立即加入

×
刚刚上研一,想写最优潮流,有sb有最优潮流的MATLAB程序吗?谢谢哦~
"真诚赞赏,手留余香"
还没有人打赏,支持一下
楼主热帖
帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

该用户从未签到

尚未签到

发表于 2011-9-13 12:00:34 | 显示全部楼层
你可以看看matpower。基于matlab的潮流计算。里面有OPF。希望能帮到你
"真诚赞赏,手留余香"
还没有人打赏,支持一下
帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

该用户从未签到

尚未签到

发表于 2011-10-14 21:56:36 | 显示全部楼层
Matpower
"真诚赞赏,手留余香"
还没有人打赏,支持一下
帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
  • TA的每日心情
    无聊
    2020-11-23 21:46
  • 签到天数: 3 天

    连续签到: 1 天

    [LV.2]偶尔看看I

    累计签到:3 天
    连续签到:1 天
    发表于 2011-11-25 11:10:24 | 显示全部楼层
    回复 2# helton8221 / e9 N# w- {. n8 u8 z# U8 |

    4 G8 C! J1 T/ h5 m$ _! Q# s( O9 {
    , W( n. d9 O: V4 q7 b    大哥,是可以在matpower里面直接看到最优潮流的matlab程序吗?
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
  • TA的每日心情
    无聊
    2017-9-26 15:28
  • 签到天数: 21 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    累计签到:21 天
    连续签到:1 天
    发表于 2011-11-30 11:27:31 | 显示全部楼层
    楼主,你的帖子里“sb”是啥意思呀,小心删贴处罚你
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

    该用户从未签到

    尚未签到

    发表于 2011-12-3 10:57:38 | 显示全部楼层
    我咋记得PSAT里面有呢, 还是MATPOWER来着, 反正其中有一个有OPF的按钮.
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
  • TA的每日心情
    开心
    2021-3-9 07:58
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]偶尔看看I

    累计签到:6 天
    连续签到:1 天
    发表于 2012-4-20 20:00:12 | 显示全部楼层
    function [busout, genout, branchout, f, success, info, et, g, jac, xr, pimul] = ..." {2 V5 y3 I' j% y* _
        opf(varargin)  v) ~. M8 p$ A# y8 ]
    %OPF  Solves an optimal power flow.
    + {, [2 `. l+ l7 W, y: q%   [RESULTS, SUCCESS] = OPF(MPC, MPOPT)
    ) i" N. ~$ F* \1 \4 L- |* `6 T  Z%
    . L' N) U% ?$ y; v9 H%   Returns either a RESULTS struct and an optional SUCCESS flag, or individual
    + E/ y8 g" y9 ]) K+ l%   data matrices, the objective function value and a SUCCESS flag. In the3 A& `! e& S5 h' p! B8 }
    %   latter case, there are additional optional return values. See Examples! q/ V8 W; S' {9 R2 j2 k0 [$ _6 \
    %   below for the possible calling syntax options.% f6 H1 S" n+ v; M0 T* `' F
    %) j0 |0 M. w8 k. |7 T! M9 ]3 |
    %   Examples:8 L: l+ ~. ~( O' N
    %       Output argument options:
    & f5 ]  R# {* N# s$ a) V6 e# I%
    1 Y5 ~6 |% f3 ?9 _0 K: p, P7 x2 I4 l%       results = opf(...)
    + P. i4 O6 ~0 G6 ^0 s- K2 w%       [results, success] = opf(...)
    ) X* T' o5 y% b/ b%       [bus, gen, branch, f, success] = opf(...)4 ?4 p' x. V6 v+ t7 A
    %       [bus, gen, branch, f, success, info, et, g, jac, xr, pimul] = opf(...)' H7 }  V3 \# n; @, \
    %2 |# ?# o" x1 A& ^" ^' |
    %       Input arguments options:; K2 T  G) e+ g" B# V3 V" F
    %
    7 Q5 d' O( q5 n%       opf(mpc)
    % k- _. Y  @6 [%       opf(mpc, mpopt)/ `/ t/ g* q/ \) v$ @; R( M
    %       opf(mpc, userfcn, mpopt)" o$ @  d" K8 K" L& T
    %       opf(mpc, A, l, u)
    2 L. b0 K0 |( L2 r/ @%       opf(mpc, A, l, u, mpopt)
    8 C- s3 Q  E' X/ S2 S, K4 f3 e%       opf(mpc, A, l, u, mpopt, N, fparm, H, Cw)6 F+ J( L# Q! z8 ~# t% p- g
    %       opf(mpc, A, l, u, mpopt, N, fparm, H, Cw, z0, zl, zu)
    2 h! g6 X0 f3 |' U( o& {2 r+ ]8 E%8 w7 I( M6 g# v8 e
    %       opf(baseMVA, bus, gen, branch, areas, gencost)
    ! h! Y) n3 l) x$ {%       opf(baseMVA, bus, gen, branch, areas, gencost, mpopt)% u6 }' }- P5 }3 X; M0 g2 v: I
    %       opf(baseMVA, bus, gen, branch, areas, gencost, userfcn, mpopt)7 {1 J0 M; N6 N) \! z7 Z9 d
    %       opf(baseMVA, bus, gen, branch, areas, gencost, A, l, u)5 ]7 R  b$ S/ t1 p( |
    %       opf(baseMVA, bus, gen, branch, areas, gencost, A, l, u, mpopt)) p+ D$ A& A1 ]) U
    %       opf(baseMVA, bus, gen, branch, areas, gencost, A, l, u, ...
    " t8 l5 p" `5 `. g%                                   mpopt, N, fparm, H, Cw)
    . }8 j) ^! x7 y%       opf(baseMVA, bus, gen, branch, areas, gencost, A, l, u, ...0 c3 X8 Y6 A0 a* C- \
    %                                   mpopt, N, fparm, H, Cw, z0, zl, zu), N1 p9 f' m+ H4 q# D
    %" W. _0 c/ U4 a) a& R/ O
    %   The data for the problem can be specified in one of three ways:
    % D0 `; i, I! Y' L%   (1) a string (mpc) containing the file name of a MATPOWER case& C6 F8 j* Y4 |/ z9 T6 t8 D
    %     which defines the data matrices baseMVA, bus, gen, branch, and8 H( h2 y' s) ]
    %     gencost (areas is not used at all, it is only included for
    6 n0 o( u- E! _. Y2 `%     backward compatibility of the API).' C' P. J7 p) x0 v
    %   (2) a struct (mpc) containing the data matrices as fields.) g' k" i) c' ~
    %   (3) the individual data matrices themselves.
    " o) u; S+ B" m& b+ {5 q4 r. t3 i%   
      y0 {1 n/ i3 s" b$ Y' |" B7 z%   The optional user parameters for user constraints (A, l, u), user costs
    8 I- ]7 H3 r: u4 D+ F" r" [9 z. [# N4 p%   (N, fparm, H, Cw), user variable initializer (z0), and user variable
    , ^0 h: ]. `9 O%   limits (zl, zu) can also be specified as fields in a case struct,, p/ @  J5 c! D4 B3 W% x: h
    %   either passed in directly or defined in a case file referenced by name.4 i2 J8 h# g$ |
    %   $ D8 V$ V7 E. u3 H7 m9 z( l0 @! p- i
    %   When specified, A, l, u represent additional linear constraints on the' R* `; x) A/ Q1 B( S7 X+ l) N+ F
    %   optimization variables, l <= A*[x; z] <= u. If the user specifies an A, b+ h' P; a" k
    %   matrix that has more columns than the number of "x" (OPF) variables," p; y, ^6 B8 \- d$ S" X
    %   then there are extra linearly constrained "z" variables. For an2 Y. x; w  M. q# D, E
    %   explanation of the formulation used and instructions for forming the0 i# I2 y# n( [, F# |$ p
    %   A matrix, see the manual.
    % X1 l% L7 V/ B) \%* V2 w& h1 u* D3 C
    %   A generalized cost on all variables can be applied if input arguments
    % M' c% B& J3 h, @%   N, fparm, H and Cw are specified.  First, a linear transformation
    - g2 w, G- R% j: B! c%   of the optimization variables is defined by means of r = N * [x; z].
    - Q2 ^9 y$ O$ N/ ?0 h, D, T! f%   Then, to each element of r a function is applied as encoded in the
    0 B& x$ N5 S: {: c4 T: r) w+ C  q7 m%   fparm matrix (see manual). If the resulting vector is named w,3 x. H! R+ ~- g$ v" l# X# h6 D  Z
    %   then H and Cw define a quadratic cost on w: (1/2)*w'*H*w + Cw * w .. R  ?8 X& {. `, l' I
    %   H and N should be sparse matrices and H should also be symmetric.# u6 S) g: {6 K8 {8 ~  W
    %) _5 w& W7 v6 `- U( X
    %   The optional mpopt vector specifies MATPOWER options. If the OPF
    1 I6 v4 G2 B& y; z4 X) e* @4 @, B%   algorithm is not explicitly set in the options MATPOWER will use
    8 S. I3 m. G- y+ ~7 f%   the default solver, based on a primal-dual interior point method.
    5 z& v/ D/ }- N( j( l2 T/ H%   For the AC OPF this is OPF_ALG = 560, unless the TSPOPF optional
    ) t4 J* E! c+ e  }4 f0 v%   package is installed, in which case the default is 540. For the; t3 m! _6 Z8 I
    %   DC OPF, the default is OPF_ALG_DC = 200. See MPOPTION for) ~4 M: v% N  p6 Z( `/ o
    %   more details on the available OPF solvers and other OPF options
    6 G2 Q5 `5 V# b) a7 s%   and their default values.
    0 n% E1 p+ i2 ]9 z  @) Y%
    5 N. H4 j8 o& S& `4 M3 s. B3 w- }%   The solved case is returned either in a single results struct (described" a1 u3 k. c9 E7 ~0 G
    %   below) or in the individual data matrices, bus, gen and branch. Also
    + |- \4 k* ]9 o7 ^8 a% a# H& e%   returned are the final objective function value (f) and a flag which is
      O* B- K  n* w1 z; t" I7 j%   true if the algorithm was successful in finding a solution (success).1 B9 l: \% I8 n8 g) v8 a) a
    %   Additional optional return values are an algorithm specific return status+ e/ T& K+ u1 n. L
    %   (info), elapsed time in seconds (et), the constraint vector (g), the
    6 J' W; C/ b/ }( V%   Jacobian matrix (jac), and the vector of variables (xr) as well : D+ x3 ]/ L. F
    %   as the constraint multipliers (pimul).9 X2 o; d, k" M" n# l" ~
    %/ _  p/ ]7 k# \# n
    %   The single results struct is a MATPOWER case struct (mpc) with the
    " u( k- Z" r9 i4 b, ?%   usual baseMVA, bus, branch, gen, gencost fields, along with the. \7 m6 s' E6 N& f" A2 o
    %   following additional fields:
    3 G/ R' ]/ B6 s* V: _%( G( N- ]4 p1 F1 l7 Y3 H! i
    %       .order      see 'help ext2int' for details of this field& C3 e) [7 L; h6 A, V7 B5 N
    %       .et         elapsed time in seconds for solving OPF3 }) w8 x; q' s( ~( N! Y
    %       .success    1 if solver converged successfully, 0 otherwise2 m! h* G# i; d+ h5 z$ D/ M3 b) l
    %       .om         OPF model object, see 'help opf_model': b& F1 O, o. l2 h) l* Z
    %       .x          final value of optimization variables (internal order)
    , y/ t* x/ ?# @" |%       .f          final objective function value0 `0 l# \1 A* X
    %       .mu         shadow prices on ...1 U3 e2 @. L+ P3 M3 R
    %           .var
    , _% p" o' ~* r. W/ j9 O%               .l  lower bounds on variables
    * M* b/ R2 ?3 P%               .u  upper bounds on variables
    1 l6 k3 ?' Z% b%           .nln
    * F/ ^' j3 H, x%               .l  lower bounds on nonlinear constraints
    * O$ X, r. z" x) h2 D( b" V/ S%               .u  upper bounds on nonlinear constraints1 Y7 L6 H/ u. u8 r% y' P* C
    %           .lin  `& ~5 y, Z: ~# S
    %               .l  lower bounds on linear constraints0 o, \$ A3 o' `3 D& F
    %               .u  upper bounds on linear constraints& {/ i, ]7 @+ e8 f& [
    %       .raw        raw solver output in form returned by MINOS, and more, o% v: J; V; P/ n. T
    %           .xr     final value of optimization variables. M2 X3 R8 d9 ?9 f
    %           .pimul  constraint multipliers
    * c7 B  S" I" D; K%           .info   solver specific termination code8 v+ S4 T2 }$ ?8 y0 o# ]' Q
    %           .output solver specific output information
    9 I& _+ L9 L+ E( a' C%              .alg algorithm code of solver used
    # K: ]6 }* D) ^% U1 d9 E%           .g      (optional) constraint values1 v+ [" ^2 A* ?9 ]% I
    %           .dg     (optional) constraint 1st derivatives
    3 j3 _4 t: }- @%           .df     (optional) obj fun 1st derivatives (not yet implemented): d1 W8 R5 }, d9 l: E
    %           .d2f    (optional) obj fun 2nd derivatives (not yet implemented)
    ' H- d* O# p+ w) Y3 a%       .var+ ^6 q; }4 x: z* u% B. i, J* e# I
    %           .val    optimization variable values, by named block% w$ ~1 \4 e+ @* T9 r
    %               .Va     voltage angles
    , S0 d3 d6 f2 ^* F# @2 S5 B  W- p%               .Vm     voltage magnitudes (AC only)% v5 W4 P4 _: t& ]4 b
    %               .Pg     real power injections  V3 ]: g7 h9 n. @! [0 ^( ?# c( q
    %               .Qg     reactive power injections (AC only)6 q6 K. [* [* Q: H. R/ f1 K
    %               .y      constrained cost variable (only if have pwl costs)
    $ ?9 y5 W; z2 ~* K( K4 V0 t# i%               (other) any user defined variable blocks& I$ n6 r5 J  g5 w
    %           .mu     variable bound shadow prices, by named block) d4 b7 D1 W$ u5 D0 K3 }* V8 G8 d
    %               .l  lower bound shadow prices1 b5 }( c7 [+ R1 }1 _+ t
    %                   .Va, Vm, Pg, Qg, y, (other): u/ o& A1 u. V2 ^
    %               .u  upper bound shadow prices4 V# T, ^/ d6 j: d# c4 j8 N
    %                   .Va, Vm, Pg, Qg, y, (other)
    9 o- u3 @0 x- c; i* I- Z* S%       .nln    (AC only)
    # s6 [8 f1 L. O%           .mu     shadow prices on nonlinear constraints, by named block& O, I9 [; H- z1 d6 M. [4 A
    %               .l  lower bounds
    * D* B, i: H7 x. n. J%                   .Pmis   real power mismatch equations: [: m7 T/ H- D8 X4 L! _
    %                   .Qmis   reactive power mismatch equations" u! o# v9 i3 U+ L) B
    %                   .Sf     flow limits at "from" end of branches0 e( p9 i1 o8 ~8 t& M# w
    %                   .St     flow limits at "to" end of branches
    , \: a0 a) C1 S0 W9 l# U7 t%               .u  upper bounds7 K, L% v( b, j# S1 h
    %                   .Pmis, Qmis, Sf, St7 `7 L0 M% F3 \! Q5 y& U4 Z+ C5 a
    %       .lin
      r" i! v! W9 L0 z' _9 R%           .mu     shadow prices on linear constraints, by named block% T8 ?( J8 E$ b% r, _
    %               .l  lower bounds
    & |" V+ r# F/ P%                   .Pmis   real power mistmatch equations (DC only)
    2 j* N' p+ b9 M  M%                   .Pf     flow limits at "from" end of branches (DC only)
    6 k3 Q, B. q& t3 A1 |' e%                   .Pt     flow limits at "to" end of branches (DC only)* S' e2 n# V6 A2 M! m- F
    %                   .PQh    upper portion of gen PQ-capability curve (AC only)
    ( g% g: V8 \4 C* {0 L7 l% f* h%                   .PQl    lower portion of gen PQ-capability curve (AC only)
    8 n( H7 W8 h+ D' S: p# ]0 R4 s! F%                   .vl     constant power factor constraint for loads (AC only)
    . d8 }; U+ H, H# @%                   .ycon   basin constraints for CCV for pwl costs! o, W( V6 t! M% R
    %                   (other) any user defined constraint blocks3 P, Q# W+ k3 u$ K1 [1 F$ Z0 @
    %               .u  upper bounds! D' @, o( g/ o
    %                   .Pmis, Pf, Pf, PQh, PQl, vl, ycon, (other)# x1 f* X8 ?# S# A0 q, y/ d$ _
    %       .cost       user defined cost values, by named block: K" `3 Z- ]0 R6 C% @5 i' a
    %6 F% _' Z. E: _' G
    %   See also RUNOPF, DCOPF, UOPF, CASEFORMAT.8 k6 X: e# |! U3 q
      Y& k; m4 Q" V9 M) A# p
    %   MATPOWER+ G& H- X( T+ W
    %   $Id: opf.m,v 1.73 2010/06/09 14:56:58 ray Exp $! ?) c2 Q1 N/ M6 ~
    %   by Ray Zimmerman, PSERC Cornell2 X* a8 e  C0 s8 o1 F, j: J
    %   and Carlos E. Murillo-Sanchez, PSERC Cornell & Universidad Autonoma de Manizales
    5 m) w# ~# m: f1 ]%   Copyright (c) 1996-2010 by Power System Engineering Research Center (PSERC)
    & P0 g4 P( z" T) R%
    8 r# i4 v' L8 `- f# }%   This file is part of MATPOWER.) M" k& R1 g$ P0 c7 L. i' R4 N
    %   See http://www.pserc.cornell.edu/matpower/ for more info.
    9 h& A' c" A; v" L  n/ y' a%
    1 p* [  Z; e2 R2 u/ v! N6 q%   MATPOWER is free software: you can redistribute it and/or modify# }9 T6 ~$ O% [) q: Q$ v
    %   it under the terms of the GNU General Public License as published
    * ?8 K2 k2 p& t- i6 y%   by the Free Software Foundation, either version 3 of the License,
    ' ^1 H/ l3 K4 i1 y& e%   or (at your option) any later version.9 j" _8 H6 v1 _, E$ a# o8 n
    %
    - E% }0 `" B: c) ^2 ]%   MATPOWER is distributed in the hope that it will be useful,/ O& m; d* W2 q1 g/ P2 e
    %   but WITHOUT ANY WARRANTY; without even the implied warranty of$ B' ~% P  _; @
    %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the! e- ]' l* {7 ~; r7 p3 ^2 X
    %   GNU General Public License for more details.
    , b1 ~" e1 L# M  @9 y- J%
    - c  j, ?' S7 |& h  s6 f%   You should have received a copy of the GNU General Public License( B- h! q7 p+ t7 G. B/ f4 n: d! O
    %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.2 Q2 ?0 s) y( U
    %& ?' \, l7 B. p5 B% V! j
    %   Additional permission under GNU GPL version 3 section 7( a! z0 y7 ?# R- N1 m
    %
    % _/ Z2 l( E1 |%   If you modify MATPOWER, or any covered work, to interface with7 v+ i0 z; Q' M# @5 i. c9 \% z& n
    %   other modules (such as MATLAB code and MEX-files) available in a
    * k" x( H0 z# z- i3 _6 S%   MATLAB(R) or comparable environment containing parts covered2 p% B+ ]: i# q7 L9 ]0 q" x+ W! W1 w
    %   under other licensing terms, the licensors of MATPOWER grant
    . `7 t7 A5 l  P%   you additional permission to convey the resulting work.3 u+ J0 |# H  P2 {
    8 p# l: X8 B: M/ S8 P- N
    %%----- initialization -----
    ; W) C( G+ f, N6 c, Qt0 = clock;         %% start timer7 Q% m# E' T5 w) i) u3 a
    - f+ T5 d; [; ]! B
    %% define named indices into data matrices4 a* N0 p8 J! }
    [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...6 T( h! ~" ~* B! X+ D' L5 e6 j
        VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;" S9 a( w- e7 g
    [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...
    ! Z$ a4 o7 x% l, l' P! @- v" A/ w    MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...1 x9 T2 y* Z! T9 o0 e5 J8 {
        QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;9 g# C' Z6 g3 K. K* V3 N
    [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
    5 N9 S, ~. K7 |* t    TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...$ @; `4 v) R1 y# V$ q
        ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
    . b# T& S1 C8 d: I. e[PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;
    ( K+ H2 R. Z% j$ J) F  t; o1 P1 ~9 E$ Q9 w9 l5 L
    %% process input arguments+ p/ b; o2 n  Q- b
    [mpc, mpopt] = opf_args(varargin{:});9 I; w8 V: U6 j: l. s' _' n

    7 ]# ]9 `0 O4 F1 l%% add zero columns to bus, gen, branch for multipliers, etc if needed  t6 Z: D# r: g5 A
    nb   = size(mpc.bus, 1);    %% number of buses
    3 Z5 _: ^  Z9 U- G' {+ Y- Vnl   = size(mpc.branch, 1); %% number of branches
    ! h5 |( G/ ^' b+ }: }& Mng   = size(mpc.gen, 1);    %% number of dispatchable injections3 |7 N9 B/ c6 u2 {$ |* U
    if size(mpc.bus,2) < MU_VMIN
      Q! e0 M) C) P# p  mpc.bus = [mpc.bus zeros(nb, MU_VMIN-size(mpc.bus,2)) ];
    : U3 Z6 `! }' {/ Lend$ f7 y- ~& ]" K$ d- ]* V
    if size(mpc.gen,2) < MU_QMIN. J1 P' N5 f* x& }; B7 Z
      mpc.gen = [ mpc.gen zeros(ng, MU_QMIN-size(mpc.gen,2)) ];
    * D) H8 W5 r, |0 send
    % |5 p: k: A* k" z) o* M! Aif size(mpc.branch,2) < MU_ANGMAX7 v# H* I2 H/ E0 E
      mpc.branch = [ mpc.branch zeros(nl, MU_ANGMAX-size(mpc.branch,2)) ];
    6 r% u/ N0 k. F/ h9 V% W8 T' Nend
    $ J; L$ @" k/ x1 N6 k2 w" }
    ( Z& J+ {4 K9 ^4 S3 w0 v, Q* g%%-----  convert to internal numbering, remove out-of-service stuff  -----0 K' N5 r9 T8 r: P/ {( e& B
    mpc = ext2int(mpc);
    0 ^6 l: `1 X/ p, E6 I2 |1 w& J/ O% Z6 g$ h
    %%-----  construct OPF model object  -----* p6 I. i/ _& y; e6 z( Q
    om = opf_setup(mpc, mpopt);
    2 n- ~6 s* L4 M$ f2 g- d# w% l/ b( @9 I" I* _$ N) f; V
    %%-----  execute the OPF  -----
    ) @* b4 n3 m% G7 z* n7 a6 _if nargout > 7
    0 h: Z! v7 w1 \: {    mpopt(52) = 1;      %% RETURN_RAW_DER
    - w, u. ]! T3 |8 }) Hend+ Y. t" v- A* m+ A
    [results, success, raw] = opf_execute(om, mpopt);2 S6 Q5 |% r2 J0 G! r

    1 @3 Y7 J# J2 ]" n) S- R%%-----  revert to original ordering, including out-of-service stuff  -----
    # M. w# E* S0 O1 }, Yresults = int2ext(results);
    6 U- J7 k$ }0 ], r' {$ h7 {* h# Y! [  M9 y
    %% zero out result fields of out-of-service gens & branches* }- Q; \4 \4 X4 u  U) y! z& i
    if ~isempty(results.order.gen.status.off)% h4 ~5 E- |) F# ~* R
      results.gen(results.order.gen.status.off, [PG QG MU_PMAX MU_PMIN]) = 0;
    5 V, [8 ]3 U# C+ K$ c5 ]end# B* t; X+ ?  r5 {+ ^7 C" x; k. B
    if ~isempty(results.order.branch.status.off)' T4 z. a6 {" c8 z* Z
      results.branch(results.order.branch.status.off, [PF QF PT QT MU_SF MU_ST MU_ANGMIN MU_ANGMAX]) = 0;1 o8 p; j9 |2 o% m( s
    end0 J+ q+ p( i* C
    ! e+ i" O- X: P: q) t6 f
    %%-----  finish preparing output  -----
    2 M' G! f# }7 Q  eet = etime(clock, t0);      %% compute elapsed time
    8 ?( _) m. L  ?7 fif nargout > 0' K2 q% `1 y5 s+ H! o3 T8 ?* }
      if nargout <= 2/ k0 a0 A" q8 Y; w, [' ]1 e' X
        results.et = et;' H' `2 V+ ]# l7 y
        results.success = success;
    " E1 X) Q9 Y3 k, `1 A. c4 [    results.raw = raw;1 g9 G, [: G5 t5 I# R
        busout = results;
    8 q' a0 j1 m4 K- ?* p, k# ~    genout = success;# j; Q; ?9 e! l
      else. h5 `3 K5 F# z
        [busout, genout, branchout, f, info, xr, pimul] = deal(results.bus, ...$ M' P7 y4 z" K# k' I) s4 R$ M
            results.gen, results.branch, results.f, raw.info, raw.xr, raw.pimul);$ B; o3 [: n& e8 K% s! a" p+ p' p
        if isfield(results, 'g')
    : m8 R4 n4 h3 f, m      g = results.g;
    9 c2 m0 u5 U4 Y- s+ o, ~/ m    end$ ?9 l/ [/ h% j4 ~
        if isfield(results, 'dg')
    ' `6 E+ a% E6 L. ]' j& }5 j0 i2 d7 f      jac = results.dg;2 f) x/ L  u6 K. I4 q" p! _
        end
    2 C6 E8 u% m& ?% k( _4 E8 I3 k  end
    1 m# n" a' z" Helseif success
    2 K$ T3 [' Y2 G  results.et = et;
    9 b6 K! J) d6 s  M# ^; K/ j  results.success = success;
    ) |8 K& Z" p8 `( L# ?  printpf(results, 1, mpopt);# Q1 @) d& \- y# E
    end
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

    该用户从未签到

    尚未签到

    发表于 2012-6-1 10:22:44 | 显示全部楼层
    PSAT里有直接算最优潮流的按钮,不用编程,很方便的
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

    该用户从未签到

    尚未签到

    发表于 2013-5-20 15:29:14 | 显示全部楼层
    。。。坛子里有
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】

    该用户从未签到

    尚未签到

    发表于 2013-5-22 15:19:13 | 显示全部楼层
    回复 6# 白萝卜
    9 ~3 c/ E* o# r! D+ s+ x9 Z! Y7 w/ a8 h$ q

    8 O; j2 `7 u8 z0 j! X" ~  在psat中可以直接画模型,基本上opf潮流计算(稳态)是没问题。进一步讨论得具体分析
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
    您需要登录后才可以回帖 登录 | 立即加入

    本版积分规则

    招聘斑竹

    小黑屋|手机版|APP下载(beta)|Archiver|电力研学网 ( 赣ICP备12000811号-1|赣公网安备36040302000210号 )|网站地图

    GMT+8, 2026-4-30 19:31

    Powered by Discuz! X3.5 Licensed

    © 2001-2026 Discuz! Team.

    快速回复 返回顶部 返回列表