Lucas Gautheron 1 год назад
Родитель
Сommit
a636ce7580
9 измененных файлов с 30 добавлено и 9 удалено
  1. 0 1
      .DS_Store
  2. 0 1
      output.png
  3. 1 0
      output.png
  4. 0 1
      output_dispatch.png
  5. 1 0
      output_dispatch.png
  6. 1 0
      output_gap_distribution.png
  7. 0 1
      output_storage.png
  8. 1 0
      output_storage.png
  9. 26 5
      run.py

+ 0 - 1
.DS_Store

@@ -1 +0,0 @@
-.git/annex/objects/zJ/17/MD5E-s6148--860827d44adcd48ca8d64f07be987e9f/MD5E-s6148--860827d44adcd48ca8d64f07be987e9f

+ 0 - 1
output.png

@@ -1 +0,0 @@
-/annex/objects/MD5E-s717267--e3338628dac2522575cab1f4460e7c35.png

+ 1 - 0
output.png

@@ -0,0 +1 @@
+.git/annex/objects/x9/90/MD5E-s721063--f318e22b2faf3f6a46280c88aee9db29.png/MD5E-s721063--f318e22b2faf3f6a46280c88aee9db29.png

+ 0 - 1
output_dispatch.png

@@ -1 +0,0 @@
-/annex/objects/MD5E-s499865--e81f755d4e5f8d2168b9b41af8485266.png

+ 1 - 0
output_dispatch.png

@@ -0,0 +1 @@
+.git/annex/objects/QV/wV/MD5E-s437509--695226d51e6a5d6b7b4544c07bbf6816.png/MD5E-s437509--695226d51e6a5d6b7b4544c07bbf6816.png

+ 1 - 0
output_gap_distribution.png

@@ -0,0 +1 @@
+.git/annex/objects/Zk/P2/MD5E-s159884--be188fbfc236c280c8f21aff166ebcac.png/MD5E-s159884--be188fbfc236c280c8f21aff166ebcac.png

+ 0 - 1
output_storage.png

@@ -1 +0,0 @@
-/annex/objects/MD5E-s310746--c6850ddf25418072833dd95c8e793f2d.png

+ 1 - 0
output_storage.png

@@ -0,0 +1 @@
+.git/annex/objects/5x/Fg/MD5E-s312004--fee2b810e4ddd8859c5474307fc97943.png/MD5E-s312004--fee2b810e4ddd8859c5474307fc97943.png

+ 26 - 5
run.py

@@ -24,7 +24,7 @@ potential = potential.loc[(
 
 # intermittent sources potential
 p = potential[["onshore", "offshore", "solar"]].to_xarray().to_array()
-p = np.insert(p, 3, 0.68, axis=0)  # nuclear power-like
+p = np.insert(p, 3, 0.7, axis=0)  # nuclear power-like
 
 times = potential.index.get_level_values(0)
 
@@ -41,8 +41,11 @@ fig_dispatch, axes_dispatch = plt.subplots(nrows=6, ncols=2, sharex="col", share
 fig_dispatch.set_figwidth(w*1.5)
 fig_dispatch.set_figheight(h*1.5)
 
-date_fmt = mdates.DateFormatter('%d/%m')
+fig_gap_distribution, axes_gap_distribution = plt.subplots(nrows=3, ncols=2, sharex="col", sharey=True)
+fig_gap_distribution.set_figwidth(w*1.5)
+fig_gap_distribution.set_figheight(h*1.5)
 
+date_fmt = mdates.DateFormatter('%d/%m')
 
 # for step in np.linspace(start, stop, 2050-2022, True)[::-1]:
 row = 0
@@ -69,8 +72,8 @@ for scenario in rte:
     potential["dispatch"] = dp.sum(axis=0)
 
     data = [
-        potential.loc[(slice('2013-12-01 00:00:00',
-                       '2014-01-01 00:00:00'), 'FR'), :],
+        potential.loc[(slice('2013-02-01 00:00:00',
+                       '2013-03-01 00:00:00'), 'FR'), :],
         potential.loc[(slice('2013-06-01 00:00:00',
                        '2013-07-01 00:00:00'), 'FR'), :]
     ]
@@ -121,7 +124,7 @@ for scenario in rte:
         ax.text(
             0.5, 0.87, f"Scénario {scenario} ({months[col]})", ha='center', transform=ax.transAxes)
 
-        ax.set_ylim(25, 225)
+        ax.set_ylim(10, 210)
 
         ax = axes_storage[row, col]
         for i in np.arange(3):
@@ -157,6 +160,17 @@ for scenario in rte:
         ax.text(
             0.5, 0.87, f"Scénario {scenario} ({months[col]})", ha='center', transform=ax.transAxes)
 
+        ax = axes_gap_distribution[row%3, row//3]
+        hist, bin_edges = np.histogram(gap, bins=1000)
+        hist = np.cumsum(hist)
+        hist = 100*(hist - hist.min()) / hist.ptp()
+
+        keep = np.abs(bin_edges[:-1]) < 50
+        ax.plot(bin_edges[:-1][keep], hist[keep], label="power gap")
+        ax.text(
+            0.5, 0.87, f"Scénario {scenario}", ha='center', transform=ax.transAxes)
+        
+
     row += 1
 
 for label in axes[-1, 0].get_xmajorticklabels() + axes[-1, 1].get_xmajorticklabels():
@@ -191,4 +205,11 @@ fig_dispatch.text(1, 0, 'Lucas Gautheron', ha="right")
 fig_dispatch.legend(labels_dispatch, loc='lower right', bbox_to_anchor=(1, -0.1),
            ncol=len(labels_dispatch), bbox_transform=fig_dispatch.transFigure)
 fig_dispatch.savefig("output_dispatch.png", bbox_inches="tight", dpi=200)
+
+fig_gap_distribution.suptitle(f"Power gap cumulative distribution (%)\nSimulations based on {begin}--{end} weather data.\n{flex} consumption flexibility; no nuclear seasonality (unrealistic)")
+fig_gap_distribution.legend(["Power gap (available-load) (GW)"], loc='lower right', bbox_to_anchor=(1, -0.1),
+           ncol=1, bbox_transform=fig_dispatch.transFigure)
+fig_gap_distribution.text(1, 0, 'Lucas Gautheron', ha="right")
+fig_gap_distribution.savefig("output_gap_distribution.png", bbox_inches="tight", dpi=200)
+
 plt.show()