|
马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
我最近在用Python调用PSS/E动态模拟计算.; Z( m2 n4 R7 z% e& @8 [/ Z
我的版本是:: A2 n# Z$ y5 M& p
Python 2.5: p3 }/ r$ D& O0 [9 v3 e# e* v
PSS/E 31
4 L3 }. }: ?6 g, s+ s v在31之前的版本是不支持Python的动态模拟调用的.. ]3 p) H/ Z% R, b$ j" I8 U1 D& i
3 x. a/ p, S( D- C2 B
我的一个简单算例:
7 i* k1 ]9 x9 b" x) r
K! [3 U0 o- r3 v4 O/ w% b import os,sys
& t" s# ^6 Z' I _4 V sys.path.append('C:\\Program Files\\PTI\\PSSE31\\PSSBIN')& E# [) S9 @0 o- Z
os.environ['PATH'] += ';C:\\Program Files\\PTI\\PSSE31\\PSSBIN'* T- n# _3 n( q" B; B
T6 u/ {6 S8 I7 r& d. ^0 p
import redirect( |! a) p* G/ M3 W' s1 |
redirect.psse2py()
& G2 H% Y& ]) L- y! P import psspy) e# J1 j7 X: Y7 r6 l1 N
psspy.psseinit(80000); @, }% L9 u7 Z. o. Y
psspy.progress_output(islct=6)
) h1 `* V9 \* n( B$ m" p+ M2 s& Y psspy.prompt_output(islct=6)1 p! \ ] g2 G7 Q2 R0 N0 r* V
& i6 d8 M& V& ?! U
##open power flow data, convert and solve it
& a. h2 P* {3 A* e1 i os.chdir('C:\\Python25\\pp_test\\martin\\case1')
* |9 ? G2 x( \7 g2 p) l psspy.case(r"""savcnv.sav""") ##this case is pre-conveted case
. G$ w4 k5 C1 O+ w$ P/ v# N& |* D. ~% [& K
##load snap file " X: O) B; O9 n/ r) V( w" f% Z
psspy.dynamicsmode(1)
' n( W0 x$ g6 L& b7 W psspy.rstr(r"""savnw.snp""")+ f+ u7 S7 @2 R0 L$ j% P h
4 w) p' W! y# J2 K
ierr = psspy.strt(0, 'test.out')
; q5 A: I5 `" m! m( ^' X; G ierr = psspy.run(0, 10): ^. ~$ G( g; b9 h7 Z: j( Y2 w
, e; Z4 P+ z) u7 H/ ?" A如果要加故障操作,可以用:7 ]# y, D3 \6 l- p- Q0 c1 v$ j
ierr = psspy.dist_bus_fault(faultbus, 1, 0, [0,-20000000000])5 A4 C( j3 V8 V* a, L3 l j& a9 \. L
ierr = psspy.dist_clear_fault(1)
: p+ R5 D" R1 F6 l& b9 m, N! B( x0 s/ R ierr = psspy.dist_branch_trip(faultbus, nb_bus,'1')4 L* d* h: ?2 _/ D0 r
& G4 Q6 y; c, N2 Y8 j8 s
[ 本帖最后由 dsyljh 于 2008-7-28 18:21 编辑 ]-%-89529-%--%-97274-%--%-89538-%- |