SpineOpt demo for the IEA EBC Annex 83 summer school
Creators: name: Rasku, Topi
Publisher: name: Zenodo
Year: 2023
Subjects: Spine Toolbox
SpineOpt
ArchetypeBuildingModel
demo

description: <strong>Please note that this version is still very much a work in progress, but can be used for testing the installation.</strong> # SpineOpt demo for the IEA EBC Annex 83 PhD summer school A [Spine Toolbox](https://github.com/spine-tools/Spine-Toolbox) workflow for<br> demoing [SpineOpt](https://github.com/spine-tools/SpineOpt.jl) for the<br> IEA EBC Annex 83 PhD summer school. <br> ## Key contents 1. `.spinetoolbox/` contains the Spine Toolbox project files.<br> 2. `code/` contains the source code of the key modules required to run this workflow.<br> 3. `data/` contains the raw data files used in creating the simple model.<br> 4. `install.bat` script installs the contained Spine Toolbox version, and runs `install_julia_modules.jl`.<br> 5. `install_julia_modules.jl` script is run as part of `install.bat`, setting up the necessary Julia modules in the project.<br> 6. `toolbox.bat` starts Spine Toolbox and pre-loads the project. <br> ## Installation This project uses both [Python](https://www.python.org/) and<br> [Julia](https://julialang.org/), so one needs to have both of<br> them installed. [Miniconda](https://docs.conda.io/en/latest/miniconda.html)<br> is used for Python package management. **All of the above need to be installed and included in your `path`, so that they can be called from the command line in the scripts!** The `install.bat` script can be used to automatically install the contents of<br> this Spine Toolbox project, and performs the following steps: 1. Creates a Spine Toolbox compatible Python 3.9 Conda environment named `SpineOptPEDDemo`.<br> 2. Activates said environment.<br> 3. Installs the contained Spine Toolbox into the environment using `pip`.<br> 4. Runs the `install_julia_modules.jl` script to set up the contained Julia modules. Additionally, it may be necessary to configure Spine Toolbox to use the correct Julia.<br> This can be done by opening Spine Toolbox via `toolbox.bat` or by running<br> ```<br> activate SpineOptPEDDemo<br> python -m spinetoolbox<br> ```<br> and navigating to the `File -&gt; Settings -&gt; Tools -&gt; Julia` to set the desired Julia path. The `install_julia_modules.jl` script performs the necessary setup for the Julia<br> side of things following the steps: 1. Installs the contained `SpineInterface.jl`.<br> 2. Configures the `PyCall.jl` module used by `SpineInterface.jl` to use the same Conda environment as the previous Spine Toolbox installation. This is important to get access to the Spine DB API from `SpineInterface.jl`. All of the remaining modules use this as a dependency, hence it needs to be installed first.<br> 3. Installs the contained `SpineOpt.jl` used for solving the model.<br> 4. Installs the contained `ArchetypeBuildingModel.jl`, used for processing the building models and their for SpineOpt. <br> ## Use The Spine Toolbox workflow comes pre-configured to run the example model.<br> One can open the workflow in Spine Toolbox to inspect it in more detail<br> using `toolbox.bat` or by running in the root folder.<br> ```<br> activate SpineOptPEDDemo<br> python -m spinetoolbox .<br> ```<br> From there, the workflow can be executed in its entirety or in parts using<br> the Spine Toolbox UI. Results can be examined from the `spineopt_output`<br> datastore. ### Editing the workflow If one wants to mess with the simulations and their settings, it is highly<br> recommended to familiarize oneself with the online documentation of<br> [ArchetypeBuildingModel.jl](https://github.com/vttresearch/ArchetypeBuildingModel)<br> and [SpineOpt.jl](https://github.com/spine-tools/SpineOpt.jl). The `data_and_definitions.sqlite` datastore contains all the building-related data and definitions,<br> which is processed for SpineOpt by ArchetypeBuildingModel.jl. The `spineopt_template_and_data.sqlite` datastore contains the SpineOpt input data for the simple energy<br> system. These are in SpineOpt input data format, and provide all the necessary definitions etc.<br> that the building dataset might be missing. **Any changes with staying power should be made to the above datastores!**<br> The `spineopt_combined_input.sqlite` merely merges the above two datastores to form a single<br> combined input dataset for SpineOpt. <br> ## License Please note that different parts of this workflow can be subject to different<br> licenses. In general, most parts are subject to either<br> the [MIT](https://mit-license.org/) or the<br> [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) licenses. <br> ## Acknowledgements This work was carried out under the Academy of Finland project "Integration of building flexibility into future energy systems (FlexiB)" under grant agreement No 332421. This work has also benefited from the EU project Mopo (2023-2026), which has received funding from<br> European Climate, Infrastructure and Environment Executive Agency under the<br> European Union’s HORIZON Research and Innovation Actions under grant agreement N°101095998. ### ERA5 weather data Hersbach, H., Bell, B., Berrisford, P., Hirahara, S., Horányi, A., Muñoz‐Sabater, J., Nicolas, J., Peubey, C., Radu, R., Schepers, D., Simmons, A., Soci, C., Abdalla, S., Abellan, X., Balsamo, G., Bechtold, P., Biavati, G., Bidlot, J., Bonavita, M., De Chiara, G., Dahlgren, P., Dee, D., Diamantakis, M., Dragani, R., Flemming, J., Forbes, R., Fuentes, M., Geer, A., Haimberger, L., Healy, S., Hogan, R.J., Hólm, E., Janisková, M., Keeley, S., Laloyaux, P., Lopez, P., Lupu, C., Radnoti, G., de Rosnay, P., Rozum, I., Vamborg, F., Villaume, S., Thépaut, J-N. (2017): Complete ERA5 from 1979: Fifth generation of ECMWF atmospheric reanalyses of the global climate. Copernicus Climate Change Service (C3S) Data Store (CDS). ### PyPSA/atlite for weather data processing Hofmann et al., (2021). atlite: A Lightweight Python Package for Calculating Renewable Power Potentials and Time Series. Journal of Open Source Software, 6(62), 3294, https://doi.org/10.21105/joss.03294 ### ENTSO-E transparency platform data Installed generation capacities per production type in Finland and Estonia, as well as total load for Finland and Estonia for the year 2015. https://transparency.entsoe.eu/dashboard/show ### Renewables.ninja Solar and wind capacity factor timeseries for Finland and Estonia for the year 2015: [1] Pfenninger, Stefan and Staffell, Iain (2016). Long-term patterns of European PV output using 30 years of validated hourly reanalysis and satellite data. Energy 114, pp. 1251-1265. doi: 10.1016/j.energy.2016.08.060 [2] Staffell, Iain and Pfenninger, Stefan (2016). Using Bias-Corrected Reanalysis to Simulate Current and Future Wind Power Output. Energy 114, pp. 1224-1239. doi: 10.1016/j.energy.2016.08.068