Bridging Natural Language
and Microgrid Dynamics

OpenCEMOpen 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.

Aerial view of rooftop PV installation PV Arrays — Rooftop Installation
Campus building with PV panels and Shenzhen skyline On-Campus Microgrid — CUHK-Shenzhen
System Architecture

How OpenCEM Works

A two-layer digital twin bridging physical microgrid hardware with intelligent, context-aware software. Click any component to learn more.

Physical Layer
PV Array 1
26 panels · 480 W
Live
PV Array 2
26 panels · 480 W
Live
Inverter 1
8 kW · Workstation
Inverter 2
8 kW · HVAC
85%
Battery 1
200 Ah · 51.2 V
62%
Battery 2
200 Ah · 51.2 V
GPU/CPU
Grid
HVAC
RS485
Modbus
V, I, P SOC Control
💻 Cyber Layer
SQLite Database
1M+ measurements · 15k contexts
Simulator Engine
PV Battery Grid Load
Inverter Context Clock
NL Contexts
"GPU stress test today"
"Holiday — building empty"
"AC maintenance scheduled"
"Server reboot at 14:00"
LLM-Powered Control
Forecasting · MPC · Scheduling
6+
Months of Real Data
2
PV Arrays + Batteries
~15,000
Context Records
~15 s
Measurement Interval
Platform Capabilities

Everything You Need for Context-Aware Energy Research

A comprehensive ecosystem of data, simulation tools, and APIs designed for researchers working on intelligent, context-aware energy management.

📊

Real-World Dataset

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 →

Modular Simulator

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 →
🤖

Context-Aware Control

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 →
🚀

Live Dashboard

Interactive visualizations of microgrid data including real-time power flows, battery state-of-charge, PV generation curves, and contextual event timelines.

Open Dashboard →
🔌

Python API

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 →
🎓

Jupyter Notebooks

Ready-to-run notebooks demonstrating dataset exploration, model validation, context-aware prediction, and battery management control strategies.

Browse Notebooks →
Why OpenCEM?

Built for the Next Generation of Energy Research

OpenCEM brings together capabilities that researchers need in a single, cohesive open-source platform.

🌐

Full-Stack Coverage

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.

PVBatteryInverterGridLoadContext
🤖

Native NL Context

The first open-source platform to natively integrate natural language context — event schedules, system logs, user announcements — directly into the simulation and control loop.

LLM-Ready~15,000 RecordsUnstructured Data
📊

Real-World Grounding

Every model is validated against 6+ months of real campus microgrid data at ~15-second resolution, bridging the gap between simulation and physical deployment.

6+ Months~15 s IntervalCUHK-Shenzhen
🔌

Modular & Extensible

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.

Python APIPluggable ModelsOpen Source
Quick Start

Get Running in Minutes

Install the simulator and start exploring the dataset with just a few commands.

Terminal
# 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/
Python
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")
Publications

Research Papers

Featured Paper

Bridging Natural Language and Microgrid Dynamics: A Context-Aware Simulator and Dataset

T. S. Bartels, R. Wu, X. Lu, Y. Lu, F. Xia, H. Yang, Y. Chen, and T. Li
Preprint, 2026

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.

📄

InstructMPC: A Human-LLM-in-the-Loop Framework for Context-Aware Control

R. Wu, J. Ai, and T. Li
IEEE CDC 2025

Ready to Build Context-Aware Energy Systems?

Read the paper, download the dataset, or run your first simulation today.

📄 Read the Paper View on GitHub API Docs Contact Us