Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I am doing branch reports with python. Have written functions that retrieve information about branch, and later just construct report the way I like, e.g.:

def GetBranchMVA(bus1,bus2,id): e, mva = psspy.brnmsc(bus1,bus2,id,"MVA") #see psse api (Application Program Interface) manual for all available psspy commands

if e==0: return mva else: return 0

making list of branches to show in report

branches=[ [6704,6886,"1"], [6740,6885,"1"] ]

lbranches=len(branches) for i in range(lbranches): mva=GetBranchMVA(branches[i][0],branches[i][1],branches[i][2]) s=str(i+1)+". "+str(branches[i][0])+"-"+str(branches[i][1])+"-"+str(branches[i][2])+" "+str(round(mva,2))+" MVA"+"\n" psspy.progress(s)

I am doing branch reports with python. Have written functions that retrieve information about branch, and later just construct report the way I like, e.g.:

def GetBranchMVA(bus1,bus2,id): GetBranchMVA(bus1,bus2,id):

e, mva = psspy.brnmsc(bus1,bus2,id,"MVA")

#see psse api (Application Program Interface) manual for all available psspy commands

if e==0: e==0:

return mva
  else:
    

else:

return 0

0

making list of branches to show in report

branches=[ [6704,6886,"1"], [6740,6885,"1"] ]branches=[[6704,6886,"1"],[6740,6885,"1"]]

lbranches=len(branches) l_branches=len(branches)

for i in range(lbranches): mva=GetBranchMVA(branches[i][0],branches[i][1],branches[i][2]) range(l_branches):

mva=GetBranchMVA(branches[i][0],branches[i][1],branches[i][2])

s=str(i+1)+". "+str(branches[i][0])+"-"+str(branches[i][1])+"-"+str(branches[i][2])+" "+str(round(mva,2))+" MVA"+"\n" MVA"+"\n"

psspy.progress(s)

I am doing branch reports with python. Have written functions that retrieve information about branch, and later just construct report the way I like, e.g.:

def GetBranchMVA(bus1,bus2,id):

GetBranchMVA(bus1,bus2,id): e, mva = psspy.brnmsc(bus1,bus2,id,"MVA")

#see psse api (Application Program Interface) manual for all available psspy commands

psspy.brnmsc(bus1,bus2,id,"MVA") if e==0:

e==0:
    return mva

else:

  else:
    return 0

making list of branches to show in report

branches=[[6704,6886,"1"],[6740,6885,"1"]]

l_branches=len(branches)

branches=[[6704,6886,"1"],[6740,6885,"1"]] l_branches=len(branches) for i in range(l_branches):

mva=GetBranchMVA(branches[i][0],branches[i][1],branches[i][2])

range(l_branches): mva=GetBranchMVA(branches[i][0],branches[i][1],branches[i][2]) s=str(i+1)+". "+str(branches[i][0])+"-"+str(branches[i][1])+"-"+str(branches[i][2])+" "+str(round(mva,2))+" MVA"+"\n"

MVA"+"\n" psspy.progress(s)

psspy.progress(s)