Thank you for your support.
Based on your introduction, I can get Mbase.
Due to a lot of machines, so I have to use for loop
in order to get all of the power data of machines. Please give me some advice whether there is any other way than to use a for loop
.
Please see the picture result on Notepad++
enter image description here
That's so kind of you.
import psse34
import psspy
# Last case:
CASE = r"C:\Program Files (x86)\PTI\PSSE34\EXAMPLE\savnw.sav"
psspy.psseinit(12000)
psspy.case(CASE)
ierr = psspy.dyre_add(dyrefile="C:\Program Files (x86)\PTI\PSSE34\EXAMPLE\savnw.dyr")
ierr = psspy.rstr("C:\Program Files (x86)\PTI\PSSE34\EXAMPLE\savnw.snp")
ierr = psspy.rwdy(1,1,ofile="C:\Program Files (x86)\PTI\PSSE34\EXAMPLE\python_test1.out") # find inertia (H) of machine
machine1=[101,102,206,211,3011,3018]
for x in machine1:
ierr, mbase = psspy.macdat(ibus=x, id='1', string='MBASE') # find power of machine
print(mbase)