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 THE INCLUDED SPINE TOOLBOX VERSION IS OUTDATED! In order for the installation process to work, please update the included Spine Toolbox either by running `git pull` in the `Spine-Toolbox` root folder, or by downloading the latest version from GitHub.</strong> <strong># SpineOpt demo for the IEA EBC Annex 83 PhD summer school</strong> 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> <strong>## Key contents</strong> 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> <strong>## Installation</strong> 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. <em><strong>**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!**</strong></em> 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> <strong>## Use</strong> 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. <strong>### Editing the workflow</strong> 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. <em><strong>**Any changes with staying power should be made to the above datastores!**</strong></em><br> The `spineopt_combined_input.sqlite` merely merges the above two datastores to form a single<br> combined input dataset for SpineOpt. <br> <strong>## License</strong> 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> However, note that the used [Renewables.ninja](https://www.renewables.ninja/) data is subject to the [Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/) license instead. <br> <strong>## Acknowledgements</strong> 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. <strong>### ERA5 weather data </strong> 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). <strong>### PyPSA/atlite for weather data processing</strong> 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 <strong>### ENTSO-E transparency platform data</strong> 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 <strong>### Renewables.ninja</strong> 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