Originally forked from jdhoffa/vpp-sim, now an independent project with a different architecture and direction.
A neighborhood-scale Virtual Power Plant simulator written in Rust. Models a local distribution feeder with solar PV, battery storage, EV charging, and demand response — letting you test control strategies and load-shifting decisions before committing capital.
Modular crate layout with feature-gated optional modules:
src/
config.rs TOML scenario config and preset loading
forecast.rs Load and generation forecasting
devices/ Solar PV (simple + AR(1) cloud model), battery, EV charger, baseload
sim/ Engine, controller trait, feeder limits, scheduling, KPI, imbalance settlement
io/ CSV telemetry export
api/ REST API via Axum (feature: api)
tui/ Live terminal dashboard via Ratatui (feature: tui)
Key design choices:
- Feature gates —
apiandtuiare optional Cargo features, keeping the core sim dependency-free of network/UI crates lib.rsseparation — simulation logic is a library;main.rsis a thin CLI driver- Rust edition 2024
- GreedyController with forecast-aware battery dispatch (charge during excess solar, discharge into evening peak)
- Stochastic weather via AR(1) cloud variability on solar generation
- Imbalance settlement costing — tracks deviation from scheduled dispatch
- Demand response events with configurable curtailment windows
- Feeder capacity constraints (import/export limits)
- KPI reporting — RMSE tracking error, curtailment %, feeder peak
- Rust (stable)
cargo run --releasecargo run --release -- --preset high_solar
cargo run --release -- --preset dr_stresscargo run --release --features apicargo run --release --features tuicargo run --release -- --config path/to/scenario.tomlSee scenarios/ for example TOML files (default.toml, high_solar.toml, dr_stress.toml).
cargo doc --openMIT. See LICENSE.