diff --git a/andes/io/psse.py b/andes/io/psse.py index 176637e49..0d9be241b 100644 --- a/andes/io/psse.py +++ b/andes/io/psse.py @@ -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) @@ -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, @@ -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(): diff --git a/andes/models/static/pv.py b/andes/models/static/pv.py index 65e070faa..f3280719e 100644 --- a/andes/models/static/pv.py +++ b/andes/models/static/pv.py @@ -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):