HiSim - House Infrastructure Simulator

Related tags

Miscellaneous HiSim
Overview

Forschungszentrum Juelich Logo

HiSim - House Infrastructure Simulator

HiSim is a Python package for simulation and analysis of household scenarios using modern components as alternative to fossil fuel based ones. This package integrates load profiles generation of electricity consumption, heating demand, electricity generation, and strategies of smart strategies of modern components, such as heat pump, battery, electric vehicle or thermal energy storage. HiSim is a package under development by Forschungszentrum Jülich und Hochschule Emden/Leer.

Clone repository

To clone this repository, enter the following command to your terminal:

git clone https://github.com/FZJ-IEK3-VSA/HiSim.git

Virtual Environment

Before installing hisim, it is recommended to set up a python virtual environment. Let hisimvenv be the name of virtual environment to be created. For Windows users, setting the virtual environment in the path \hisim is done with the command line:

python -m venv hisimvenv

After its creation, the virtual environment can be activated in the same directory:

hisimvenv\Scripts\activate

For Linux/Mac users, the virtual environment is set up and activated as follows:

virtual hisimvenv
source hisimvenv/bin/activate

Alternatively, Anaconda can be used to set up and activate the virtual environment:

conda create -n hisimvenv python=3.8
conda activate hisimvenv

With the successful activation, hisim is ready to be locally installed.

Install package

After setting up the virtual environment, install the package to your local libraries:

python setup.py install

Run Simple Examples

Run the python interpreter in the hisim/examples directory with the following command:

python ../hisim/hisim.py examples first_example

This command executes hisim.py on the setup function first_example implemented in the file examples.py that is stored in hisim/examples. The same file contains another setup function that can be used: second_example. The results can be visualized under directory results created under the same directory where the script with the setup function is located.

Run Basic Household Example

The directory hisim\examples also contains a basic household configuration in the script basic_household.py. The first setup function (basic_household_explicit) can be executed with the following command:

python ../hisim/hisim.py basic_household basic_household_explicit

The system is set up with the following elements:

  • Occupancy (Residents' Demands)
  • Weather
  • Photovoltaic System
  • Building
  • Heat Pump

Hence, photovoltaic modules and the heat pump are responsible to cover the electricity the thermal energy demands as best as possible. As the name of the setup function says, the components are explicitly connected to each other, binding inputs correspondingly to its output sequentially. This is difference then automatically connecting inputs and outputs based its similarity. For a better understanding of explicit connection, proceed to session IO Connecting Functions.

Generic Setup Function Walkthrough

The basic structure of a setup function follows:

  1. Set the simulation parameters (See SimulationParameters class in hisim/hisim/component.py)
  2. Create a Component object and add it to Simulator object
    1. Create a Component object from one of the child classes implemented in hisim/hisim/components
      1. Check if Component class has been correctly imported
    2. If necessary, connect your object's inputs with previous created Component objects' outputs.
    3. Finally, add your Component object to Simulator object
  3. Repeat step 2 while all the necessary components have been created, connected and added to the Simulator object.

Once you are done, you can run the setup function according to the description in the simple example run.

Package Structure

The main program is executed from hisim/hisim/hisim.py. The Simulator(simulator.py) object groups Components declared and added from the setups functions. The ComponentWrapper(simulator.py) gathers together the Components inside an Simulator Object. The Simulator object performs the entire simulation under the function run_all_timesteps and stores the results in a Python pickle data.pkl in a subdirectory of hisim/hisim/results named after the executed setup function. Plots and the report are automatically generated from the pickle by the class PostProcessor (hisim/hisim/postprocessing/postprocessing.py).

Component Class

A child class inherits from the Component class in hisim/hisim/component.py and has to have the following methods implemented:

  • i_save_state: updates previous state variable with the current state variable
  • i_restore_state: updates current state variable with the previous state variable
  • i_simulate: performs a timestep iteration for the Component
  • i_doublecheck: checks if the values are expected throughout the iteration

These methods are used by Simulator to execute the simulation and generate the results.

List of Component children

Theses classes inherent from Component (component.py) class and can be used in your setup function to customize different configurations. All Component class children are stored in hisim/hisim/components directory. Some of these classes are:

  • RandomNumbers (random_numbers.py)
  • SimpleController (simple_controller.py)
  • SimpleSotrage (simple_storage.py)
  • Transformer (transformer.py)
  • PVSystem (pvs.py)
  • CHPSystem (chp_system.py)
  • Csvload (csvload.py)
  • SumBuilderForTwoInputs (sumbuilder.py)
  • SumBuilderForThreeInputs (sumbuilder.py)
  • ToDo: more components to be added

Connecting Input/Outputs

Let my_home_electricity_grid and my_appliance be Component objects used in the setup function. The object my_apppliance has an output ElectricityOutput that has to be connected to an object ElectricityGrid. The object my_home_electricity_grid has an input ElectricityInput, where this connection takes place. In the setup function, the connection is performed with the method connect_input from the Simulator class:

my_home_electricity_grid.connect_input(input_fieldname=my_home_electricity_grid.ElectricityInput,
                                       src_object_name=my_appliance.ComponentName,
                                       src_field_name=my_appliance.ElectricityOutput)

Configuration Automator

A configuration automator is under development and has the goal to reduce connections calls among similar components.

Post Processing

After the simulator runs all time steps, the post processing (postprocessing.py) reads the persistent saved results, plots the data and generates a report.

License

MIT License

Copyright (C) 2020-2021 Noah Pflugradt, Vitor Zago, Frank Burkard, Tjarko Tjaden, Leander Kotzur, Detlef Stolten

You should have received a copy of the MIT License along with this program. If not, see https://opensource.org/licenses/MIT

About Us

Institut TSA

We are the Institute of Energy and Climate Research - Techno-economic Systems Analysis (IEK-3) belonging to the Forschungszentrum Jülich. Our interdisciplinary institute's research is focusing on energy-related process and systems analyses. Data searches and system simulations are used to determine energy and mass balances, as well as to evaluate performance, emissions and costs of energy systems. The results are used for performing comparative assessment studies between the various systems. Our current priorities include the development of energy strategies, in accordance with the German Federal Government’s greenhouse gas reduction targets, by designing new infrastructures for sustainable and secure energy supply chains and by conducting cost analysis studies for integrating new technologies into future energy market frameworks.

Contributions and Users

This software is developed together with the Hochschule Emden/Leer inside the project "Piegstrom".

Acknowledgement

This work was supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 A Contribution of the Research Field Energy".

Helmholtz Logo

Comments
  • New component heat pump, based on hplib

    New component heat pump, based on hplib

    • I created a new heat pump component
    • I added necessary input files
    • I added a test file
    • Further more I made edits on the loadtypes file and corrected a path in a readme
    opened by ttjaden 3
  • Include buffer storage

    Include buffer storage

    (1) generalized boiler to hot water storage which can be either used as buffer or boiler (2) implemented heating system with buffer storage: was done with availbale controllers and components, component HeatingSystem is still not implemented (3) separated example modular_household into functions initializing the corresponding components/HeatingSystems (4) enabled parsing of SystemConfig and included decision variables included yes/no as well as capacity variables (5kWh)

    opened by joga4er 1
  • Error while running examples after updates

    Error while running examples after updates

    Log message:

    (hisimvenv) C:...\HiSim\examples>python ../hisim/hisim_main.py examples first_example LogPrio.Information:calling first_example from examples LogPrio.Information:################################# LogPrio.Information:starting simulation of examples first_example LogPrio.Information:Start @ 15-Aug-2022 16:33:13 LogPrio.Profile:examples first_exampleStart @ 15-Aug-2022 16:33:13 LogPrio.Information:################################# LogPrio.Profile:Executing hisim.simulator.init took 0.06 seconds LogPrio.Information:Starting first example: Traceback (most recent call last): File "C:...\HiSim\hisim\hisim_main.py", line 74, in main(filename, function_name) File "C:...\HiSim\hisim\hisim_main.py", line 53, in main model_init_method(my_sim, my_simulation_parameters) File "C:...\HiSim\examples\examples.py", line 26, in first_example my_sim.set_simulation_parameters(my_simulation_parameters) AttributeError: 'Simulator' object has no attribute 'set_simulation_parameters'

    opened by sdickler 1
  • Add default connection excluding variable inputs

    Add default connection excluding variable inputs

    Same as "added-default-connections" but modular_houshold has no additional inputs and hisim.main remains unchanged. Automated tests for modluar household cannot be included at this stage

    opened by joga4er 1
  • Add default connections

    Add default connections

    (1) added default connections for building, heat pump, oil heater, districti heating and simple bucket boiler (2) created example modular_household which represents all possible configurations of pv, boiler and heating systems (3) manipulated hisim_main() to enable calls to modular_household_explicit( *arg ) with variable input arguments -> please check if this is ok for you Noah. (4) extanded test_examples() by a loop over all possible configurations of modular_houshold

    opened by joga4er 1
  • Bug fixing 3

    Bug fixing 3

    inputs&outputs were mixed in controller_l2_energy_management_system and the controller iterated over outputs - which it should definitely not do -> know example is faster and battery control finally works

    opened by joga4er 0
  • Casadi related error

    Casadi related error

    Including casadi module to eliminate mypy error "ModuleNotFoundError:No module named 'casadi'". Casadi is the optimization tool used in the model predictive controller

    opened by Marwa-AL 0
  • Add building sizer template

    Add building sizer template

    Added a template for the building sizer. Contains:

    • building_sizer.py: the script file that will run in the UTSP as a docker image; implements the basic iterative structure of the building sizer, consisting of multiple subsequent building_sizer and hisim requests
    • start_building_sizer.py: a client-side script for starting the building sizer and retrieving its results
    • Dockerfile: the dockerfile necessary to build the building sizer docker image out of the building_sizer.py script
    • build_building_sizer_image.bat: a helper script for building the building sizer docker image
    opened by DavidNeuroth 0
  • Delete deep copy

    Delete deep copy

    some small changes before christmas: -removed deepcopies from advanced_battery component -replaced BuildingType enums to string in arche_type_config -found and fixed small issues

    opened by joga4er 0
  • Inconsistent file path

    Inconsistent file path

    bug: data path is inconsistent with the developed code of reading files

    fix: Moving inputs/weather/NSRDB to inputs\weather\test-reference-years_2015-2045_15-locations\NSRDB

    opened by Mousa-Zerai 0
  • One month simulation doesn't work for months other than January

    One month simulation doesn't work for months other than January

    Simulation of August using - get_unique_key() - or by creating a function august_only() similar to the case of January is not working. Weather data are not read correctly.

    opened by Marwa-AL 0
Owner
FZJ-IEK3
Institute of Energy and Climate Research - Techno-economic Systems Analysis (IEK-3)
FZJ-IEK3
Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc.

pysesame3 Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc. This project aims to control SESAME 3 series d

Masaki Tagawa 18 Dec 12, 2022
Final Fantasy XIV Auto House Clicker

Final Fantasy XIV Auto House Clicker

KanameS 0 Mar 31, 2022
Konomi: Kind and Optimized Next brOadcast watching systeM Infrastructure

Konomi 備考・注意事項 現在 α 版で、まだ実験的なプロダクトです。通常利用には耐えないでしょうし、サポートもできません。 安定しているとは到底言いがたい品質ですが、それでも構わない方のみ導入してください。 使い方などの説明も用意できていないため、自力でトラブルに対処できるエンジニアの方以外に

tsukumi 243 Dec 30, 2022
MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework

MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework, which facilitates the coordination of massively parallel multiscale simulations.

null 4 Aug 17, 2022
Basic infrastructure for writing scripts in Python

Base Script Python is an excellent language that makes writing scripts very straightforward. Over the course of writing many scripts, we realized that

Deep Compute, LLC 9 Jan 7, 2023
This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.

py-12f-common About This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principl

Tamás Benke 1 Dec 15, 2022
An end-to-end Python-based Infrastructure as Code framework for network automation and orchestration.

Nectl An end-to-end Python-based Infrastructure as Code framework for network automation and orchestration. Features Data modelling and validation. Da

Adam Kirchberger 15 Oct 14, 2022
A Python simple Dice Simulator just for fun

Dice Simulator ?? A Simple Python Dice Simulator ?? ?? ?? Description: That program make your RPG session more easy and simple. Roll the dice never be

Lauro Brant 17 May 14, 2022
Python Monopoly Simulator

Monopoly simulator Original creator: Games Computer Play YouTube: https://www.youtube.com/channel/UCTrp88f-QJ1SqKX8o5IDhWQ Config file (optional) conf

Games Computers Play 37 Jan 3, 2023
A simple PID tuner and simulator.

PIDtuner-V0.1 PlantPy PID tuner version 0.1 Features Supports first order and ramp process models. Supports Proportional action on PV or error or a sp

null 3 Jun 23, 2022
DNA Storage Simulator that analyzes and simulates DNA storage

DNA Storage Simulator This monorepository contains code for a research project by Mayank Keoliya and supervised by Djordje Jevdjic, that analyzes and

Mayank Keoliya 3 Sep 25, 2022
Architecture example simulator

SCADA architecture Example of a SCADA-like console application, used to serve as a minimal example of a standard architecture of an IIoT system. Insta

null 1 Nov 6, 2021
Ice Skating Simulator for Winter and Christmas [yay]

Ice Skating Simulator for Winter and Christmas [yay]

null 1 Aug 21, 2022
Python PID Controller and Process Simulator (FOPDT) with GUI.

PythonPID_Simulator Python PID Controller and Process Simulator (FOPDT) with GUI. Run the File. Then select Model Values and Tune PID.. Hit Refresh to

null 19 Oct 14, 2022
Python / C++ based particle reaction-diffusion simulator

ReaDDy (Reaction Diffusion Dynamics) is an open source particle based reaction-diffusion simulator that can be configured and run via Python. Currentl

ReaDDy 46 Dec 9, 2022
solsim is the Solana complex systems simulator. It simulates behavior of dynamical systems—DeFi protocols, DAO governance, cryptocurrencies, and more—built on the Solana blockchain

solsim is the Solana complex systems simulator. It simulates behavior of dynamical systems—DeFi protocols, DAO governance, cryptocurrencies, and more—built on the Solana blockchain

William Wolf 12 Jul 13, 2022
Run the Tianxunet software on the Xiaoyao Android simulator

Run the Tianxunet software on the Xiaoyao Android simulator, and automatically fill in the answers of English listening on the premise of having answers

null 1 Feb 13, 2022
This is a a CSMA/CA simulator written in Python based on simulator of the same type

This is a a CSMA/CA simulator written in Python based on simulator of the same type found the link https://github.com/StevenSLXie/CSMA-Simulator with

M. Ismail 4 Nov 22, 2022
Crypto-trading-simulator - Cryptocurrency trading simulator using Python, Streamlit

Crypto Trading Simulator Run streamlit run main.py Dependency Python 3 streamli

Brad 12 Jul 2, 2022
House-GAN++: Generative Adversarial Layout Refinement Network towards Intelligent Computational Agent for Professional Architects

House-GAN++ Code and instructions for our paper: House-GAN++: Generative Adversarial Layout Refinement Network towards Intelligent Computational Agent

null 122 Dec 28, 2022