马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
我最近在用Python调用PSS/E动态模拟计算.
K# P9 ?, {4 U+ ?我的版本是:" H: {4 ?2 E% V1 O. j& G
Python 2.5
& s4 o1 ?5 K* U% t/ ^5 R2 M4 V, HPSS/E 31
# S9 `& n+ w; E在31之前的版本是不支持Python的动态模拟调用的.- R1 M- u6 R) K( J
6 G) P5 K; ^( {' _: I' N+ I我的一个简单算例:. ?' R- ^; L: q8 y7 N: n' a
3 O( k7 P7 W! k, ?! H import os,sys
0 c1 \; w4 {) v2 b( T sys.path.append('C:\\Program Files\\PTI\\PSSE31\\PSSBIN')8 L, t" G, P/ u- w& ~
os.environ['PATH'] += ';C:\\Program Files\\PTI\\PSSE31\\PSSBIN'. N* e- J C( ~
7 [% j! e: S( W6 P8 A
import redirect/ G& U9 ]9 A* d( } x% T
redirect.psse2py()0 J+ n; o) r9 `; ~
import psspy* t5 X, H1 U1 d" o$ c- d) N
psspy.psseinit(80000)
* J$ u3 U; S/ W: f$ t+ E$ ?( _0 H psspy.progress_output(islct=6) ( X$ h4 f$ V& h: L
psspy.prompt_output(islct=6)
( J5 l/ [$ w( H
2 X5 h, A# O% f ##open power flow data, convert and solve it3 u, }4 }6 u! [4 p1 J5 M
os.chdir('C:\\Python25\\pp_test\\martin\\case1') ! }4 H6 I6 ~8 ~* r
psspy.case(r"""savcnv.sav""") ##this case is pre-conveted case1 C: d. `) E! t- I; H; x; }
- P% \ t% w$ {+ F; _. w R ##load snap file
/ j/ N3 M8 P$ {3 ?3 _& U9 f9 g3 T% _ psspy.dynamicsmode(1): }" A8 Y; |7 L: i
psspy.rstr(r"""savnw.snp""")
! U7 O q* j. q# D8 @
% a9 N; \- V* `, Y' i% L ierr = psspy.strt(0, 'test.out')
0 {0 O7 K; X$ V1 k( e5 e ierr = psspy.run(0, 10)2 a; Q4 e' k" Y
: O: E/ k8 w4 ~2 f6 B, [如果要加故障操作,可以用:* O1 t. e. p) e$ X$ X4 }
ierr = psspy.dist_bus_fault(faultbus, 1, 0, [0,-20000000000])
$ d9 l4 G+ ?0 J ierr = psspy.dist_clear_fault(1)
0 u; {/ m4 I, }/ R+ ` { ierr = psspy.dist_branch_trip(faultbus, nb_bus,'1')
0 Q1 \! h ]1 A8 \- g7 R* ?
^8 q; X; R' l" h[ 本帖最后由 dsyljh 于 2008-7-28 18:21 编辑 ]-%-89529-%--%-97274-%--%-89538-%- |