fyziktom / VirtualEconomyFramework

Framework for economy applications
https://veframework.com/
MIT License
24 stars 7 forks source link

151 entities blocks storage UI #154

Closed fyziktom closed 1 year ago

fyziktom commented 1 year ago

This merge brings the basic components for the storage simulator. The components are here. You can add the battery block or display the list of loaded batteries blocks.

The storage is connected to the PVESimulation Day graph. The charging is done by function which keeps loaded value inside of BatteryBlocksHandler. The discharge is calculated by function which calculate values just for some set of data (usually one day). It expect to load the previous state of load in battery in function. This example does not load it yet. The graph lines of storage are divided by 10 to keep suitable ratio to PVE production. This should be done somehow properly :D, but even that, the results are nice to see:

obrazek

This merge contains the demo of calculation of the whole bilance in network. It is kind of "not optimized", but it shows the steps in the calculation and possible use of the created libraries. The example is here. The example has lots of comments so it does not need to repeat it here.

The basic steps in this example are:

graph TD
    A(Get PVE Day Energy)--> C
    B(Get Consumption Based TDD)
    B --> C(Calc Consumption Covered by PVE)
    C --> D(Calc Rest of PVE Over produced energy)
    D --> E(Calc Possible stored and used energy)
    E --> F(Calc Stats of Day)

Simulation load as parameters the filenames of TDD, and configs for Grid, PVE and BatteryStorage (you can use the samples in Demo.Energy). The TDD data input was taken from here. It was exported from MS Excel to csv, removed mess to keep just data (checkthe example here). Here you can set the startdate. Here you can set the length of the simulation. If you set some date for simulation be sure you have prepared TDD data for same date range as input.

The output are three files:

The output blocks in final output grid config consists of:

The algorithm is not optimized, same as load of the blocks from config. For whole year simulation it will take ages to load it in todays ui block time graph. There are blocks for each hour in day in year for consumption and production and partilally for storage too. There are ways how to optimized it. but for day simulations it will be fast enough even now.

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 29 Code Smells

53.3% 53.3% Coverage
0.0% 0.0% Duplication