← 返回 Skills 市场
wu-uk

dc-power-flow

作者 wu-uk · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
76
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install energy-market-pricing-dc-power-flow
功能描述
DC power flow analysis for power systems. Use when computing power flows using DC approximation, building susceptance matrices, calculating line flows and lo...
使用说明 (SKILL.md)

DC Power Flow

DC power flow is a linearized approximation of AC power flow, suitable for economic dispatch and contingency analysis.

DC Approximations

  1. Lossless lines - Ignore resistance (R ≈ 0)
  2. Flat voltage - All bus voltages = 1.0 pu
  3. Small angles - sin(θ) ≈ θ, cos(θ) ≈ 1

Result: Power flow depends only on bus angles (θ) and line reactances (X).

Bus Number Mapping

Power system bus numbers may not be contiguous (e.g., case300 has non-sequential bus IDs). Always create a mapping from bus numbers to 0-indexed array positions:

# Create mapping: bus_number -> 0-indexed position
bus_num_to_idx = {int(buses[i, 0]): i for i in range(n_bus)}

# Use mapping for branch endpoints
f = bus_num_to_idx[int(br[0])]  # NOT br[0] - 1
t = bus_num_to_idx[int(br[1])]

Susceptance Matrix (B)

Build from branch reactances using bus number mapping:

# Run: scripts/build_b_matrix.py
# Or inline:
bus_num_to_idx = {int(buses[i, 0]): i for i in range(n_bus)}
B = np.zeros((n_bus, n_bus))

for br in branches:
    f = bus_num_to_idx[int(br[0])]  # Map bus number to index
    t = bus_num_to_idx[int(br[1])]
    x = br[3]  # Reactance
    if x != 0:
        b = 1.0 / x
        B[f, f] += b
        B[t, t] += b
        B[f, t] -= b
        B[t, f] -= b

Power Balance Equation

At each bus: Pg - Pd = B[i, :] @ θ

Where:

  • Pg = generation at bus (pu)
  • Pd = load at bus (pu)
  • θ = vector of bus angles (radians)

Slack Bus

One bus must have θ = 0 as reference. Find slack bus (type=3):

slack_idx = None
for i in range(n_bus):
    if buses[i, 1] == 3:
        slack_idx = i
        break
constraints.append(theta[slack_idx] == 0)

Line Flow Calculation

Flow on branch from bus f to bus t (use bus number mapping):

f = bus_num_to_idx[int(br[0])]
t = bus_num_to_idx[int(br[1])]
b = 1.0 / br[3]  # Susceptance = 1/X
flow_pu = b * (theta[f] - theta[t])
flow_MW = flow_pu * baseMVA

Line Loading Percentage

loading_pct = abs(flow_MW) / rating_MW * 100

Where rating_MW = branch[5] (RATE_A column).

Branch Susceptances for Constraints

Store susceptances when building constraints:

branch_susceptances = []
for br in branches:
    x = br[3]
    b = 1.0 / x if x != 0 else 0
    branch_susceptances.append(b)

Line Flow Limits (for OPF)

Enforce thermal limits as linear constraints:

# |flow| \x3C= rating  →  -rating \x3C= flow \x3C= rating
flow = b * (theta[f] - theta[t]) * baseMVA
constraints.append(flow \x3C= rate)
constraints.append(flow >= -rate)
安全使用建议
This skill appears to do exactly what it says: compute susceptance matrices and DC line flows using a local JSON network file. Before using, inspect or run the included scripts in a safe environment and only provide trusted network JSON files (the script reads a local file given on the command line). No network calls or secret access are present, but standard runtime checks apply — validate input data (nonzero reactances, sensible RATE_A values) to avoid runtime errors or misleading results.
能力评估
Purpose & Capability
Name/description (DC power flow, susceptance matrices, line flows) match the included SKILL.md and the single Python helper. The requested resources (none) are proportionate to the stated functionality.
Instruction Scope
SKILL.md provides domain-specific formulas, code snippets, and a single runtime step (run scripts/build_b_matrix.py). It only references local data structures and a local JSON input file; it does not instruct the agent to read unrelated files, call external endpoints, or access secrets.
Install Mechanism
No install spec; the skill is instruction-only with a small local Python script. Nothing is downloaded or written to disk by an installer step.
Credentials
No environment variables, credentials, or config paths are required. The code reads a local JSON network file passed as an argument, which is appropriate for the task.
Persistence & Privilege
always is false and the skill is user-invocable. There is no indication the skill modifies system or other-skill settings or requests permanent presence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install energy-market-pricing-dc-power-flow
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /energy-market-pricing-dc-power-flow 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Bulk publish from all-task-skills-dedup
元数据
Slug energy-market-pricing-dc-power-flow
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

dc-power-flow 是什么?

DC power flow analysis for power systems. Use when computing power flows using DC approximation, building susceptance matrices, calculating line flows and lo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 76 次。

如何安装 dc-power-flow?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install energy-market-pricing-dc-power-flow」即可一键安装,无需额外配置。

dc-power-flow 是免费的吗?

是的,dc-power-flow 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

dc-power-flow 支持哪些平台?

dc-power-flow 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 dc-power-flow?

由 wu-uk(@wu-uk)开发并维护,当前版本 v0.1.0。

💬 留言讨论