.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_p2p_belgium.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_p2p_belgium.py: Robust optimization of a power-to-power system ============================================== The robust design optimization of the Levelized Cost Of Electricity for a hydrogen-based power-to-power system for a dwelling in Belgium. .. GENERATED FROM PYTHON SOURCE LINES 12-21 In this first example, a robust design optimization is performed on a grid-connected household in Brussels, supported by a photovoltaic-hydrogen system. To optimize the system, 4 design variables are considered: the photovoltaic array capacity, electrolyzer stack capacity, fuel cell stack capacity and hydrogen tank capacity. The mean and standard deviation of the Levelized Cost Of Electricity (LCOE) are selected as objectives. The CAPEX, OPEX, replacement cost and lifetime of the components are considered uncertain, as well as the wholesale electricity price, electricity demand, interest rate and inflation rate. A detailed illustration of the energy system model and the stochastic space is provided in :ref:`lab:pvh2model`. .. GENERATED FROM PYTHON SOURCE LINES 23-24 After 150 generations, a trade-off exists between minimizing the LCOE mean and LCOE standard deviation: .. GENERATED FROM PYTHON SOURCE LINES 24-45 .. code-block:: Python import rheia.POST_PROCESS.post_process as rheia_pp import matplotlib.pyplot as plt case = 'H2_POWER' eval_type = 'ROB' my_opt_plot = rheia_pp.PostProcessOpt(case, eval_type) result_dir = 'run_tutorial' y, x = my_opt_plot.get_fitness_population(result_dir) plt.plot(y[0], y[1], '-o') plt.xlabel('LCOE mean [euro/MWh]') plt.ylabel('LCOE standard deviation [euro/MWh]') plt.xticks([y[0][0], y[0][-1]]) plt.yticks([y[1][0], y[1][-1]]) plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_p2p_belgium_001.png :alt: plot p2p belgium :srcset: /auto_examples/images/sphx_glr_plot_p2p_belgium_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 46-52 The Pareto front illustrates a trade-off between minimizing the LCOE mean and LCOE standard deviation. This means that no single design exists that simulateounsly achieves the minimum LCOE mean and minimum LCOE standard deviation. The optimized LCOE mean design achieves an LCOE mean of 247 euro/MWh and a LCOE standard deviation of 46 euro/MWh. Instead, the robust design (i.e. the design with the lowest standard deviation) achieves an LCOE mean of 302 euro/MWh and a LCOE standard deviation of 38 euro/MWh. The designs that correspond to this Pareto front have the following PV array capacity: .. GENERATED FROM PYTHON SOURCE LINES 52-59 .. code-block:: Python plt.plot(y[0],x[0],'-o') plt.xlabel('LCOE mean [euro/MWh]') plt.ylabel('system capacity [kWp]') plt.legend(['PV array']) plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_p2p_belgium_002.png :alt: plot p2p belgium :srcset: /auto_examples/images/sphx_glr_plot_p2p_belgium_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 60-61 Electrolyzer array and fuel cell array capacity: .. GENERATED FROM PYTHON SOURCE LINES 61-70 .. code-block:: Python for x_in in x[1:3]: plt.plot(y[0],x_in,'-o') plt.xlabel('LCOE mean [euro/MWh]') plt.ylabel('system capacity [kW]') plt.legend(['electrolyzer array, fuel cell array']) plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_p2p_belgium_003.png :alt: plot p2p belgium :srcset: /auto_examples/images/sphx_glr_plot_p2p_belgium_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 71-72 Hydrogen storage tank capacity: .. GENERATED FROM PYTHON SOURCE LINES 72-79 .. code-block:: Python plt.plot(y[0],x[3],'-o') plt.xlabel('LCOE mean [euro/MWh]') plt.ylabel('system capacity [kWh]') plt.legend(['storage tank']) plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_p2p_belgium_004.png :alt: plot p2p belgium :srcset: /auto_examples/images/sphx_glr_plot_p2p_belgium_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 80-83 These results indicate that the optimized LCOE mean is achieved by a PV array. In order to improve the robustness of the LCOE, the optimizer gradually increases the electrolyzer, fuel cell and storage tank capacity. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.432 seconds) .. _sphx_glr_download_auto_examples_plot_p2p_belgium.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_p2p_belgium.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_p2p_belgium.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_p2p_belgium.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_