示例#1
0
import tesp_support.api as tesp
#import numpy as np
import pypower.api as pp

ppc = tesp.load_json_case('pp_8BusTestCase5000.json')

ppopt_market = pp.ppoption(VERBOSE=0, OUT_ALL=0, PF_DC=ppc['opf_dc'])
ppopt_regular = pp.ppoption(VERBOSE=0, OUT_ALL=0, PF_DC=ppc['pf_dc'])

rpf = pp.runpf(ppc, ppopt_regular)
res = pp.runopf(ppc, ppopt_market)

tesp.summarize_opf(res)
示例#2
0
              '{:.2f}'.format(pgld), '{:.2f}'.format(qgld),
              '{:.2f}'.format(unresp), '{:.2f}'.format(resp_max),
              '{:.8f}'.format(c2), '{:.8f}'.format(c1), '{:.1f}'.format(deg))


x = np.array(range(25))
y = np.array(load_shape)
l = len(x)
t = np.linspace(0, 1, l - 2, endpoint=True)
t = np.append([0, 0, 0], t)
t = np.append(t, [1, 1, 1])
tck_load = [t, [x, y], 3]
u3 = np.linspace(0, 1, num=86400 / 300 + 1, endpoint=True)
newpts = ip.splev(u3, tck_load)

ppc = tesp.load_json_case(casename + '.json')
ppopt_market = pp.ppoption(VERBOSE=0, OUT_ALL=0, PF_DC=ppc['opf_dc'])
ppopt_regular = pp.ppoption(VERBOSE=0,
                            OUT_ALL=0,
                            PF_DC=ppc['pf_dc'],
                            PF_MAX_IT=20,
                            PF_ALG=1)
StartTime = ppc['StartTime']
tmax = int(ppc['Tmax'])
period = int(ppc['Period'])
dt = int(ppc['dt'])
swing_bus = int(ppc['swing_bus'])

#period = 300
#dt = 15
示例#3
0
import numpy as np
import pypower.api as pp
import tesp_support.api as tesp
import sys


def rescale_case(ppc, scale):
    ppc['bus'][:, 2] *= scale  # Pd
    ppc['bus'][:, 3] *= scale  # Qd
    ppc['bus'][:, 5] *= (scale * scale)  # Qs
    ppc['gen'][:, 1] *= scale  # Pg


#ppc = tesp.load_json_case ('ercot_200.json')
ppc = tesp.load_json_case('ercot_8.json')
#rescale_case (ppc, 0.4)
ppopt_regular = pp.ppoption(VERBOSE=1,
                            OUT_SYS_SUM=1,
                            OUT_BUS=1,
                            OUT_GEN=0,
                            OUT_BRANCH=1,
                            PF_DC=0,
                            PF_ALG=1)
rpf = pp.runpf(ppc, ppopt_regular)
pp.printpf(100.0,
           bus=rpf[0]['bus'],
           gen=rpf[0]['gen'],
           branch=rpf[0]['branch'],
           ppopt=ppopt_regular,
           fd=sys.stdout,
           et=rpf[0]['et'],