Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rl-institut/spice_ev

Simulation Program for Individual Charging Events of Electric Vehicles
https://github.com/rl-institut/spice_ev

Last synced: about 2 months ago
JSON representation

Simulation Program for Individual Charging Events of Electric Vehicles

Awesome Lists containing this project

README

        

# SpiceEV - Simulation Program for Individual Charging Events of Electric Vehicles

**Simulation program to generate scenarios of electric vehicle fleets and simulate different charging strategies.**

[![Build Status](https://github.com/rl-institut/spice_ev/actions/workflows/pythonpackage.yaml/badge.svg?branch=dev)](https://github.com/rl-institut/spice_ev/actions/workflows/pythonpackage.yaml) [![Documentation Status](https://readthedocs.org/projects/spice-ev/badge/?version=latest)](https://spice-ev.readthedocs.io/en/latest/?badge=latest)

# Introduction

SpiceEV is a program to simulate different charging strategies for a defined set of vehicles and corresponding trips to and from charging stations. The output shows load profiles of the vehicle battery, the corresponding charging station, the grid connector as well as the electricity price and, if applicable, stationary batteries. Each vehicle is by default connected to a separate charging station. All charging stations of one location can be connected to one grid connector with a defined maximum power. Some charging strategies only allow for one grid connector, please check [charging strategies](https://spice-ev.readthedocs.io/en/latest/charging_strategies_incentives.html#charging-strategies) for more information.

The first step of SpiceEV is to generate a `scenario.json`. The `scenario.json` contains information about the vehicles and their specific attributes (e.g. battery capacity, charging curve, etc.) as well as their trips from and to a specific charging station (so-called vehicle events). Further, the charging stations attributes, such as its maximum power, the attached grid connector and the according electricity price are defined. Depending on the scenario, a certain foresight can be applied for grid operator signals. If applicable, stationary batteries with according capacities and c_rates can be defined and fixed load profiles or local generation time series attached to a grid connector can be imported from CSV files. The input `scenario.json` can be generated by one of the [generate scripts](https://spice-ev.readthedocs.io/en/latest/code.html#generate-modules).

# Documentation

The full documentation can be found [here](https://spice-ev.readthedocs.io/en/latest/index.html)

# Installation

Clone this repository. SpiceEV just has an optional dependency on
Matplotlib. Everything else uses the Python (>= 3.6) standard library.

To install `spice_ev` as a package run:
```sh
pip install -e .
```

# Run Examples

In order to run a simulation with `simulate.py` a scenario JSON has to be generated first using `generate.py`.
For this three modes are available:

* `statistics` Generate a scenario JSON with trips from statistical input parameters.
* `csv` Generate a scenario JSON with trips listed in a CSV.
* `simbev` Generate a scenario JSON from SimBEV results.

Show all command line options:
```sh
python generate.py -h
python simulate.py -h
```

## Quick Start
Generate a scenario and store it in a JSON. By default, the mode `statistics` is used.
```sh
python generate.py --output scenario.json
```

Run a simulation of this scenario using the `greedy` charging strategy and show
plots of the results:
```sh
python simulate.py scenario.json --strategy greedy --visual
```

## Using Configuration Files
There are example configuration files in the folder **examples**. The required input/output must still be specified manually:
```sh
python generate.py --config examples/configs/generate.cfg
python simulate.py --config examples/configs/simulate.cfg
```

## Generating Scenarios
Generate a 7-day scenario with 10 vehicles of different types and 15 minute timesteps:
```sh
python generate.py --days 7 --vehicles 6 golf --vehicles 4 sprinter --interval 15 --output scenario.json
```

## Including external Timeseries
Include a fixed load in the scenario:
```sh
python generate.py --include-fixed-load-csv fixed_load.csv --output scenario.json
```

Please note that included file paths are relative to the scenario file location. Consider this directory structure:
```sh
├── scenarios
│ ├── price
│ │ ├── price.csv
│ ├── my_scenario
│ │ ├── fixed_load.csv
│ │ ├── scenario.json
```

The file `fixed_load.csv` is in the same directory as the `scenario.json`, hence no relative path is specified.
To include the price and fixed load timeseries:
```sh
python generate.py --include-price-csv ../price/price.csv --include-fixed-load-csv fixed_load.csv --output scenario.json
```

## Adding a Schedule to a Scenario
Calculate and include schedule:
```sh
python generate_schedule.py --scenario scenario.json --input examples/data/grid_situation.csv --output schedules/schedule_example.csv
```

# Integrating SimBEV
SpiceEV supports scenarios generated by the [SimBEV](https://github.com/rl-institut/simbev) tool. Convert SimBEV output files to a SpiceEV scenario:
```sh
python generate.py simbev --simbev /path/to/simbev/output/ --output scenario.json
```

# License
SpiceEV is licensed under the MIT License as described in the file [LICENSE](https://github.com/rl-institut/spice_ev/blob/dev/LICENSE)