Code Monkey home page Code Monkey logo

alpg's Introduction

Artifical load profile generator

This tool is an Artifical Load Profile Generator (ALPG) with the purpose to stimulate research and benchmarking of different Demand Side Management (DSM) approaches. The main contribution of this generator is the addition of flexibility information of flexible devices. This input, next to static profiles, can be used to evaluate and benchmark the performance of DSM approches.

Note that, because of this purpose, the output of the ALPG should only be used as an input for another smart grid simulation and optimization tool. This is due to the fact that only static load profiles are written in CSV files, which do not include the power consumption of flexibile devices, such as washing machines, dishwashers, electric vehicles or heating devices! It is up to the smart grid / DSM optimization software to schedule (and simualate) the usage and power consumption of these devices.

As such, the tool is free to use and modify under the GPL v3.0 license to stimulate expansion and improvement of the used models.

The work is presented in the paper: G. Hoogsteen, A. Molderink, J.L. Hurink and G.J.M. Smit, "Generation of Flexible Domestic Load Profiles to Evaluate Demand Side Management Approaches", IEEE EnergyCon 2016 conference, Leuven, Belgium.

An updated version is presented in the G. Hoogsteen, "A Cyber-Physical Systems Perspective on Decentralized Energy Management", PhD Thesis, University of Twente, Enschede, the Netherlands. Available: https://research.utwente.nl/en/publications/a-cyber-physical-systems-perspective-on-decentralized-energy-mana (Chapter 6 covers the ALPG).

For more information, please see http://utwente.nl/ctit/energy

Contact me at: g.hoogsteen [at] utwente.nl

Running

Running the ALPG is done by executing "profilegenerator.py -c [-o <output_folder> --force]"

Here, the parameters are:

-c	--config=	Configuration file within the configs/ directory. Note ".py" must be excluded!
-o	--output=	Output directory of the generated configuration data within the output/ folder.
-f	--force		Force the output directory to be cleared

So, to run the configs/example.py configuration and write results into output/results/, a command (depending on your operating system) like this should be issued on the commandline:

python profilegenerator.py -c example -o results

The tool is written in the Python3 language and should work on all major platforms.

Furthermore, the tool depends on the Astral package, which can be installed using pip: https://pypi.python.org/pypi/astral E.g. use a command like

pip3 install astral==1.10.1

Note that the simulation is quite heavy and is barely optimized. Generation of output therefore takes a long time. So, be patient and don't generate too much households as the tool is aimed at small groups of houses (~100 households max).

Configuration

The configuration is specified in the file "config.py". The comments in the file should guide the setup process and the provided example works out of the box. The following input can be specified:

  • Output folder
  • Number of days to produce
  • Geographical location
  • Input files for solar irradiation data
  • Penetration of emerging technologies
  • Power consumption of certain devices
  • Predictability of people
  • Type of households in the neighbourhood.

Household types

  • HouseholdSingleWorker
  • HouseholdSingleRetired
  • HouseholdDualWorker(Parttime)
  • HouseholdDualRetired
  • HouseholdFamilyDualWorker(Parttime)
  • HouseholdFamilySingleWorker(Parttime)

Where (Parttime) is an argument that specifies if one of the workers has a part-time job instead of a full-time job.

Solar irradiation file

This must be a single column CSV file with one value on each row for the corresponding interval. The timebase can be given (default 3600 seconds) to specify the interval length of the dataset. The required informaiton is the global horizontal irradiation (GHI) and must be provided in J/cm2 (joules per square centimeter). Dutch weather data can be found and downloaded from the KNMI website: http://projects.knmi.nl/klimatologie/uurgegevens/selectie.cgi. The provided data contains the 2022 measurements of weather station Twenthe, Netherlands.

Generation

The comments in the code give some hints on how the simulation is executed and used sources where applicable.

Output

The resulting profile data is stored in the specified output folder. All static profiles are given in minute intervals. All flexibility times are specified in seconds since the simulation start. The content of the files with the default writer is as follows:

CSV files*

