Skip to content

Commit

Permalink
Wrong terminology "phase angle" was changed to "voltage angle"
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusozsahin committed Jul 30, 2019
1 parent 3c0d536 commit ad1a23a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
Binary file modified Input/Intertemporal/2019.xlsx
Binary file not shown.
Binary file modified Input/Intertemporal/2024.xlsx
Binary file not shown.
Binary file modified Input/Intertemporal/2029.xlsx
Binary file not shown.
Binary file modified Input/Intertemporal/2034.xlsx
Binary file not shown.
Binary file modified Input/single-year.xlsx
Binary file not shown.
10 changes: 5 additions & 5 deletions urbs/features/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ def add_transmission_dc(m):
within=transmission_domain_rule,
doc='Power flow out of transmission line (MW) per timestep')

m.phase_angle = pyomo.Var(
m.voltage_angle = pyomo.Var(
m.tm, m.stf, m.sit,
within=pyomo.Reals,
doc='Phase angle of a site')
doc='Voltage angle of a site')

# transmission
m.def_transmission_output = pyomo.Constraint(
Expand Down Expand Up @@ -281,15 +281,15 @@ def def_transmission_output_rule(m, tm, stf, sin, sout, tra, com):
# power flow rule for DCPF transmissions
def def_dc_power_flow_rule(m, tm, stf, sin, sout, tra, com):
return (m.e_tra_in[tm, stf, sin, sout, tra, com] ==
(m.phase_angle[tm, stf, sin] - m.phase_angle[tm, stf, sout]) / 57.2958 * -1 *
(m.voltage_angle[tm, stf, sin] - m.voltage_angle[tm, stf, sout]) / 57.2958 * -1 *
(-1 / m.transmission_dict['reactance'][(stf, sin, sout, tra, com)])
* m.transmission_dict['base_voltage'][(stf, sin, sout, tra, com)]
* m.transmission_dict['base_voltage'][(stf, sin, sout, tra, com)])

# phase angle difference rule for DCPF transmissions
# voltage angle difference rule for DCPF transmissions
def def_angle_limit_rule(m, tm, stf, sin, sout, tra, com):
return (- m.transmission_dict['difflimit'][(stf, sin, sout, tra, com)],
(m.phase_angle[tm, stf, sin] - m.phase_angle[tm, stf, sout]),
(m.voltage_angle[tm, stf, sin] - m.voltage_angle[tm, stf, sout]),
m.transmission_dict['difflimit'][(stf, sin, sout, tra, com)])

# first rule for creating absolute transmission input
Expand Down
14 changes: 7 additions & 7 deletions urbs/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ def get_timeseries(instance, stf, com, sites, timesteps=None):
created = created.join(stock) # show stock as created
consumed = consumed.join(shifted.rename('Demand'))

# PHASE ANGLE of sites
# VOLTAGE ANGLE of sites

try:
phase_angle = get_entity(instance, 'phase_angle')
phase_angle = phase_angle.xs([stf], level=['stf']).loc[timesteps]
phase_angle = phase_angle.unstack(level='sit')[sites]
voltage_angle = get_entity(instance, 'voltage_angle')
voltage_angle = voltage_angle.xs([stf], level=['stf']).loc[timesteps]
voltage_angle = voltage_angle.unstack(level='sit')[sites]
except (KeyError, AttributeError):
phase_angle = pd.DataFrame(index=timesteps)
phase_angle.name = 'Phase Angle'
voltage_angle = pd.DataFrame(index=timesteps)
voltage_angle.name = 'Voltage Angle'

return created, consumed, stored, imported, exported, dsm, phase_angle
return created, consumed, stored, imported, exported, dsm, voltage_angle


def drop_all_zero_columns(df):
Expand Down
2 changes: 1 addition & 1 deletion urbs/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def plot(prob, stf, com, sit, dt, timesteps, timesteps_plot,
sit = [sit]

(created, consumed, stored, imported, exported,
dsm, phase_angle) = get_timeseries(prob, stf, com, sit, timesteps)
dsm, voltage_angle) = get_timeseries(prob, stf, com, sit, timesteps)

# move retrieved/stored storage timeseries to created/consumed and
# rename storage columns back to 'storage' for color mapping
Expand Down
6 changes: 3 additions & 3 deletions urbs/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def report(instance, filename, report_tuples=None, report_sites_name={}):

for lv in help_sit:
(created, consumed, stored, imported, exported,
dsm, phase_angle) = get_timeseries(instance, stf, com, lv)
dsm, voltage_angle) = get_timeseries(instance, stf, com, lv)

overprod = pd.DataFrame(
columns=['Overproduction'],
Expand All @@ -64,10 +64,10 @@ def report(instance, filename, report_tuples=None, report_sites_name={}):

tableau = pd.concat(
[created, consumed, stored, imported, exported, overprod,
dsm, phase_angle],
dsm, voltage_angle],
axis=1,
keys=['Created', 'Consumed', 'Storage', 'Import from',
'Export to', 'Balance', 'DSM', 'Phase Angle'])
'Export to', 'Balance', 'DSM', 'Voltage Angle'])
help_ts[(stf, lv, com)] = tableau.copy()

# timeseries sums
Expand Down

0 comments on commit ad1a23a

Please sign in to comment.