SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.03970 · 2021

PowerGym: A Reinforcement Learning Environment for Volt-Var Control in Power Distribution Systems

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2109.03970.json · badge: /api/ran/2109.03970.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
siemens/powergym canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
FunctionStatusWhere it lives
FFT_selection Ran
ran on a synthesized input
siemens/powergym/powergym/env.py
code served (permissive licence) · get_code("2139496bccc00e9c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small violated nodes list (bus names)
vio_nodes = ['bus_1', 'bus_2', 'bus_3', 'bus_4', 'bus_5']

# Create a distance matrix for the violated nodes
# 5x5 matrix of pairwise distances
dist_matrix = np.array([
    [0.0, 1.2, 2.5, 3.1, 4.2],
    [1.2, 0.0, 1.8, 2.3, 3.5],
    [2.5, 1.8, 0.0, 1.5, 2.7],
    [3.1, 2.3, 1.5, 0.0, 1.9],
    [4.2, 3.5, 2.7, 1.9, 0.0]
])

# Set k to select 3 batteries from the 5 violated nodes
k = 3

ARGS = {
    'vio_nodes': vio_nodes,
    'dist_matrix': dist_matrix,
    'k': k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
choose_batteries Ran
ran on a synthesized input
siemens/powergym/powergym/env.py
code served (permissive licence) · get_code("a524128b418e0a67")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import networkx as nx

class MockEnv:
    """Mock environment object with required attributes and methods."""
    def __init__(self):
        # Create a simple graph structure
        self.lines = {
            'line1': ('bus_a', 'bus_b'),
            'line2': ('bus_b', 'bus_c'),
            'line3': ('bus_c', 'bus_d'),
        }
        self.transformers = {
            'trafo1': ('bus_d', 'bus_e'),
        }
        
        # Bus voltages: dict with bus names as keys and list of voltages as values
        self.obs = {
            'bus_voltages': {
                'bus_a': [0.92, 0.93, 0.94],
                'bus_b': [0.96, 0.97, 0.98],
                'bus_c': [0.90, 0.91, 0.92],
                'bus_d': [0.99, 1.00, 0.99],
                'bus_e': [0.98, 0.97, 0.96],
            }
        }
        
        # Position dict for plotting
        self.pos = {
            'bus_a': (0, 0),
            'bus_b': (1, 0),
            'bus_c': (2, 0),
            'bus_d': (3, 0),
            'bus_e': (4, 0),
        }
    
    def plot_graph(self, show_voltages=False):
        """Mock plot_graph method that returns figure and positions."""
        return None, self.pos


# Create the mock environment
env = MockEnv()

# Define ARGS for choose_batteries function
ARGS = {
    'env': env,
    'k': 3,
    'on_plot': True,
    'node_bound': 'minimum',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_evaluate Ran
ran on a synthesized input
siemens/powergym/random_agent.py
code served (permissive licence) · get_code("71c62701f1c09071")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import random

class StandInEnv:
    def __init__(self):
        self.horizon = 10
        self.num_profiles = 5
        self._current_step = 0
    
    def reset(self, load_profile_idx):
        self._current_step = 0
        return np.array([1.0, 2.0, 3.0, 4.0])
    
    def random_action(self):
        return np.random.randint(0, 2)
    
    def step(self, action):
        self._current_step += 1
        next_obs = np.array([1.0, 2.0, 3.0, 4.0])
        reward = 1.0
        done = self._current_step >= self.horizon
        info = {}
        return next_obs, reward, done, info

random.seed(0)
np.random.seed(0)

env = StandInEnv()
profiles = [0, 1, 2, 3, 4]

ARGS = {
    "env": env,
    "profiles": profiles,
    "episodes": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We introduce PowerGym, an open-source reinforcement learning environment for Volt-Var control in power distribution systems. Following OpenAI Gym APIs, PowerGym targets minimizing power loss and voltage violations under physical networked constraints. PowerGym provides four distribution systems (13Bus, 34Bus, 123Bus, and 8500Node) based on IEEE benchmark systems and design variants for various control difficulties. To foster generalization, PowerGym offers a detailed customization guide for users working with their distribution systems. As a demonstration, we examine state-of-the-art reinforcement learning algorithms in PowerGym and validate the environment by studying controller behaviors. The repository is available at \url{https://github.com/siemens/powergym}.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2109.03970")
get_code_for_paper("2109.03970")
have("2109.03970")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2109.03970.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2109.03970.svg)](https://syntology.ai/paper/2109.03970)

Connect an agent — have() is free.