All CSV files contain the static profiles and use a semicolon (;) as delimiter. The format of each CSV-file is as follows:

  • Each row represents an interval in order. Hence row 1 is time interval 1, row 2 time interval 2, etc.
  • Each column represents a household in order. Hence colunmn 1 is the consumption for household 0, row 2 for household 1, etc.
  • Each value is the average power consumption during that interval in Watts
  • Negative values indicate production
  • Note that we index all IDs starting at 0 instead of 1!

Note that the solar profile is flexible in the sense that it can be curtailed. Negative consumption is production. For reactive power profiles, the value represents the reactive power in var.

Text files

The format of text files is as follows for each line:

Start and endtime text files:

Specifies availability times for each device in two files (starttimes and endtimes):

<houseID>: <startTime1 in seconds>, <starttime 2 in seconds>, ..., <starttime n in seconds>

Note that for the thermostat only starttimes are given. The temperature setpoint is changed at each starttime.

Profiles

Specifies the consumption profile for Timeshiftable devices (washing machines, dishwashers, etc) for each interval of 60 seconds:

<houseID>: <interval 1>, <interval 2>, <interval 3>, ..., <interval n>

The profile is given in Python Complex values where the real part represents the active power consumption in Watts and the imaginary part the reactive power in var.

Device specific

BatterySettings.txt:

<houseID>: <maximum power in W>, <capacity in Wh>, <initial SoC in Wh>

ElectricVehicle_RequiredCharge.txt:

<houseID>: <required charge for job 1 in Wh>, <required charge for job 2 in Wh>, ...,<required charge for job n in Wh>

The jobs correspond to the start- and endtimes as specified in ElectricVehicle_Starttimes.txt and ElectricVehicle_Endtimes.txt

ElectricVehicle_Specs.txt:

<houseID>: <battery capacity in Wh>, <maximum charging power in W>

PhotovoltaicSettings.txt:

<houseID>: <angle (elevation) in degrees>, <aimuth in degrees, north = 0, east = 90>, <efficiency in percent>, <size in m2 (square meter)>

Thermostat_Setpoints.txt:

<houseID>: <temperature setpoint in degrees Celsius for starttime 1>, <temperature setpoint for starttime 2>, ..., <temperature setpoint for starttime n>

The starttimes correspond to the starttimes as specified in Thermostat_Starttimes.txt, and last until the next starttime.

HeatingSettings.txt:

<houseID>: <type of heating>

Here, the type of heating is either HP (heatpump), CHP (combined heat power) or CONVENTIONAL (conventional heating used in the area, e.g. gas boilers (Netherlands)).

Heat profiles For heating, the heatgains are also provided in Watts. The output matches with models by R.P. van Leeuwen. References in this section of the readme refer to chapters and pages of: R.P. van Leeuwen, "Towards 100% renewable energy supply for urban areas and the role of smart control", PhD Thesis, University of Twente, Enschede, the Netherlands. Available: https://research.utwente.nl/en/publications/towards-100-renewable-energy-supply-for-urban-areas-and-the-role-

Heatgain_Profile.csv: This file contains all zone heat gains for each house (columns) in each interval (rows), excluding solar gain. Matches with the gains in the 2R2C model, R.P. van Leeuwen Chapter 2.5, pp. 27-28

Airflow_Profile_Ventilation.csv: This file contains the airflow of the ventilation system given in m3/h. The actual heat loss depends on the temperature difference between the ambient an indoor temperature. See R.P. van Leeuwen Chapter 3.3, pp. 48 formula 3.1

Heatdemand_Profile.csv: This file contains domestic hot tap water usage and falls outside the thermal models. However, a heat sourece must still provide the heating energy to heat up the water.

Notes

  • HouseID starts at 0

Using the output

As stated in the introduction, the output should be used as input for energy management tools. An example of such a tool is DEMKit, developped at the University of Twente. For more information on DEMKit, smart grid optimization and the ALPG+DEMKit toolchain, please refer to: G. Hoogsteen, "A Cyber-Physical Systems Perspective on Decentralized Energy Management", PhD Thesis, University of Twente, Enschede, the Netherlands. Available: https://research.utwente.nl/en/publications/a-cyber-physical-systems-perspective-on-decentralized-energy-mana

