diff --git a/urbs/model.py b/urbs/model.py index eaaacd4c..a78a7834 100644 --- a/urbs/model.py +++ b/urbs/model.py @@ -260,11 +260,11 @@ def create_model(data, dt=1, timesteps=None, objective='cost', within=pyomo.NonNegativeReals, doc='Power flow (MW) through process') m.e_pro_in = pyomo.Var( - m.tm, m.pro_tuples, m.com, + m.tm, m.pro_input_tuples, within=pyomo.NonNegativeReals, doc='Power flow of commodity into process (MW) per timestep') m.e_pro_out = pyomo.Var( - m.tm, m.pro_tuples, m.com, + m.tm, m.pro_output_tuples, within=pyomo.NonNegativeReals, doc='Power flow out of process (MW) per timestep') diff --git a/urbs/output.py b/urbs/output.py index 3c6f5d4b..166c4c83 100644 --- a/urbs/output.py +++ b/urbs/output.py @@ -129,13 +129,13 @@ def get_timeseries(instance, stf, com, sites, timesteps=None): created = pd.DataFrame(index=timesteps) consumed = get_entity(instance, 'e_pro_in') - consumed = consumed.xs([stf, com], level=['stf', 'com']).loc[timesteps] try: + consumed = consumed.xs([stf, com], level=['stf', 'com']).loc[timesteps] consumed = consumed.unstack(level='sit')[sites].fillna(0).sum(axis=1) consumed = consumed.unstack(level='pro') consumed = drop_all_zero_columns(consumed) except KeyError: - consumed = pd.DataFrame(index=timesteps) + consumed = pd.DataFrame(index=timesteps[1:]) # TRANSMISSION other_sites = (get_input(instance, 'site')