diff --git a/assume/units/powerplant.py b/assume/units/powerplant.py index d13fa4ff..5614f271 100644 --- a/assume/units/powerplant.py +++ b/assume/units/powerplant.py @@ -63,7 +63,7 @@ def __init__( self.fuel_price = fuel_price if type(co2_price) is pd.Series and len(co2_price) == 1: co2_price = co2_price.item() - self.co2_price + self.co2_price = co2_price self.price_forecast = ( pd.Series(0.0, index=self.index) if price_forecast.empty else price_forecast ) @@ -214,7 +214,7 @@ def calculate_energy_operational_window( "window": {"start": start, "end": end}, "current_power": { "power": previous_power, - "marginal_cost": self.calc_marginal_cost( + "marginal_cost": self.calc_marginal_cost_with_partial_eff( power_output=previous_power, timestep=start, ), diff --git a/assume/world.py b/assume/world.py index 2f9476ac..aa558f66 100644 --- a/assume/world.py +++ b/assume/world.py @@ -283,21 +283,21 @@ def creator(container): else: market_price_forecast = None - forecast_provider = ForecastProvider( - market_id=market_id, - price_forecast_df=market_price_forecast, - fuel_prices_df=fuel_prices_df, - vre_cf_df=vre_cf_df, - powerplants=powerplant_units, - demand_df=demand_df[f"demand_{market_id}"], - ) - forecast_agent = RoleAgent( - self.container, suggested_aid=f"forecast_agent_{market_id}" - ) - forecast_agent.add_role(forecast_provider) - self.forecast_providers[market_id] = forecast_provider - - temp[market_id] = forecast_provider.price_forecast_df + # forecast_provider = ForecastProvider( + # market_id=market_id, + # price_forecast_df=market_price_forecast, + # fuel_prices_df=fuel_prices_df, + # vre_cf_df=vre_cf_df, + # powerplants=powerplant_units, + # demand_df=demand_df[f"demand_{market_id}"], + # ) + # forecast_agent = RoleAgent( + # self.container, suggested_aid=f"forecast_agent_{market_id}" + # ) + # forecast_agent.add_role(forecast_provider) + # self.forecast_providers[market_id] = forecast_provider + + # temp[market_id] = forecast_provider.price_forecast_df temp.to_csv(f"{path}/price_forecasts.csv", index=True) diff --git a/examples/paper.py b/examples/paper.py index d03949a5..1168f76a 100644 --- a/examples/paper.py +++ b/examples/paper.py @@ -56,8 +56,8 @@ def plot_and_save_results(): ## Data preparation eom = df[df["name"] == "EOM"] ltm = df[df["name"] == "LTM_OTC"].reset_index() - ltm.loc[0, "average_cost"] = None - xticks = list(ltm["simulation"]) + # ltm.loc[0, "average_cost"] = None + xticks = list(eom["simulation"]) # xlabels = [f"{i}%" for i in range(0, 101, 10)] xlabels = ["EOM", "EOM + LTM"] plt.style.use("seaborn-v0_8") @@ -65,14 +65,20 @@ def plot_and_save_results(): fig, (ax1, ax2) = plt.subplots(2, 1) # Total Dispatch cost ax1.bar(eom["simulation"], eom["total_cost"], label="EOM") - ax1.bar(ltm["simulation"], ltm["total_cost"], bottom=eom["total_cost"], label="LTM") + eom_ltm = eom[eom.simulation == "ltm_case10"] + ax1.bar( + ltm["simulation"], + ltm["total_cost"], + bottom=eom_ltm["total_cost"], + label="LTM", + ) ax1.set_ylabel("Total dispatch cost \n per market [mill. $€$]") ax1.set_xticks(xticks, xlabels) ax1.legend() # Total Average Cost ax2.scatter(eom["simulation"], eom["average_cost"], label="EOM") ax2.scatter(ltm["simulation"], ltm["average_cost"], label="LTM") - ax2.bar(ltm["simulation"], ltm["total_cost"] * 0) + ax2.bar(eom["simulation"], eom["total_cost"] * 0) ax2.set_ylabel("Average cost \n for each scenario [$€/MWh$]") # ax2.set_xlabel("Fraction of base load traded on LTM in percent") ax2.set_xlabel("Selected electricity market design") @@ -134,5 +140,5 @@ def plot_and_save_results(): if __name__ == "__main__": - run_cases() + # run_cases() plot_and_save_results()