Device specific optimization algorithms, as implemented in DEMKit, are presented by T. van der Klauw: T. van der Klauw, "Decentralized Energy Management with Profile Steering: Resource Allocation Problems in Energy Management", PhD Thesis, University of Twente, Enschede, the Netherlands. Available: https://research.utwente.nl/en/publications/decentralized-energy-management-with-profile-steering-resource-al

Furthermore, the heating information generated as of v1.2 requires heat models for zones, ventilation calculations and implementation of thermostats. The ALPG output for heating and ventilation systems match the requirements for heat models as presented by R.P. van Leeuwen, which are also implemented in DEMKit. For more information on these models and control refer to: R.P. van Leeuwen, "Towards 100% renewable energy supply for urban areas and the role of smart control", PhD Thesis, University of Twente, Enschede, the Netherlands. Available: https://research.utwente.nl/en/publications/towards-100-renewable-energy-supply-for-urban-areas-and-the-role-

Changelog

Version 1.3

  • Creation of empty files on start
  • Added new household types, including jobless persons

Version 1.2

  • Improved the PV panel model
  • Additional checks to prevent overwriting on the output folder
  • Added parameters for configurage configs and output directory
  • Improved folder structure
  • Improved documentation and comments here and there
  • Added heatdemand models
  • ALPG now also generates thermostat setpoints
  • ALPG now also generates internal heatgains
  • ALPG now also generates active ventilation schedules (ventilation electricity usage updated accordingly)
  • ALPG now also generates domestic hot water usage profiles
  • Added penetrations for heating devices: Heatpumps and combined heat power (CHP)
  • Removed the old config.py module, contents split up in configLoader.py and configs/example.py and the rest of the code
  • Timebases now hardcode to 60 seconds as resampling was not working
  • Usage of latitude and longitude with astral instead of city name for more flexibility
  • Azimuth for PV panels shifted by 180 degrees!!!

Version 1.1

  • Fixed retired people to have no driving distance to work
  • Fixed dishwasher profile
  • More rounded timeshiftable times to avoid synchronisation with auctions pushing towards the runtime deadlines
  • Fixed a bug resulting in overlapping start + endtimes for EVs

alpg's People

Contributors

genetx avatar ghoogsteen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

alpg's Issues

Performance of generation of profiles

I've been looking to use ALPG to generate profiles for my thesis. While running the generator, I've noticed that it takes quite a while to run. I've looked into it and I think it can be improved by doing 2 things: generating data for multiple households at the same time and writing the data to disks in a different way. For both of these issues, I've done some quick tests and it seems feasible. Separately they've both shown significant execution time reduction (20% or more on my laptop)

Generating data for multiple households

Currently the generator generates the data for a single household at the time, then writes it to disk and then starts on the next household. If I understand the code well, there is no normalisation or relation between the data of households of any kind. It could thus be parallelized at the cost of having a bit more randomness in the output data as the random function is not called in the same order for the same house for the data generation.

Writing data to disk in a different way

The generator currently generates one data for one household, then writes it to disk. Because of the format it is stored in, it has to look for the end of a line and append it. This is quite time consuming. There are different ways to solve this, but I propose two.

The first would be a change in output format. Instead of splitting the data over multiple files, it could be that a single file contains all the data of one household. This way, the file can be written separately, without having to look anything up and as one big batch of data.

