Skip to content

Commit

Permalink
Add wmod field for psse data.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Mar 16, 2024
1 parent 7ea376e commit c8373e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
14 changes: 12 additions & 2 deletions andes/io/psse.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,16 @@ def _parse_fshunt_v33(raw, system):


def _parse_gen_v33(raw, system, sw):
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 12, 13, 14, 15, 16,17,18,19
# I,ID,PG,QG,QT,QB,VS,IREG,MBASE,ZR,ZX,RT,XT,GTAP,STAT,RMPCT,PT,PB,O1,F1
"""
Helper function for parsing static generator section.
"""

# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
# I, ID, PG, QG, QT, QB, VS, IREG, MBASE, ZR, ZX, RT, XT, GTAP, STAT,
# 15, 16, 17, 18, 19, ..., 26, 27
# RMPCT, PT, PB, O1, F1, ..., O4, F4, WMOD, WPF
# The columns above for v33 is different from the manual of v34.5, which includes two new columns:
# `NREG`` at 8 and `BSLOD` before `O1`

mva = system.config.mva
out = defaultdict(list)
Expand All @@ -417,6 +425,7 @@ def _parse_gen_v33(raw, system, sw):
gen_mva = data[8]
gen_idx += 1
status = data[14]
wmod = data[26] if len(data) >= 26 else 0

param = {'Sn': gen_mva, 'Vn': vn, 'u': status,
'bus': bus, 'subidx': subidx,
Expand All @@ -428,6 +437,7 @@ def _parse_gen_v33(raw, system, sw):
'v0': data[6],
'ra': data[9], # ra - armature resistance
'xs': data[10], # xs - synchronous reactance
'wmod': wmod, # generator control mode
}

if data[0] in sw.keys():
Expand Down
13 changes: 7 additions & 6 deletions andes/models/static/pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ def __init__(self):
self.ra = NumParam(default=0.0, info='armature resistance', tex_name='r_a')
self.xs = NumParam(default=0.3, info='armature reactance', tex_name='x_s')

# `amachint`: data holder for PSS/E file; not yet used in ANDES
# `wmod`: generator model included in PSS/E file; not yet used in ANDES
# 0: conventional
# 1: renewable standard QT/ QB limits
# 2: renewable +, - Qlimits based on WPF
# 3: renewable, fixed Qlimit based on WPF
# 4: Infeed machine
self.amachint = NumParam(default=0,
info='Machine ctrl. mode [PSS/E]',
tex_name=r'a_{machint}',
export=False,
)
self.wmod = NumParam(default=0,
info='Machine ctrl. mode [PSS/E]',
tex_name=r'w_{mod}',
unit='int',
export=False,
)


class PVModel(Model):
Expand Down

0 comments on commit c8373e7

Please sign in to comment.