First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Is it possible to create an Automation File that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
2 | No.2 Revision |
Is it possible to create an Automation File (in Python) that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
3 | No.3 Revision |
Is it possible to create an Automation File (in Python) that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
EDIT
One of the things I do a lot of is trying to disconnect different combinations of lines.
What I want is to make changes in the GUI (in PSS/E), run an automation file that executes fnsl and aborts and restore model if it doesn't converge. I'd prefer not to save the model every time I make a minor adjustment.
4 | No.4 Revision |
Is it possible to create an Automation File (in Python) that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
EDIT
One of the things I do a lot of is trying to disconnect different combinations of lines.
What I want is to make changes in the GUI (in PSS/E), run an automation file that executes fnsl and aborts and restore model if it doesn't converge. I'd prefer not to save the model every time I make a minor adjustment.
Final result:
ierr = psspy.save('temp.sav')
if ierr > 0:
print "Couldn't save temp-file"
ierr = psspy.fnsl()
if ierr == 3:
print "Nodes without swing bus. API: tree() may help"
elif ierr != 0:
print "Power flow failed."
ierr = psspy.solved()
if ierr > 0:
psspy.case('temp.sav')
else:
print "Power flow reached convergence"
5 | No.5 Revision |
Is it possible to create an Automation File (in Python) that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
EDIT
One of the things I do a lot of is trying to disconnect different combinations of lines.
What I want is to make changes in the GUI (in PSS/E), run an automation file that executes fnsl and aborts and restore model if it doesn't converge. I'd prefer not to save the model every time I make a minor adjustment.
Final result:result (thanks for jconto):
ierr = psspy.save('temp.sav')
if ierr > 0:
print "Couldn't save temp-file"
ierr = psspy.fnsl()
if ierr == 3:
print "Nodes without swing bus. API: tree() may help"
elif ierr != 0:
print "Power flow failed."
ierr = psspy.solved()
if ierr > 0:
psspy.case('temp.sav')
else:
print "Power flow reached convergence"
6 | No.6 Revision |
Is it possible to create an Automation File (in Python) that tries to run a normal FNSL power flow, but stops, and retrieve original case if the mismatch becomes too large?
The pseudo code of what I want is:
run fnsl
if absolute mismatch > 1 # or some other appropriate value
abort fnsl
print error message: "The power flow blew up".
recover previous power flow results
stop
At the moment, I have to load the .sav case every time my model blows up (which is often). It's cumbersome, and time demanding. I'm doing a lot of manual changes and don't need to store the results, so I don't want to create new .sav-files for every change and load flow I run.
I appreciate any help!
EDIT
One of the things I do a lot of is trying to disconnect different combinations of lines.
What I want is to make changes in the GUI (in PSS/E), run an automation file that executes fnsl and aborts and restore model if it doesn't converge. I'd prefer not to save the model every time I make a minor adjustment.
Final result (thanks for to jconto):
ierr = psspy.save('temp.sav')
if ierr > 0:
print "Couldn't save temp-file"
ierr = psspy.fnsl()
if ierr == 3:
print "Nodes without swing bus. API: tree() may help"
elif ierr != 0:
print "Power flow failed."
ierr = psspy.solved()
if ierr > 0:
psspy.case('temp.sav')
else:
print "Power flow reached convergence"