While I do think that it is a nice output format and would actually help me a lot (since I'm now working on a lot of code to split and rearrange the data back in to households), I don't think this is the right way to go. The reason is that this will significantly change the output format and will require a rewrite of any program that uses input based on ALPG.

The second solution would be to generate data for multiple houses and write them away at the same time. This is faster as it reduces waiting for IO. The downside is that it will require more RAM as it needs to store the data of multiple houses at the same time in memory.

Proposal

I propose to implement concurrent data generation for households and implement batched writing to csv files which are both configurable withing the config. This way, one should be able to run ALPG as originally written. However, if one chooses to do so, it will lead to faster data generation which can be quite significant if generating a large amount of houses

I know this is quite out of the blue, so please let me know if you're even looking for something like this. Any thoughts and comments are much appreciated.

Regarding HP heat demand-Electrical power; Self-consumption; Location

Hello Sir,

I am currently working on my Master's thesis on "Demand Side Flexibility". In order to analyze household load consumption and PV generation data, I am interested in utilizing "alpg". I have a few questions regarding the Heat Pump's Heat Demand Output, the results of Self-Consumption, and the location in Germany.

1: Result folder:

  • I have a dataset called "Heatdemand_Profile" which contains information on the heat demand (in Watts) for DH Water. In addition, I also have a "Heat gain profile" which includes the combined heat gain from both people and devices. My question is whether the values in these datasets are already in electrical power (Watts) or if I need to convert them using the COP?
  • Additionally, I would like to inquire about how the HP or CHP heat demand is factored into the results. I have also observed alterations in the profiles of "Heat gain" and "Heat gain persons" based on the thermostat's response to achieving the set point temperature. Could you clarify if the data for "Heat gain persons" (measured in Watts) is equivalent to the heat pump's heat demand, or do I need to do something else for the calculation? I would appreciate your guidance on this matter.

2: example.py:
-In the "example.py" file, I came across a line that reads, "This emulates the Dutch 'nul-op-the-meter regime (net zero annual electricity usage)." From this, it appears that the output is generated using either a self-consumption or a net-metering mechanism to achieve net-zero annual electricity usage. Can you provide more clarity on the meaning of this line?

  • I need to update the location from the Netherlands to Germany in this file. I switched from the "Europe/Amsterdam" timezone to "Europe/Berlin" in order to collect German household data, and I also updated the latitude and longitude accordingly. I'm curious to know if the changes I made are enough to display the relevant data or if I need to modify anything else in the config or input folder.

Thank you in advance!
image

Changing time resolution of the simulation

Hello!
I'm using the tool for the Master Thesis in the TU Eindhoven. I see that you did not fully implement the time rounding feature (to change the simulation resolution) although you started. Some loads (full electricity load, saved in file ElectricityProfile.csv) are in 1 minute resolution already. I was trying to change the time resolution by myself, but it seems I was doing it in the wrong place of the code.
Can you please point me to the exact moment the definition of the time resolution happens? How do you see the integration of the time resolution roundings in all simulations (e.g. clustering the energy demand of the EVs)?

Induction consumption

I have created two examples (each with 35 households), one with zero penetration of induction cooking (penetrationInductioncooking = 0) and the other one with 100%. When I check the file Electricity_profile_GroupInductive.csv I can see more or less the same consumption. Am I looking at the wrong file? Where can I see the consumption of the induction stove?

simulation with data from TMY-generator + electricity needed to warm up the house

Hello!

I want to use this generator in my masterthesis (Simulation of electrical load profiles of residential prosumers) but I run into two problems.

The first question I have:
is the power needed to warm up the house (conventional, HP or CHP) summed up in the output file: 'Electricity_Profile'? The heating of the house is mostly one of the biggest consumers so for my simulation this is also needed in the load profiles.

The second problem I have:
when I use data from the TMY-generator (https://re.jrc.ec.europa.eu/pvg_tools/en/#TMY) the GHI-data is provided in W/m² hourly. Because the model from ALPG asks the GHI in J/cm² I multiply the values from the TMY-generator with 0,36 so the data is now provided in J/cm². However, this leads to larger values for GHI than Twente's sample file has (10 times larger sometimes). As a result, the generated energy of the solar panel installation is also at least 2 times larger.
I compare data from the Netherlands (Twente, in input ALPG) with that of Belgium (Gent, TMY) so there is normally not much difference in weather conditions here.
My question is whether I convert the W/m² correctly in the first place and whether I can possibly modify something in the program so that I can leave the data in W/m² hourly and insert it that way.

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.