Engineering
ac-branch-pi-model avatar

ac-branch-pi-model

Compute AC branch pi-model power flow equations including transformer tap ratios and phase shifts, compatible with MATPOWER data structures.

Introduction

This skill provides a standardized implementation of the AC branch pi-model for power system analysis, specifically designed to handle transformer tap ratios and phase shifts. It is intended for power engineers and researchers working with grid simulation, nodal power balance calculations, and steady-state AC optimal power flow (ACOPF) modeling. The logic aligns with industry-standard MATPOWER branch fields, enabling seamless integration with existing network datasets. Users can determine real (P) and reactive (Q) power flows in both directions, aggregate bus injections, and calculate apparent power (|S|) for system monitoring and compliance tasks.

  • Computes P and Q flows using the exact branch pi-model equations with precise transformer modeling.

  • Supports tap-ratio adjustment and phase-shift angle correction for transformer branches.

  • Enforces MVA rateA limit constraints and calculates branch loading percentages for contingency analysis.

  • Handles per-unit (pu) conversion, line charging susceptance (bc/2), and complex series admittance (g + jb) calculations.

  • Facilitates nodal power balance verification by aggregating injections from branch flows.

  • Provides robust logic to manage lossless cases and prevent divide-by-zero errors in ideal transformers.

  • Expects standard bus and branch arrays formatted according to MATPOWER conventions.

  • Requires initial voltage magnitude (Vm) and angle (Va) vectors as inputs.

  • Ensure baseMVA is correctly applied to scale results between per-unit and MVA systems.

  • Useful for debugging unit or sign discrepancies in power flow models.

  • Recommended for validating simulation outputs in AC power grid optimization projects.

Repository Stats

Stars
1,095
Forks
273
Open Issues
41
Language
PDDL
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 07:57 AM
View on GitHub