Run real MPC control experiments from our paper on actual OpenCEM microgrid data. Compare how natural language context features improve battery management over classical approaches.
Run the full InstructMPC algorithm in your browser on 24 hours of real microgrid data. Compare how natural language context features improve battery management. Read the documentation below ↓
The OpenCEM platform is built around a real microgrid installation at CUHK-Shenzhen. The system consists of two rooftop PV arrays (26 panels each), two hybrid inverters with lithium-ion battery packs, and dynamic loads including research workstations (GPU/CPU) and an HVAC unit. Every two minutes, the inverters report electrical measurements — voltage, current, power, battery state of charge (SOC) — via Modbus protocol.
What makes OpenCEM unique is its native support for contextual information. Alongside the numerical time series, the dataset includes time-stamped natural language descriptions of real-world events: user announcements ("Scheduling 24h CPU-intensive robustness test for tomorrow"), system logs ("cd .../geometry/test/robustness; b2 cxxflags='-O2'"), hardware configurations, and maintenance alerts. These context records are synchronized with the electrical measurements, creating the first open-source dataset that pairs physical energy dynamics with rich, unstructured textual context.
Traditional energy management relies on numerical time-series forecasting: historical load patterns, weather data, and statistical models. But in practice, the true behavior of an energy system is often dictated by real-world events that are not captured in sensor readings. A simple statement like "Tomorrow I will run a CPU-intensive, multi-core numeric robustness test for a day" contains more predictive power about future energy load than hours of historical data alone.
A user announces a GPU stress test. Without context, the controller reacts too late and buys expensive grid power. With InstructMPC, an LLM reads the announcement, predicts high load, and the controller pre-charges the battery overnight.
Such contextual information — found in event calendars, maintenance logs, user announcements, and system logs — exists in unstructured, multi-modal formats. This presents the fundamental challenge that OpenCEM addresses: modeling and simulating the impact of rich, qualitative context on the quantitative dynamics of a renewable energy system.
The inverter in the OpenCEM microgrid manages power flow between three sources: PV generation, the battery, and the grid. Its default strategy follows a simple priority stack — (1) allocate PV power first, (2) use battery storage to buffer surplus or deficit, (3) import from the grid as a last resort. While this works, it is purely reactive: it cannot anticipate future demand.
A smarter approach uses Model Predictive Control (MPC). At each time step, the controller looks ahead over a planning horizon and decides how much to charge or discharge the battery (the control action ) to keep the battery SOC close to a target level ( measures the deviation from this target), while accounting for the net power demand from the loads (). The battery state evolves as , where captures battery self-dynamics (energy retention between time steps, close to 1 for a lithium-ion battery) and converts the control command into actual energy stored or released. The controller balances two competing goals: keeping the battery near its target SOC and avoiding aggressive charge/discharge actions. It re-plans at every step, applying only the immediate action before re-optimizing — a receding-horizon strategy that adapts as new information arrives.
The quality of this controller depends entirely on how well it can predict — the future power demand from the workstations, HVAC, and other loads. As illustrated in the figure above, if the controller reads that a GPU stress test is scheduled for tomorrow, it can pre-charge the battery overnight using cheap off-peak grid power, then serve the spike from battery storage instead of expensive peak-hour grid imports. This is where context becomes critical.
InstructMPC (Wu, Ai & Li, IEEE CDC 2025) closes the loop between unstructured context and optimal control. The key idea is a three-stage pipeline grounded in the OpenCEM testbed:
The OpenCEM simulator generates unstructured context — user plans, workstation logs, system alerts. A large language model (e.g., GPT-5.2) reads these descriptions and extracts numerical effort scores: how computationally intensive does each workload sound? For example, "running a 48h multi-core numeric robustness test" receives a high effort score, while "idle, no jobs scheduled" receives a low one. These scores become features for the prediction model.
Future power demand is predicted as , where is a feature matrix built from context data (effort scores, CPU counts, file counts, etc.) and is a parameter vector learned online. The controller updates at each time step using a policy-gradient-style rule — it observes the actual prediction error after a delay of steps and adjusts parameters to reduce future errors.
Given the predicted load profile, the MPC controller solves a finite-horizon optimal control problem at each step, computing the best charge/discharge action for the battery. It then applies only the first action, observes the new state, and re-plans — a receding-horizon strategy that naturally adapts as new context arrives and predictions improve.
This demo runs the full InstructMPC algorithm in your browser on 24 hours of real microgrid data from the OpenCEM dataset. You can compare six prediction strategies, from an oracle upper bound to naive baselines:
Lower cumulative cost = better control. The results demonstrate that natural language context (InstructMPC) closely tracks the oracle, while context-free methods accumulate significantly higher cost — validating the core thesis that unstructured textual context carries strong predictive signal for energy management.
For full theoretical details, convergence guarantees, and multi-day experiments, see: