First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
There is no API in psspy that returns a list of all miscellaneous models in the dynamic setup. I have therefore written my own API, see the code below:
def get_miscellaneous(minsmax=10000):
""" Returns lists with MINS-number and model name for all miscellaneous models
minsmax = Highest MINS-number to be seached
"""
minslist = []
namelist = []
for mins in range(1,minsmax+1):
ierr, modname = psspy.cctmdlnam_msco(mins)
if ierr == 0:
minslist.append(mins)
namelist.append(modname[:16].strip())
return minslist,namelist
The function returns two lists; the first contains the used MINS-numbers and the second the name of the models.
minslist,namelist = get_miscellaneous()
returns all used miscellaneous models from MINS number 1 up to 10 000. The highest MINS-number to be searched is defined in an argument to the function. If for example MINS-numbers up to 100 000 are used in the snapshot, use the following call of the function.
minslist,namelist = get_miscellaneous(100000)
The execution of the loop takes longer time if very high MINS-numbers are given in the function call.
2 | No.2 Revision |
There is no API in psspy that returns a list of all miscellaneous models in the dynamic setup. I have therefore written my own API, see the code below:
def get_miscellaneous(minsmax=10000):
""" Returns lists with MINS-number and model name for all miscellaneous models
minsmax = Highest MINS-number to be seached
searched
"""
minslist = []
namelist = []
for mins in range(1,minsmax+1):
ierr, modname = psspy.cctmdlnam_msco(mins)
if ierr == 0:
minslist.append(mins)
namelist.append(modname[:16].strip())
return minslist,namelist
The function returns two lists; the first contains the used MINS-numbers and the second the name of the models.
minslist,namelist = get_miscellaneous()
returns all used miscellaneous models from MINS number 1 up to 10 000. The highest MINS-number to be searched is defined in an argument to the function. If for example MINS-numbers up to 100 000 are used in the snapshot, use the following call of the function.
minslist,namelist = get_miscellaneous(100000)
The execution of the loop takes longer time if very high MINS-numbers are given in the function call.