Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/rl-institut/eBus-Toolbox int…
Browse files Browse the repository at this point in the history
…o dev
  • Loading branch information
PaulScheerRLI committed Aug 10, 2023
2 parents f18116b + ad360c2 commit b4fed68
Show file tree
Hide file tree
Showing 36 changed files with 1,371 additions and 267 deletions.
40 changes: 0 additions & 40 deletions Development Progress.md

This file was deleted.

43 changes: 3 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,7 @@
# SimBA: Simulation toolbox for Bus Applications

The SimBA toolbox assists the user in analysing and optimising electrified bus fleets and schedules.
SimBA - the Simulation toolbox for Bus Applications - was designed to analyze and optimize electrified bus fleets.

### Usage
Please refer to the documentation for further information:

At the current stage, only a single functionality is implemented, which is processing a bus schedule stored in a specific CSV format (see `data/examples/trips_examples.csv`) and run it through a module called SpiceEV for an in-depth SOC analysis.

To try it out, first clone this repository and then install the required packages to your current environment by running

`pip install -r requirements.txt`

Now you can start the SimBA module with all configurations stored at `data/examples/simba.cfg` via the command

``python -m simba --config data/examples/simba.cfg``

The repo provides an example for each necessary input file, so the example case can be executed without the need for the user to provide any data themselves.

