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)
Out[7]:
In [8]:
Out[8]:
In [ ]:
In [ ]: