OpenCEM — Open In-Context Energy Management
We introduce the OpenCEM Simulator and Dataset: the first open-source digital twin that integrates rich, unstructured natural language context with quantitative renewable energy dynamics. Grounded in a real-world campus microgrid with 6+ months of synchronized measurements and ~15,000 context records.
PV Arrays — Rooftop Installation
On-Campus Microgrid — CUHK-Shenzhen
A two-layer digital twin bridging physical microgrid hardware with intelligent, context-aware software. Click any component to learn more.
A comprehensive ecosystem of data, simulation tools, and APIs designed for researchers working on intelligent, context-aware energy management.
High-fidelity time series from an on-campus PV-and-battery microgrid, including electrical measurements (voltage, current, power, SOC) at ~15-second intervals alongside rich natural language context records.
Explore Dataset →A component-based digital twin with PV, Battery, Grid, Inverter, Load, and Context modules. Extensible architecture lets you plug in your own models and control algorithms.
View API Docs →The only open-source simulator that natively processes natural language context — event schedules, system logs, user announcements — to enable LLM-powered energy management.
Read Papers →Interactive visualizations of microgrid data including real-time power flows, battery state-of-charge, PV generation curves, and contextual event timelines.
Open Dashboard →A clean Python package backed by SQLite for programmatic access to the dataset and simulator. Load measurements, run simulations, and integrate with your ML pipelines.
API Documentation →Ready-to-run notebooks demonstrating dataset exploration, model validation, context-aware prediction, and battery management control strategies.
Browse Notebooks →OpenCEM brings together capabilities that researchers need in a single, cohesive open-source platform.
A unified simulator spanning all six core microgrid components — PV, Battery, Inverter, Grid, Load, and Context — so you never need to stitch together separate tools.
The first open-source platform to natively integrate natural language context — event schedules, system logs, user announcements — directly into the simulation and control loop.
Every model is validated against 6+ months of real campus microgrid data at ~15-second resolution, bridging the gap between simulation and physical deployment.
Plug-and-play component architecture with a clean Python API. Swap in your own PV model, battery chemistry, or control strategy without rewriting the framework.
Install the simulator and start exploring the dataset with just a few commands.
# Clone the repository
git clone https://github.com/OpenCEM-platform/opencem_simulator.git
cd opencem_simulator
# Install dependencies
pip install -e .
# Open the example notebook
jupyter notebook notebooks/from opencem.simulator import Simulator
from opencem.dataset import *
from opencem.clock import Clock
import sqlite3
# Connect to the SQLite dataset
conn = sqlite3.connect("opencem_dataset.db")
clock = Clock.from_string("2025-12-26")
# Create dataset-backed components (replay real data)
pv = PowerSourceDataset(clock, inverter_id=1, database=conn)
batt = BatteryDataset(clock, inverter_id=1, database=conn)
load = LoadDataset(clock, inverter_id=1, database=conn)
grid = GridDataset(clock, inverter_id=1, database=conn)
inv = InverterDataset(clock, inverter_id=1, database=conn)
# Build and run the simulator
sim = Simulator(pv, batt, load, grid, inv, clock)
result = sim.step(step_ticks=10**9 * 15) # 15-second step
print(f"Battery SOC: {result.battery.soc:.2%}")
print(f"PV Power: {result.power_source.power_w:.0f} W")The first open-source digital twin that natively integrates unstructured natural language context with quantitative renewable energy dynamics. Includes a real-world microgrid dataset and modular simulator for context-aware control and LLM-powered energy management.
Read the paper, download the dataset, or run your first simulation today.