To run SimBA with your own `schedule.csv` (see details [below](#input-data)) file and default configurations run

`python -m simba --input_schedule path/to/schedule.csv`

Default configurations are detailed at `data/configs/simba.cfg`.



### Input Data

To analyze your own electric bus schedule, the data needs to be provided as a CSV file where each row contains the details of a single trip of that schedule. Find the details about the various columns in this file below. The first table lists the **mandatory** columns while the second one (tbd) lists optional parameters. Refer to `data/examples/trips.csv` for an example.

| Column Name | Description | Example |
| -------------- | ------------------------------------------------------------ | ----------------- |
| rotation_id | Unique alphanumeric ID to identify rotations | 27312 |
| departure_name | Name of the station the trip starts at | Warschauer Straße |
| departure_time | Date and Time at which bus starts trip | 2022-03-13T10:25 |
| arrival_name | Name of the station the trip ends at | Ostbahnhof Berlin |
| arrival_time | Date and Time at which bus completes trip (e.g. yyyy-mm-ddThh:mm[:ss]) | 2022-03-13T10:30 |
| distance | Distance traveled in **m** | 1340 |
| vehicle_type | ID of vehicle type defined in vehicle types file. Set path of this file in config.<br />(see default for reference: `data/examples/vehicle_types.json`) | some_bus_type |

| Column Name | Description | Example |
| :------------ | :----------------------------------------------------------- | ---------------------------- |
| line | The bus line | 512, M10, X11 etc |
| charging_type | The preferred charging type for this trip.<br />NOTE: All trips of a rotation need to have the same charging type. If omitted, charging type is set according to preferred charging type provided in the config file. | Options: **depb**, **oppb** |
***LINK TO READ THE DOCS***
4 changes: 2 additions & 2 deletions data/examples/cost_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"gc": {
"LV": {
"default_distance": 50,
"capex_gc_fix": 16.85,
"capex_gc_fix": 100,
"capex_gc_per_meter": 16.85,
"capex_gc_per_kW": 24.14,
"capex_transformer_fix": 0,
"capex_transformer_per_kW": 0
},
"MV/LV": {
"default_distance": 100,
"capex_gc_fix": 16.85,
"capex_gc_fix": 100,
"capex_gc_per_meter": 16.85,
"capex_gc_per_kW": 24.14,
"capex_transformer_fix": 0,
Expand Down
48 changes: 25 additions & 23 deletions data/examples/default_optimizer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ debug_level = 1
console_level = 99

#SCENARIO
# Use "" for ids and not ''
# these rotations are excluded from optimization. they will not be simulated
# Use "" for ids and not ''.
# These rotations are excluded from optimization. They will not be simulated.
exclusion_rots = []

# these stations are excluded from optimization. optimization will not electrify them
# These stations are excluded from optimization. optimization will not electrify them.
exclusion_stations = []
# optimization will electrify these stations.
# if using inclusion stations, scenario should be rebased
# Optimization will electrify these stations.
# if using inclusion stations, scenario should be rebased.
inclusion_stations = []
standard_opp_station = {"type": "opps", "n_charging_stations": 200,"distance_transformer": 50}
# rotations which drop below this value are considered not electrified (default value is 0)
standard_opp_station = {"type": "opps", "n_charging_stations": null}
# rotations which drop below this value are considered not electrified (default value is 0).
min_soc = 0.05

#OPTIMIZER
Expand All @@ -31,42 +31,44 @@ solver = quick

# Optimization procedure is developed from the input schedule and scenario. If the scenario is changed
# through this configuration rebasing should be set to true. This will simulate the scenario again with the
# given settings
# given settings.
rebase_scenario = False

# the rebased scenario can be pickled for analysis or repeated use
# The rebased scenario can be pickled for analysis or repeated use.
pickle_rebased = False
# the name of this pickle file can be defined here
# The name of this pickle file can be defined here.
pickle_rebased_name = ""
# Should all rotations be rebased or can rotations which stay above the soc threshold be skipped?
run_only_neg = False
# Should only be opportunity vehicles be rebased, since this optimization is not meant for depot chargers
# Should only be opportunity vehicles be rebased, since this optimization is not meant for depot chargers?
# The optimization will return ALL original rotations of the input in all cases.
run_only_oppb = True
# number of stations before optimal solution, where branch is checked for pruning
# number of stations before optimal solution, where branch is checked for pruning.
pruning_threshold = 3

# Optimization type greedy runs the optimization a single time as greedy as impossible
# Deep repeatedly searches for promising nodes but only new nodes which have not
# been checked before.
# "greedy" or "deep" without ""
# Deep repeatedly searches for promising nodes but only new nodes which have not been checked before.
# "greedy" or "deep" without "".
opt_type = greedy

# For Deep optimization only
# For Deep optimization only:
#############################
# How should the deep optimization choose the nodes.
# Brute is only recommended in smaller systems
# "step-by-step" or "brute" without ""
# Brute is only recommended in smaller systems.
# "step-by-step" or "brute" without "".
node_choice = step-by-step
# How many combinations is the deep method allowed to check
# How many combinations is the deep method allowed to check?
max_brute_loop = 300
# Factor with which the potential evaluation is multiplied before comparing it to the missing energy. A low estimation
# threshold will lead to a more conservative approach in dismissing branches
# threshold will lead to a more conservative approach in dismissing branches.
estimation_threshold = 0.80


# Removing impossible rotations leads to a quick calculation estimating if rotations are impossible.impossible
# If they are deemed as impossible, they are not optimized but discarded
# Removing impossible rotations leads to a quick calculation estimating if rotations are impossible.
# If they are deemed as impossible, they are not optimized but discarded during optimization.
# The optimization will return ALL original rotations of the input in all cases.
remove_impossible_rotations = True
# Check if stations are mandatory for a fully electrified system. If they are, include them
# Check if stations are mandatory for a fully electrified system. If they are, include them.
check_for_must_stations = False


Expand Down
46 changes: 24 additions & 22 deletions data/examples/electrified_stations.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{
"Station-0": {
"type": "deps",
"n_charging_stations": null,
"distance_to_grid": 150,
"energy_feed_in": {
"csv_file": "data/examples/example_pv_feedin.csv",
"start_time": "2022-03-07T00:00:00",
"step_duration_s": 3600,
"column": "Feed-in Total (kW)",
"nominal_power": 10,
"factor": 1
"Station-0": { // name of station
"type": "deps", // type: "deps" or "opps"
"n_charging_stations": null, // nr of charging stataions, "null" for unlimited
"distance_to_grid": 150, // optional: distance to grid, default defined in cost_params
"gc_power": 5000, // optional: maximum gc power for this station, default defined in config
"cs_power_deps_oppb" : 50, // optional: maximum cs power for this station, default defined in config
"cs_power_deps_depb" : 120, // optional: maximum cs power for this station, default defined in config
"voltage_level": "MV", // optional: voltage_level for this station, default defined in config
"energy_feed_in": { // optional: energy feed in e.g. by local renewables
"csv_file": "data/examples/example_pv_feedin.csv", // path to feedin.csv
"start_time": "2022-03-07T00:00:00", // start time as YYYY-MM-DDThh:mm:ss
"step_duration_s": 3600, // timestep in seconds
"column": "Feed-in Total (kW)", // column name in .csv
"nominal_power": 10, // nominal power in kW, needed calculation of for PV remuneration
"factor": 1 // factor to multiply column values, eg 0.001 for conversion from W to kW
},
"external_load": {
"csv_file": "data/examples/example_external_load.csv",
"start_time": "2022-03-07T00:00:00",
"step_duration_s": 900,
"column": "External Load (kW)",
"factor": 2
"external_load": { // optional: local external loads
"csv_file": "data/examples/example_external_load.csv", // path to external_load.csv
"start_time": "2022-03-07T00:00:00", // start time as YYYY-MM-DDThh:mm:ss
"step_duration_s": 3600, // timestep in seconds
"column": "External Load (kW)", // column name in .csv
"factor": 2 // factor to multiply column values, eg 0.001 for conversion from W to kW
},
"battery": {
"battery": { // optional: local stationary battery
"charging_curve": [[0,50], [1,50]], // piecewise linear function that maps SoC to power, from 0 to 1, required
"capacity": 300, // kWh, assumed to be infinite if not given
"min_charging_power": 0, // kW, optional
"soc": 0, // initial state of charge [0-1], optional
"efficiency": 0.95, // optional
"discharge_curve": null // optional, same as charging curve
},
"cs_power_deps_oppb" : 50, // optional: maximum cs power can be defined per station
"cs_power_deps_depb" : 120 // optional: maximum cs power can be defined per station
}
},
"Station-3": {
"type": "opps",
Expand All @@ -47,7 +49,7 @@
"gc_power": 250, // optional: maximum gc power can be defined per station
"cs_power_opps" : 140, // optional: maximum cs power can be defined per station
"voltage_level": "LV" // optional: voltage_level can be defined per station, influences cost
},
},
"Station-21": {
"type": "opps",
"n_charging_stations": 2
Expand Down
4 changes: 3 additions & 1 deletion data/examples/simba.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Input file containing trip information (required)
input_schedule = data/examples/trips_example.csv
# Output files are stored here (defaults to: data/sim_outputs)
output_directory = data/sim_outputs/
# Attention: In Windows the path-length is limited to 256 characters!
output_directory = data/output/
# Electrified stations (required)
electrified_stations = data/examples/electrified_stations.json
# Vehicle types (defaults to: ./data/examples/vehicle_types.json)
Expand Down Expand Up @@ -87,6 +88,7 @@ default_buffer_time_opps = 0
# Options: HV, HV/MV, MV, MV/LV, LV (default: MV)
default_voltage_level = "MV"


##### LOGGING #####
# minimum log level. Allowed/useful: DEBUG, INFO, WARN, ERROR
# INFO includes INFO, WARN and ERROR but excludes DEBUG
Expand Down
Loading

0 comments on commit b4fed68

Please sign in to comment.