Ac Branch Pi Model
AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.
Install
npx skills add UCSB-NLP-Chang/Skill-Usage --skill ac-branch-pi-modelgit clone --depth 1 https://github.com/UCSB-NLP-Chang/Skill-Usage.git /tmp/Skill-Usage
mkdir -p ~/.claude/skills
cp -r /tmp/Skill-Usage/tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model ~/.claude/skills/ac-branch-pi-modelPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# AC Branch Pi-Model + Transformer Handling
Implement the exact branch power flow equations in `acopf-math-model.md` using MATPOWER branch data:
```
[F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, TAP, SHIFT, BR_STATUS, ANGMIN, ANGMAX]
```
## Quick start
- Use `scripts/branch_flows.py` to compute per-unit branch flows.
- Treat the results as **power leaving** the “from” bus and **power leaving** the “to” bus (i.e., compute both directions explicitly).
Example:
```python
import json
import numpy as np
from scripts.branch_flows import compute_branch_flows_pu, build_bus_id_to_idx
data = json.load(open("/root/network.json"))
baseMVA = float(data["baseMVA"])
buses = np.array(data["bus"], dtype=float)
branches = np.array(data["branch"], dtype=float)
bus_id_to_idx = build_bus_id_to_idx(buses)
Vm = buses[:, 7] # initial guess VM
Va = np.deg2rad(buses[:, 8]) # initial guess VA
br = branches[0]
P_ij, Q_ij, P_ji, Q_ji = compute_branch_flows_pu(Vm, Va, br, bus_id_to_idx)
S_ij_MVA = (P_ij**2 + Q_ij**2) ** 0.5 * baseMVA
S_ji_MVA = (P_ji**2 + Q_ji**2) ** 0.5 * baseMVA
print(S_ij_MVA, S_ji_MVA)
```
## Model details (match the task formulation)
### Per-unit conventions
- Work in per-unit internally.
- Convert with `baseMVA`:
- \(P_{pu} = P_{MW} / baseMVA\)
- \(Q_{pu} = Q_{MVAr} / baseMVA\)
- \(|S|_{MVA} = |S|_{pu} \cdot baseMVA\)
### Transformer handling (MATPOWER TAP + SHIFT)
- Use \(T_{ij} = tap \cdot e^{j \cdot shift}\).Details
- Skill name
ac-branch-pi-model- Repository
- UCSB-NLP-Chang/Skill-Usage
- Path
tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model/SKILL.md- Repo updated
- 8 April 2026
FAQ
What does the Ac Branch Pi Model skill do?
AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.
How do I install the Ac Branch Pi Model skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add UCSB-NLP-Chang/Skill-Usage --skill ac-branch-pi-model. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Ac Branch Pi Model popular?
It lives in UCSB-NLP-Chang/Skill-Usage, which has 49 GitHub stars and 5 forks.
Related skills
Pubchem Database
49UCSB-NLP-Chang/Skill-Usage
Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.
Pymatgen
49UCSB-NLP-Chang/Skill-Usage
Materials science toolkit. Crystal structures (CIF, POSCAR), phase diagrams, band structure, DOS, Materials Project integration, format conversion, for computational materials science.
Rdkit
49UCSB-NLP-Chang/Skill-Usage
Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.
Analyze CI
49UCSB-NLP-Chang/Skill-Usage
Analyze failed GitHub Action jobs for a pull request.
Spawn
40ArogyaReddy/alirezarezvani-claude-skills
Launch N parallel subagents in isolated git worktrees to compete on the session task.
Dialogue Graph
49UCSB-NLP-Chang/Skill-Usage
A library for building, validating, visualizing, and serializing dialogue graphs. Use this when parsing scripts or creating branching narrative structures.
Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.