First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Picking up on the thread in your question, here is how I'd add load to a bunch of buses and measure the response at the slack bus:
electrical_distance = {}
buses = subsystem_info('bus', ["NUMBER", "TYPE", "AREA"])
buses_in_qld = filter(qld_only, buses)
for busno, type, area in buses_in_qld:
# rolls back to original saved case on each for-loop iteration.
with transaction():
# add one MW load to this bus
add_load_to(busno, {"pl": 1})
# solve probably with fixed taps, shunts, fixed everything
psspy.fnsl(**options)
# difference at slack bus
slack_diff = original_slack - get_p(slack_busno)
electrical_distance[busno] = slack_diff
I've tied some code up into helpful functions. You'd have to write add_load_to
, define some options
for fnsl
and write a function get_p
.
The transaction
function has already been written:
http://www.whit.com.au/blog/2011/09/turn-back-time-using-python-and-psse/
2 | No.2 Revision |
Picking up on the thread in your question, here is how I'd add load to a bunch of buses and measure the response at the slack bus:
electrical_distance = {}
buses = subsystem_info('bus', ["NUMBER", "TYPE", "AREA"])
buses_in_qld = filter(qld_only, buses)
for busno, type, area in buses_in_qld:
# rolls back to original saved case on each for-loop iteration.
with transaction():
# add one MW load to this bus
add_load_to(busno, {"pl": 1})
# solve probably with fixed taps, shunts, fixed everything
psspy.fnsl(**options)
# difference at slack bus
slack_diff = get_p(slack_busno) - original_slack - get_p(slack_busno)
electrical_distance[busno] = slack_diff
I've tied some code up into helpful functions. You'd have to write add_load_to
, define some options
for fnsl
and write a function get_p
.
The transaction
function has already been written:
http://www.whit.com.au/blog/2011/09/turn-back-time-using-python-and-psse/
and subsystem_info
has been written too: http://www.whit.com.au/blog/2011/08/designing-easier-subsystem-data/
Here is what I'd expect electrical_distance
to look like after running through the buses:
{101: 1.10, 102: 1.14, 104: 1.15, ... }
It's just a dictionary listing the increase in slack MW due to your 1MW of load added.