Skip to content

A co-simulation testbed for carbon-aware computing systems 🍃

License

Notifications You must be signed in to change notification settings

philipkalesse/vessim

 
 

Repository files navigation

Vessim Logo

Vessim is a co-simulation testbed for carbon-aware systems. It allows you to simulate the interaction of computing systems with local energy systems, including renewable energy sources, energy storage, and the public grid. Vessim can connect domain-specific simulators for power generation and batteries with real software and hardware.

Check out the documentation!

What can I do with Vessim?

Vessim helps you to understand and optimize how your (distributed) computing system interacts with (distributed) renewable energy sources and battery storage.

  • Carbon-aware applications: Develop applications that automatically reduce their energy consumption when the grid is powered by fossil fuels, and increase activity when renewable energy is abundant.
  • Energy system composition: Experiment with adding solar panels, wind turbines, or batteries to see how they would affect your energy costs and carbon emissions.
  • Plan for outages and extreme events: Simulate power outages or renewable energy fluctuations to understand risks and test backup strategies.
  • Quality assurance: Apply Vessim in continuous integrating testing to validate software roll-outs in a controlled environment.

Vessim can run simulations faster than real-time, includes historical datasets for realistic scenarios, and can simulate multiple microgrids in parallel. You can test scenarios using historical data or connect real applications and hardware to simulated energy systems.

Example

The scenario below simulates a microgrid consisting of a simulated computing system (drawing 700W), a solar power plant (modelled based on a dataset provided by Solcast), and a battery. The CsvLogger periodically stores the energy system state in a CSV file.

import vessim as vs

environment = vs.Environment(sim_start="2022-06-15", step_size=300)  # 5 minute step size

microgrid = environment.add_microgrid(
    name="datacenter",
    coords=(52.5200, 13.4050),
    actors=[
        vs.Actor(name="server", signal=vs.StaticSignal(value=-700)),  # negative = consumes power
        vs.Actor(name="solar_panel", signal=vs.Trace.load("solcast2022_global", column="Berlin", params={"scale": 5000}), tag="solar", coords=(52.5190, 13.4040)),  # 5kW maximum
    ],
    storage=vs.SimpleBattery(capacity=100),
)

# Write results to CSV
environment.add_controller(vs.CsvLogger("./results.csv"))

environment.run(until=24 * 3600)  # 24h simulated time

Visualization with Grafana

The Monitor streams simulation data in real-time directly to InfluxDB, which can then be visualized in Grafana. Actors are grouped by tags (e.g., solar, compute) for organized monitoring. We provide an example dashboard that displays microgrid metrics per datacenter and includes a geographical map view for analyzing multiple distributed sites.

Setup instructions:

  1. Start InfluxDB and Grafana using docker-compose:

    docker-compose up -d

    Default credentials for both services: username admin, password admin123

  2. Configure InfluxDB:

    • Open InfluxDB UI at http://localhost:8086 and login
    • Navigate to API Tokens and generate an All Access API Token
    • Copy the generated token
  3. Create .env file in your project directory:

    INFLUX_TOKEN=<your-generated-token>
    
  4. Restart services to apply the token:

    docker-compose down
    docker-compose up -d
  5. Open Grafana at http://localhost:3001, login, and select the example dashboard to visualize your microgrids by datacenter and location

Check out the tutorials and examples/!

Installation

You can install the latest release of Vessim via pip:

pip install vessim

If you require software-in-the-loop (SiL) capabilities, you should additionally install the sil extension:

pip install vessim[sil]

Datasets

Vessim comes with ready-to-user datasets for solar irradiance and average carbon intensity provided by

and

We're working on documentation on how to include custom datasets for your simulations.

Publications

If you use Vessim in your research, please cite our paper:

For details in Vessim's software-in-the-loop simulation methodology, refer to:

For all related papers, please refer to the documentation.

About

A co-simulation testbed for carbon-aware computing systems 🍃

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%