科研 Skill

PyPSA能源系统建模优化

pypsa

Runs PyPSA studies: building a network, running power flow or operational OPF, and capacity-expansion optimization. Use to optimize dispatch or size storage/investment.

发布者 Codar安全审核通过v0.1.0更新于 2026-11-18

SKILL.md

PyPSA workflow

Start by creating or loading a named network handle. Use network inspection before optimization, and use operational optimization before investment optimization.

Default tool ladder

  1. load_network(file_path) or create_network(...) to create the active network handle.
  2. get_network_info(network_name) and get_component_details(...) to understand topology, assets, and time series.
  3. run_power_flow(network_name, linear=False) for feasibility checks.
  4. optimize_network(network_name, ...) for dispatch or operational studies.
  5. optimize_investment(network_name, ...) for expansion questions.
  6. import_from_csv_folder(...) or export_to_csv_folder(...) once the network state is worth moving.

Example sequence

Using the case39.nc network shipped with this skill:

load_network("case39.nc")                        -> network "case39" active, 39 buses
get_network_info("case39")                       -> 10 generators, 46 branches, 19 loads
run_power_flow("case39", linear=False)           -> converged, max branch loading 87%
optimize_network("case39", solver_name="highs")  -> feasible dispatch, hourly cost reported

Feasibility first, then dispatch. Only move to optimize_investment once a dispatch study cannot answer the question.

Working rules

  • Do not jump straight into expansion optimization when a dispatch study can answer the question.
  • Use AC or DC power flow to sanity-check a network before relying on optimization outputs.
  • Treat PyPSA as a planning and scheduling engine, not the final authority on detailed reactive mitigation.

Escalation triggers

Quote the numbers that tripped each row (bus + v_mag_pu, element + loading, infeasibility cause) rather than saying "it failed".

ObservationEscalate to
Bus v_mag_pu < 0.95 or > 1.05 on an AC power flowvoltage-violation-mitigation
Line or transformer loaded > 100% of s_nomthermal-overload-mitigation
run_contingency_analysis N-1 overload or post-outage islandingcontingency-mitigation
optimize_network / optimize_investment infeasible, reserve-short, or heavily curtailedoperations-planning-mitigation
run_power_flow fails to convergeconvergence-failure-mitigation

Local assets in this skill

  • case39.nc — a ready test network.
  • scripts/network_analysis.py — inspection.
  • scripts/optimization_analysis.py — OPF result review.
  • scripts/expansion_analysis.py — capacity-expansion studies.
  • scripts/contingency_analysis.py — local N-1 screening outside PowerMCP.

Deliver

  • The network handle and study type.
  • The main feasibility or cost result.
  • Whether the next step is mitigation, AC validation, or a larger optimization.

示例提示词

帮我用PyPSA搭一个网络,优化一下储能的容量配置。

所属插件

电子电气与信息工程面向电气与电子工程研究:电力系统仿真(PSS/E、PSLF、PowerWorld、pandapower、PyPSA、OpenDSS、ANDES)与越限/稳定/短路处置,FPGA 时序收敛与跨时钟域检查,电路与 PCB 设计评审,硬件产品开发流程。

安装该插件会一并获得同领域的 63 个 Skill / MCP。

同插件的其他科研 Skill

常见问题

PyPSA能源系统建模优化能做什么?

Runs PyPSA studies: building a network, running power flow or operational OPF, and capacity-expansion optimization. Use to optimize dispatch or size storage/investment。

如何安装PyPSA能源系统建模优化?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「PyPSA能源系统建模优化」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

PyPSA能源系统建模优化需要哪些权限?

该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。

PyPSA能源系统建模优化经过官方审核吗?

是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。