20. 求下图所示电力系统受端母线电压。已知:负荷为2+j0.8,送端电压为1+j0,线路导纳为1.0-j4.0,变压器电抗j0.4,非标准变比1:1.1。试用牛顿-拉夫逊法迭代一次。


In [7]:
from  pypower.runpf import runpf
from numpy import array
from pypower.ppoption import ppoption


"""
Power flow data for 3 bus, 1 gen case from Cheng Tianshi
Require PYPOWER to run.
"""

from numpy import array

def case3():
    """Power flow data for 3 bus, 1 gen case from Cheng Tianshi.
    Please see L{caseformat} for details on the case file format.


    @return: Power flow data for 3 bus, 1 gen case from Cheng Tianshi.
    """
    ppc = {"version": '2'}

    ##-----  Power Flow Data  -----##
    ## system MVA base
    ppc["baseMVA"] = 100
    ZL=1/(1-4j)
    XT=0.4
    k=1/1.1
    S1=(2+0.8j)*100
    ## bus data
    # bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
    ppc["bus"] = array([
        [0, 3, 0,  0,  0, 0, 1, 1, 0, 10, 1, 1.1, 0.9],
        [1, 1, 0, 0, 0, 0, 1, 1, 0, 110, 1, 1.1, 0.9],
        [2, 1, S1.real, S1.imag, 0, 0, 1, 1, 0, 110, 1, 1.1, 0.9]
    ])

    ## generator data
    # bus, Pg, Qg, Qmax, Qmin, Vg, mBase, status, Pmax, Pmin, Pc1, Pc2,
    # Qc1min, Qc1max, Qc2min, Qc2max, ramp_agc, ramp_10, ramp_30, ramp_q, apf
    ppc["gen"] = array([
         [0, 0,   0, 300, -300, 1, 0,1, 450, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
    ])

    ## branch data
    #fbus, tbus, r, x, b, rateA, rateB, rateC, ratio, angle, status, angmin, angmax
    ppc["branch"] = array([
       [1, 2, ZL.real, ZL.imag, 0, 0, 0,0, 0, 0, 1, -360, 360],
        [0, 1,0 , XT, 0, 0, 0, 0, k, 0, 1, -360, 360]
    ])

    return ppc
ppopt=ppoption()
ppopt['PF_ALG']=1
ppopt['PF_MAX_IT']=1
result=runpf(casedata=case3(),ppopt=ppopt)
1/(1-4j)


PYPOWER Version 5.0.0, 29-May-2015 -- AC Power Flow (Newton)


Newton's method power did not converge in 1 iterations.

Did not converge (0.01 seconds)

================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses              3     Total Gen Capacity     450.0        -300.0 to 300.0
Generators         1     On-line Capacity       450.0        -300.0 to 300.0
Committed Gens     1     Generation (actual)    138.1             147.3
Loads              1     Load                   200.0              80.0
  Fixed            1       Fixed                200.0              80.0
  Dispatchable     0       Dispatchable           0.0 of 0.0        0.0
Shunts             0     Shunt (inj)              0.0               0.0
Branches           2     Losses (I^2 * Z)        15.36            196.24
Transformers       1     Branch Charging (inj)     -                0.0
Inter-ties         0     Total Inter-tie Flow     0.0               0.0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   0.450 p.u. @ bus 2          1.000 p.u. @ bus 0   
Voltage Angle     -65.94 deg   @ bus 2          0.00 deg   @ bus 0   
P Losses (I^2*R)             -                 15.36 MW    @ line 1-2
Q Losses (I^2*X)             -                134.80 MVAr  @ line 0-1

================================================================================
|     Bus Data                                                                 |
================================================================================
 Bus      Voltage          Generation             Load        
  #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
----- ------- --------  --------  --------  --------  --------
    0  1.000    0.000*   138.14    147.29       -         -   
    1  0.756  -41.670       -         -         -         -   
    2  0.450  -65.936       -         -      200.00     80.00 
                        --------  --------  --------  --------
               Total:    138.14    147.29    200.00     80.00

================================================================================
|     Branch Data                                                              |
================================================================================
Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z)  
  #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
-----  -----  -----  --------  --------  --------  --------  --------  --------
   0      1      2     81.97     90.49    -66.61    -29.05    15.360     61.44
   1      0      1    138.14    147.29   -138.14    -12.49    -0.000    134.80
                                                             --------  --------
                                                    Total:    15.360    196.24
Out[7]:
(0.058823529411764705+0.23529411764705882j)

In [8]:



Out[8]:
(1.1039269769691802, -0.012697618662075822)

In [ ]:


In [ ]: