Ask Your Question
0

How to change bus type in PSS/E?

asked 2022-06-07 05:12:34 -0500

gaurab_dash gravatar image

updated 2022-06-07 05:13:21 -0500

I am trying to identify the buses in PSS/E which are generator buses but have no units connected to them. After this, the bus type of these buses will be converted to 1.

The written code is: psspy.bsys(1,1,[0.0, 1200],0,[],0,[],0,[],0,[]) ierr, [busnumber, bustype, buszone, busowner] = psspy.abusint(sid=1,flag=2,string=['NUMBER','TYPE','ZONE','OWNER']) for k in range(len(bustype)): ierr,Totals,moto = psspy.scal2(0,0,1,[0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0]) if Totals[8] == 0: psspy.buschng4(busnumber[k],0,[1,i,i,i],[f,f,f,f,f,f,f],s) else: psspy.buschng4(busnumber[k],0,[2,i,i,i],[f,f,f,f,f,f,f],s)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2022-06-07 08:35:04 -0500

perolofl gravatar image

Your solution is rather odd.

Here is my proposal:

ierr,plants = psspy.agenbusint(sid=-1, flag=3, string=['NUMBER','TYPE'])
for ibus,code in zip(*plants):
    if code < 2 or code > 3: continue
    ierr, cmpval = psspy.gendat(ibus)
    if ierr == 3:
        psspy.bus_chng_4(ibus,0,[1])
edit flag offensive delete link more

Comments

Thank You. It works.

gaurab_dash gravatar imagegaurab_dash ( 2022-06-08 03:32:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2022-06-07 05:12:34 -0500

Seen: 143 times

Last updated: Jun 07