Ask Your Question
0

How do I get the total generation MW in an Area using python in PSSE?

asked 2018-07-11 17:19:48 -0600

TheBard gravatar image

Hi,

I'm trying to use psspy.scal_2 to adjust an Area load. I'd like to adjust only the MW value, and have the MVAR scaled accordingly. I don't want generation to be scaled. I currently use VBA to create a python text file.

Here is roughly what I'm trying to do (example of changing from 5680->6000): psspy.scal_2(0,0,0,[1,1,0,1,0],[6000,AreaGenMW,0,0,0,0,0])

I know I can scale it based on a percentage and do this: psspy.scal_2(0,0,0,[1,2,0,1,0],[5.63,0,0,0,0,0,0])

But, if I do this, I have to know what the original case load is, which does take a little bit of time. I'd like for python to be able to just read the load as is, and put that into my first example code.

Basically, it seems I'm doing everything right, except for knowing how to do what I'm calling "AreaGenMW".

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-11 19:12:10 -0600

jconto gravatar image

updated 2018-07-11 19:15:22 -0600

run scal_2 twice. First time to initialize it and get total MW values for load and generation and second time to execute the scaling. I load savnw.sav and for area 1 load, run the code below to scale it 125% :

area = 1
sid = 1
psspy.bsys(sid,0,[ 13.8, 500.],1,[area],0,[],0,[],0,[])
# SCAL_2 defined in API manual
moto, totals, ier = psspy.scal_2(sid,0,1,
                                 [0,0,0,0,0],
                                 [0.0,0.0,0.0,0.0,0.0,0.0,0.0]) #initialize for scaling.
# now totals[2] contains total generation in SID=1, which is area1
MWscale = 1.25
loadMW_area1 = totals[1]                            #total load in SID=1
loadMW_new   = loadMW_area1 * MWscale
MVARscale = MWscale * 100.0                     #scale factor in percentage
psspy.scal_2(sid,0,2,
             [_i,1,0,1,0],
             [loadMW_new, totals[2],0.0,totals[4],totals[5],-.0, MVARscale])
edit flag offensive delete link more

Comments

Thanks this helped!

TheBard gravatar imageTheBard ( 2018-12-26 12:22:32 -0600 )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: 2018-07-11 17:19:48 -0600

Seen: 1,100 times

Last updated: Jul 11 '18