Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello guys could anyone can tell me whats wrong with this program?

report("steadystate30-6-14: %s\n\n"%savfile) clnttls = "%6s,%18s,%6s,%18s,%3s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s\n"%('FRMBUS','FROMBUSEXNAME','TOBUS','TOBUSEXNAME','CKT','R(pu)','X(pu)','Z(pu)','ZZ','Vs(pu)','VsVs','Pj','Qj','Qj(pu)','FVSI')

report(clnttls)

for i in range(len(ibuses['number'])): bus = ibuses['number'][i]

flowfrombusidxes = busindexes(bus,ibranch['fromnumber'])

for idx in flowfrombusidxes:
    b = ibranch['fromnumber'][idx]
    fbn = cbranch['fromexname'][idx]
    tb = ibranch['tonumber'][idx]
    tbn = cbranch['toexname'][idx]
    ckt = cbranch['id'][idx]
    r = abs(xbranch['rx'][idx].real)
    x = xbranch['rx'][idx].imag

    frombusidx = busindexes(ibranch['fromnumber'][idx],ibusesall['number'])
    vs = rbusesall['pu'][frombusidx[0]]

    ps = rbranch['p'][idx]
    qs = rbranch['q'][idx]

    from math import sqrt
    z = sqrt(r*r+x*x)
    z2 = pow(z,2)
    vs2 = pow(vs,2)
    qsj = abs(qs/100)
    fvsi = (4*z2*qsj)/(vs2*x)

    report("%(b)6d,%(fbn)18s,%(tb)6d,%(tbn)18s,%(ckt)3s,%(r)8.6f,%(x)8.6f,%(z2)8.6f,%(vs)8.4f,%(ps)8.2f,%(qs)8.2f,%(qsj)8.2f,%(fvsi)8.4f\n"%vars())
click to hide/show revision 2
code format

Hello guys could anyone can tell me whats wrong with this program?

report("steadystate30-6-14: %s\n\n"%savfile)
clnttls = "%6s,%18s,%6s,%18s,%3s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s\n"%('FRMBUS','FROMBUSEXNAME','TOBUS','TOBUSEXNAME','CKT','R(pu)','X(pu)','Z(pu)','ZZ','Vs(pu)','VsVs','Pj','Qj','Qj(pu)','FVSI')

report(clnttls)

"%6s,%18s,%6s,%18s,%3s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s\n"%('FRMBUS','FROMBUSEXNAME','TOBUS','TOBUSEXNAME','CKT','R(pu)','X(pu)','Z(pu)','Z*Z','Vs(pu)','Vs*Vs','Pj','Qj','Qj(pu)','FVSI') report(clnttls) for i in range(len(ibuses['number'])): bus = ibuses['number'][i]

ibuses['number'][i]

    flowfrombusidxes = busindexes(bus,ibranch['fromnumber'])

 for idx in flowfrombusidxes:
     b = ibranch['fromnumber'][idx]
     fbn = cbranch['fromexname'][idx]
     tb = ibranch['tonumber'][idx]
     tbn = cbranch['toexname'][idx]
     ckt = cbranch['id'][idx]
     r = abs(xbranch['rx'][idx].real)
     x = xbranch['rx'][idx].imag

     frombusidx = busindexes(ibranch['fromnumber'][idx],ibusesall['number'])
     vs = rbusesall['pu'][frombusidx[0]]

     ps = rbranch['p'][idx]
     qs = rbranch['q'][idx]

     from math import sqrt
     z = sqrt(r*r+x*x)
     z2 = pow(z,2)
     vs2 = pow(vs,2)
     qsj = abs(qs/100)
     fvsi = (4*z2*qsj)/(vs2*x)

     report("%(b)6d,%(fbn)18s,%(tb)6d,%(tbn)18s,%(ckt)3s,%(r)8.6f,%(x)8.6f,%(z2)8.6f,%(vs)8.4f,%(ps)8.2f,%(qs)8.2f,%(qsj)8.2f,%(fvsi)8.4f\n"%vars())
click to hide/show revision 3
No.3 Revision

Hello guys could anyone can tell me whats wrong with this program?

report("steadystate30-6-14: %s\n\n"%savfile)
clnttls = "%6s,%18s,%6s,%18s,%3s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s,%8s\n"%('FRMBUS','FROMBUSEXNAME','TOBUS','TOBUSEXNAME','CKT','R(pu)','X(pu)','Z(pu)','Z*Z','Vs(pu)','Vs*Vs','Pj','Qj','Qj(pu)','FVSI')


report(clnttls)

for i in range(len(ibuses['number'])):
    bus = ibuses['number'][i]

    flowfrombusidxes = busindexes(bus,ibranch['fromnumber'])

    for idx in flowfrombusidxes:
        b = ibranch['fromnumber'][idx]
        fbn = cbranch['fromexname'][idx]
        tb = ibranch['tonumber'][idx]
        tbn = cbranch['toexname'][idx]
        ckt = cbranch['id'][idx]
        r = abs(xbranch['rx'][idx].real)
        x = xbranch['rx'][idx].imag

        frombusidx = busindexes(ibranch['fromnumber'][idx],ibusesall['number'])
        vs = rbusesall['pu'][frombusidx[0]]

        ps = rbranch['p'][idx]
        qs = rbranch['q'][idx]

        from math import sqrt
        z = sqrt(r*r+x*x)
        z2 = pow(z,2)
        vs2 = pow(vs,2)
        qsj = abs(qs/100)
        fvsi = (4*z2*qsj)/(vs2*x)

        report("%(b)6d,%(fbn)18s,%(tb)6d,%(tbn)18s,%(ckt)3s,%(r)8.6f,%(x)8.6f,%(z2)8.6f,%(vs)8.4f,%(ps)8.2f,%(qs)8.2f,%(qsj)8.2f,%(fvsi)8.4f\n"%vars())