2 min read
Batch Analysis
The gat batch command enables running power flow and OPF analysis across multiple scenarios in parallel, following the CANOS (Coordinated Automatic Network Operating System) framework for reliability studies.
Overview
| Command | Purpose |
|---|---|
batch pf | Run DC/AC power flow for every scenario |
batch opf | Run DC/AC OPF for every scenario |
Batch analysis is essential for:
- Reliability studies — Monte Carlo simulation across outage scenarios
- Sensitivity analysis — Varying load, generation, or topology
- Training data generation — Creating datasets for ML models
Power Flow Batch
gat batch pf
Run power flow for every scenario defined in a manifest:
Arguments:
<GRID_FILE>— Base grid topology (Arrow format)--scenarios— Scenario manifest (YAML or JSON)--method— Power flow method:dcorac--out— Output directory
Scenario Manifest Format:
# scenarios.yaml
scenarios:
- id: base_case
description: "Normal operating conditions"
- id: high_load
description: "Summer peak"
load_scale: 1.2
- id: gen_outage_1
description: "Generator G1 offline"
offline_generators:
- id: line_outage_5_7
description: "Line 5-7 outage"
offline_branches:
Output Structure:
batch_results/
├── base_case/
│ └── flows.parquet
├── high_load/
│ └── flows.parquet
├── gen_outage_1/
│ └── flows.parquet
└── summary.parquet
OPF Batch
gat batch opf
Run optimal power flow for every scenario with reliability statistics:
Additional Output:
- Generator dispatch per scenario
- LMPs (Locational Marginal Prices)
- Binding constraints
- Objective value (total cost)
CANOS Framework
GAT's batch analysis follows the CANOS framework for coordinated network analysis:
- Scenario Definition — Define operating conditions, outages, load variations
- Fan-Out — Distribute analysis across scenarios (parallelized)
- Aggregation — Collect results and compute statistics
- Reliability Metrics — Derive LOLE, EUE, and other indices
Reference: CANOS Framework
Example: N-1 Contingency Analysis
# Generate N-1 scenarios
# Run batch power flow
# Analyze results
Example: Monte Carlo Reliability
# Generate random outage scenarios
# Run batch OPF
# Compute reliability metrics
Performance
Batch analysis leverages Rayon for parallel execution:
| Grid Size | Scenarios | DC PF Time | AC PF Time |
|---|---|---|---|
| 118 buses | 100 | ~2s | ~10s |
| 118 buses | 1000 | ~15s | ~90s |
| 2000 buses | 100 | ~10s | ~60s |
Times on 16-core system. Actual performance varies by hardware.
Integration with ML Pipelines
Batch results feed into ML feature extraction:
# 1. Run batch analysis
# 2. Extract GNN features
# 3. Train model
Related Commands
- Power Flow — Single power flow analysis
- OPF — Single OPF analysis
- Reliability — Reliability metrics
- ML Features — Feature extraction