/powergridmodel:powergridmodelfrom powergridmodel
Provides context and usage patterns for the power-grid-model Python library for steady-state distribution power system analysis including power flow, state estimation, and short-circuit calculations.
Ships in powergridmodel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
power-grid-model is a high-performance C++ library with a Python interface for steady-state distribution power system analysis. It operates on numpy structured arrays via a dictionary-based data model and supports symmetric (single-phase equivalent) and asymmetric (full three-phase) calculations.
Version: v1.13.193 Language: Python (C++ core) License: Mozilla Public License 2.0 (MPL-2.0) Repo: https://github.com/PowerGridModel/power-grid-model
from power_grid_model import PowerGridModel, LoadGenType, initialize_array
# Build component arrays
node = initialize_array('input', 'node', 2)
node['id'] = [1, 2]; node['u_rated'] = [10.5e3, 10.5e3]
line = initialize_array('input', 'line', 1)
line['id'] = [3]; line['from_node'] = [1]; line['to_node'] = [2]
line['from_status'] = [1]; line['to_status'] = [1]
line['r1'] = [0.25]; line['x1'] = [0.2]; line['c1'] = [10e-6]; line['tan1'] = [0.0]
sym_load = initialize_array('input', 'sym_load', 1)
sym_load['id'] = [4]; sym_load['node'] = [2]; sym_load['status'] = [1]
sym_load['type'] = [LoadGenType.const_power]
sym_load['p_specified'] = [2e6]; sym_load['q_specified'] = [0.5e6]
source = initialize_array('input', 'source', 1)
source['id'] = [5]; source['node'] = [1]; source['status'] = [1]; source['u_ref'] = [1.0]
input_data = {'node': node, 'line': line, 'sym_load': sym_load, 'source': source}
model = PowerGridModel(input_data, system_frequency=50.0)
result = model.calculate_power_flow()
# result['node'] contains: id, energized, u_pu, u_angle, u, p, q
dict[str, np.ndarray] — structured arrays created via initialize_array(data_type, component_type, shape). Dataset types: input, update, sym_output, asym_output, sc_output.symmetric=True (default) solves a balanced single-phase equivalent; symmetric=False solves the full three-phase abc system and requires zero-sequence parameters.update_data (2-D dense array or sparse CSR dict) to run many scenarios in one call. Pass list[BatchDataset] for Cartesian product dimensions (time-series x contingency).initialize_array; do not leave required fields as NaN.| Domain | File | Description |
|---|---|---|
| Core API | api-core.md | PowerGridModel, calculate_power_flow, calculate_state_estimation, calculate_short_circuit, initialize_array, serialization, Logger |
| Components | api-components.md | All component types (22 types including voltage_regulator), attributes, numpy dtypes, enumerations |
| Validation | api-validation.md | validate_input_data, validate_batch_data, ValidationError, ValidationException |
| Batch | api-batch.md | Dense/sparse batch format, Cartesian product, threading, error handling, output structure |
| Workflows | workflows.md | Complete working examples for all calculation types |
assert_valid_input_data or validate_input_data from power_grid_model.validation.n_measurements >= 2*n_nodes - 1. Missing sensors cause NotObservableError at runtime.generic_branch.k is the off-nominal ratio, not the voltage ratio — must be set explicitly for tap changers; the library does not compute it from node voltages.threading=0 for large batches to use all hardware cores.r0, x0, c0, etc.) for lines and appropriate winding configurations for transformers. generic_branch does not support asymmetric mode.sk, rx_ratio, z01_ratio are now updatable in batch calculations (since v1.13.54). This enables batch sweeps over source impedance parameters.MeasuredTerminalType.node (value 9, "node injection" power-sensor terminal type) emits a DeprecationWarning and will be removed in a future release. It does not represent a physical terminal; use one of the appliance/branch terminal types instead.power_grid_model.__version__ (a string, derived from PGM_version). Use it for runtime version checks instead of relying on package metadata.InvalidBranch and InvalidBranch3 are deprecated and emit a DeprecationWarning on construction; they may be removed in a future release. Branches/lines whose from_node == to_node (a branch "into itself") are now handled by the solver core, so these errors are no longer raised by it.from_node == to_node is now valid input for line, link, transformer, generic_branch, and asym_line — the Python validator no longer raises SameValueError for it. three_winding_transformer (branch3) still requires node_1/node_2/node_3 to be pairwise distinct.asym_line matrix constraints relaxed (since v1.13.107): off-diagonal/mutual impedance and capacitance matrix entries now only require >= 0 (previously strictly > 0), so decoupled/far-apart conductors can be modeled with zero mutual terms. Diagonal/self terms are still strictly > 0.links are ideal connections (linked nodes merged into topological nodes; link flows reconstructed afterwards) instead of a fixed 1e6 p.u. admittance — results on linked nodes may shift slightly vs. older versions. With node-injection sensors the old fixed admittance is kept.q_min/q_max now clamp Q and switch the node PV→PQ; voltage_regulator output limit_violated is 0 none / 1 q_min / 2 q_max. Breaking: the regulated load/gen must be LoadGenType.const_power (else UnsupportedLoadGenTypeForVoltageRegulator); validator also checks q_max >= q_min.calculate_power_flow(calculation_initialization=...) with CalculationInitialization default(0, = linear for NR) / flat(1) / linear(2) / average_source(3). Try flat when NR diverges on meshed grids with remote generation.with Logger(LoggerType.info, python_logger=None, python_logging_level=logging.INFO) as log: (or LoggerType.benchmark) captures debug text / per-phase timings into log.output; opt-in, zero cost when unused.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub datathings/marketplace --plugin powergridmodelOther plugins' skills for the same job