|
11 | 11 |
|
12 | 12 | from papers.Martin_Staadecker_Value_of_LDES_and_Factors.LDES_paper_graphs.util import ( |
13 | 13 | set_style, |
14 | | - get_set_e_scenarios, |
| 14 | + get_set_e_scenarios, save_figure, |
15 | 15 | ) |
16 | 16 | from switch_model.tools.graph.main import GraphTools |
17 | 17 |
|
18 | 18 | # Prepare graph tools |
19 | | -tools = GraphTools(scenarios=get_set_e_scenarios()) |
| 19 | +tools = GraphTools(scenarios=get_set_e_scenarios(), set_style=False) |
20 | 20 | tools.pre_graphing(multi_scenario=True) |
21 | 21 |
|
22 | 22 | # %% CREATE FIGURE |
23 | 23 | set_style() |
24 | 24 | plt.close() |
25 | 25 | fig = plt.figure() |
26 | | -fig.set_size_inches(12, 12) |
| 26 | +fig.set_size_inches(6.850394, 6.850394) |
27 | 27 | gs = matplotlib.gridspec.GridSpec(2, 2, figure=fig) |
28 | 28 | ax1 = fig.add_subplot(gs[0, 0]) |
29 | 29 | ax2 = fig.add_subplot(gs[0, 1]) |
|
162 | 162 | demand = demand.groupby("timepoint", as_index=False).value.sum() |
163 | 163 | demand = tools.transform.timestamp(demand, use_timepoint=True) |
164 | 164 | demand = demand.set_index("datetime")["value"] |
| 165 | +demand *= 4 * 1e-6 # Each timestep is 4 hours, converting to TWh |
| 166 | +total_demand = demand.sum() |
165 | 167 | demand = demand.resample(freq).mean() |
166 | 168 | demand = demand * 60 / demand.max() |
167 | 169 |
|
|
181 | 183 |
|
182 | 184 | lines = ax.get_lines() |
183 | 185 | x_label = { |
184 | | - 4.0: 135, |
| 186 | + # 4.0: 135, |
185 | 187 | 8.0: 150, |
186 | 188 | 20.0: 170, |
187 | 189 | 24.0: 230, |
|
193 | 195 | label = float(line.get_label()) |
194 | 196 | if label not in x_label.keys(): |
195 | 197 | continue |
196 | | - labellines.labelLine(line, state_of_charge.index[x_label[label]], label="S "+str(int(label)), align=False, color='k') |
| 198 | + labellines.labelLine(line, state_of_charge.index[x_label[label]], linespacing=1, outline_width=1, label=str(int(label))+"TWh", align=False, color='k', fontsize="small") |
197 | 199 |
|
198 | 200 | demand_lines = ax.plot(demand, c="dimgray", linestyle="--", alpha=0.5) |
199 | | -ax.legend(demand_lines, ["Demand"]) |
| 201 | +ax.legend(demand_lines, [f"Demand ({total_demand:.0f} TWh/year)"]) |
200 | 202 |
|
201 | 203 | ax.set_title("C. State of charge throughout the year") |
202 | | -# %% |
| 204 | +# %% SAVE FIGURE |
203 | 205 | plt.tight_layout() |
| 206 | +save_figure("figure-5-impact-of-ldes-on-grid.png") |
204 | 207 |
|
205 | 208 | # %% CALCULATIONS |
206 | 209 | cap_total = cap["Solar"] + cap["Wind"] |
|
0 commit comments