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 2023-06-12 07:15:53 -0600

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 2023-06-12 13:01:06 -0600

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 ( 2023-06-13 00:39:40 -0600 )

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

perolofl gravatar imageperolofl ( 2023-06-13 02:51:08 -0600 )

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: 2023-06-12 07:15:53 -0600

Seen: 182 times

Last updated: Jun 12 '23