-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding LODF and GLODF code #449
base: master
Are you sure you want to change the base?
Conversation
Dear RyanVaughan, Thanks a lot for your contribution. Before we finally merge it, I have two comments:
|
andes/routines/glodf.py
Outdated
A[l,self.system.Line.bus2.v[l]-1] = 1 | ||
|
||
# delete all slack rows as required | ||
Ar = np.delete(A, np.asarray(self.system.Slack.bus.v)-1, axis=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will fail if self.system.Slack.bus.v
contains non-numerical values. Slack.bus.v
contains references to bus idx
es, which are not guaranteed numerals.
You can call self.system.Bus.idx2uid(self.system.Slack.bus.v)
to retrieve 0-based index of the Slack bus id.
andes/routines/glodf.py
Outdated
change_lines = np.atleast_1d(change_lines) | ||
psi = self.get_isf() | ||
|
||
slack = np.array(self.system.Slack.bus.v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A similar issue here. Consider generalizing it.
andes/routines/glodf.py
Outdated
bfrom = np.asarray(self.system.Line.bus1.v)[change_lines - 1] | ||
bto = np.asarray(self.system.Line.bus2.v)[change_lines - 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem with these indices.
Considering it is more like a steady state analysis, I add similar functionalities in AMS. |
Initial request to merge generalized line outage distribution factor (GLODF) code. Let me know of any feedback.