马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
我最近在用Python调用PSS/E动态模拟计算.
, ^) C' ?2 T! B. j. f$ B我的版本是:
: c" f& D5 M" Y. V+ N0 aPython 2.5
3 t3 p7 ]4 C/ P$ h. L5 r# ZPSS/E 31
! ]( S/ o1 G P( O在31之前的版本是不支持Python的动态模拟调用的.
/ x/ }% e7 \9 K* g" p6 s* V8 L3 i2 |$ ]4 g0 y7 P+ ?1 s
我的一个简单算例:& k4 s# y$ m5 U) B
- `, V! f5 ~8 K8 V
import os,sys
" c* x3 s( Z3 ~* z sys.path.append('C:\\Program Files\\PTI\\PSSE31\\PSSBIN')
4 _6 l6 s, ]) r os.environ['PATH'] += ';C:\\Program Files\\PTI\\PSSE31\\PSSBIN'
j! S4 q# L( Y4 I; t* m9 d8 V$ T- P, n7 I
import redirect
, L' I2 w8 Z/ Y% Z% }9 K redirect.psse2py()
* O+ c. k. S( M+ O- d+ ]) r import psspy
0 {5 A8 ^9 o& w, x2 R psspy.psseinit(80000)
# I* l: H& h; [4 j% | psspy.progress_output(islct=6) 8 O2 B5 `2 k4 D! ]
psspy.prompt_output(islct=6)! n. U) k! q& g7 J
# f5 k7 H0 Y# K( T
##open power flow data, convert and solve it
1 C+ s) h$ q* a8 `7 \- M! q os.chdir('C:\\Python25\\pp_test\\martin\\case1') 3 D; \9 C8 h& Z4 X9 m) p: R
psspy.case(r"""savcnv.sav""") ##this case is pre-conveted case
: y5 Q) O) a# ]" j
5 X5 n8 L+ D4 |5 f1 I1 Q: } ##load snap file ( O& m; h7 b* F* V+ L% h- I
psspy.dynamicsmode(1)
9 ]0 N. V3 o* B6 ` psspy.rstr(r"""savnw.snp""")
/ w6 G$ T- ~3 E9 {$ U; s+ N! Y5 r4 k& I
ierr = psspy.strt(0, 'test.out')- B: W( l6 L2 r6 j+ E/ {" L* h$ {
ierr = psspy.run(0, 10)7 K/ b4 V& X4 @$ I) e* d
2 Z) |: @* q$ G& g q4 k8 @如果要加故障操作,可以用:
1 U, e: w1 |9 G ierr = psspy.dist_bus_fault(faultbus, 1, 0, [0,-20000000000])4 E i5 e; G! g& ^9 Q4 |
ierr = psspy.dist_clear_fault(1)8 C2 h# [) U1 x* i5 M" l
ierr = psspy.dist_branch_trip(faultbus, nb_bus,'1')& f% h+ Y# x5 K( f* m. |
6 e+ l6 f6 a* d! ~
[ 本帖最后由 dsyljh 于 2008-7-28 18:21 编辑 ]-%-89529-%--%-97274-%--%-89538-%- |