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

Ask Your Question
0

How to trip a line in power flow using pssuserpf.py?

asked Jun 12 '3

anonymous user

Anonymous

I have a line that I monitor. During normal power flow I want to trip it if its current exceeds a certain value. RAS and pssuserpf load correctly, but when I call pfcontrol functions inside post_iteration() i receive ierr=2, which means that

not called from allowable PCI automation function

My post_iteration() funtion in pssuserpf.py looks like this:

def post_iteration():
    _, flow = psspy.brnmsc(1, 2, "1", "AMPS")
    if flow > 50.0:
        print("MUST TRIP LINE")
        ierr1 = pfcontrol.pfbrchint(1, 2, "1", "STATUS", 0)
        ierr2 = pfcontrol.pfdscnbus(2)
        print(ierr1, ierr2)
        # both ierr1 and ierr2 are always 2. 
        return False
    else:
        return True

1 answer

Sort by ยป oldest newest most voted
0

answered Jun 12 '3

perolofl gravatar image

Use API psspy.branch_chng to trip the line and psspy.dscn to trip the bus.

link

Comments

As stated in POM, it is not allowed to call these functions from post_iteration(). I get: "DSCN not allowed from post_iteration power flow user exit. (006024)"

opq82047@3djahg gravatar imageopq82047@3djahg (Jun 13 '3)

Ok, it was a long shot; I am not using RAS...

perolofl gravatar imageperolofl (Jun 13 '3)

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

1 follower

Stats

Asked: Jun 12 '3

Seen: 182 times

Last updated: Jun 12 '23