First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

How to transform a branch from in-service to out-serive using Python

asked Feb 13 '17

Richard gravatar image

I would like to transform a branch form in-service to out-service using Python.

It is not mean to remove the branch.

So, I tried to do that using following code and then saved the result.

psspy.branchchng(Fromnum , To_num , ID ,intgar1=0)

But, I got a raw file to reomve the branch

Could you inform me the solution?

2 answers

Sort by » oldest newest most voted
1

answered Feb 15 '17

Power_System_Engineer gravatar image

If I understands your question correctly, assuming you want to use the PSSE API python method to take a branch out of service in the powerflow model.

Here's the standard python syntax per PSSE_API document - i = frombus, j = tobus, ckt = circuit id, intgar is an array of 6 elements, so using the keyword function, intgar1 is where the branch status can be set from 1 to 0 where 1 = in service.

psspy.branchdata3( i=12345,j=34567,ckt = '1',intgar1 = 0)

link
0

answered Feb 16 '17

perolofl gravatar image

It is better to use branchchng since that API will only act on existing branches. API branchdata_3 will add a branch if the branch does not exist. It is not necessary to give the keywords since all needed argument are in the correct order, i.e.

psspy.branch_chng(12345,34567,'1',0)
link

Comments

agreed -the keyword function is just my personal preference - I tend to forget what those values represent after a period of time.

Power_System_Engineer gravatar imagePower_System_Engineer (Feb 16 '17)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Feb 13 '17

Seen: 1,177 times

Last updated: Feb 16 '17