科研 Skill
pandapower最优潮流优化
potpourri
Runs AC/DC and multi-period optimal power flow on pandapower networks with storage and flexible resources, via bundled scripts. Use to optimize a feeder or diagnose infeasible OPF.
SKILL.md
potpourri workflow
potpourri builds Pyomo AC/DC OPF models over pandapower networks. There is no PowerMCP server for it, so drive it through its Python API using the bundled scripts. Establish a credible network and base case before optimising, and a credible single period before a multi-period horizon.
Default ladder
scripts/inspect_case.py --case <simbench:CODE|path.json>— load, validate, and solve the pandapower base case. Do not skip this: an OPF that fails later is usually a data problem, and this is where data problems are cheap to find.scripts/solve_opf.py --list-solvers— confirm what is installed. AC needs an NLP solver (IPOPT); DC needs an LP/MIP solver (GLPK, CBC, HiGHS).scripts/solve_opf.py --formulation dc --objective ext_grid_import— linear screening for congestion and active-power headroom.scripts/solve_opf.py --formulation ac --objective <objective>— the real answer whenever voltage, reactive power, losses, or inverter capability matters.scripts/solve_opf.py --horizon <N> --battery-penetration <pct> --seed <n>— multi-period, only once a single period is credible.
Both scripts print an engineering summary, take --json for a machine-readable
payload, and exit non-zero on genuine failure (1 = solved but not optimal,
2 = bad input, 3 = no compatible solver).
Working rules
- Never read
net.res_*without checking termination. The model constructor runspp.runpp, sonet.res_*is always populated; when a solve is not optimal potpourri skips its result mapping and those tables still hold the base case.solve_opf.pyreports no results at all in that situation. - Multi-period
solve(to_net=True)writes nothing. It only logs that it did. Map each step withpyo_to_net_multi_period.pyo_sol_to_net_res(net, model, t). - DC gives no voltage answer. After a DC OPF
net.res_bus.vm_puis a flat 1.0 placeholder. DC feasibility never establishes AC feasibility, least of all in distribution networks where voltage and reactive power are the binding physics. - A local NLP optimum is not a global one. IPOPT on a nonconvex AC OPF gives a locally optimal point; say "locally optimal", and never claim global optimality without a global solver reporting it.
- Quote numbers, units, and the limit that was configured — bus and
vm_pu, element andloading_percentagainst its rating, MW/Mvar/MWh, and the solver's own termination condition. - Match the objective to the question and state its side effects: voltage- deviation minimisation puts no value on energy, so where curtailment is free it will curtail everything. Check the reported curtailment before accepting a dispatch.
Reference material
Read the file that matches what you are doing; do not load them all.
references/API_REFERENCE.md— verified classes,add_OPFoptions, objectives, devices, result extraction, and what is not supported.references/FORMULATION_GUIDE.md— AC vs DC, snapshot vs multi-period, LP/NLP/MINLP consequences, and single- vs multi-period model differences.references/SOLVER_GUIDE.md— solver compatibility, termination interpretation, and the ordered infeasibility diagnosis.references/VALIDATION_GUIDE.md— power balance, constraint checks, binding constraints, cross-validation against pandapower, and the reporting checklist.
Local assets in this skill
scripts/inspect_case.py— load, validate, base power flow.scripts/solve_opf.py— build, solve, validate, and escalate.scripts/test_scripts.py— smoke tests; skips cleanly without solvers.requirements.txt— including thepandapower<3.5pin potpourri needs.
Escalation triggers
Quote the element, value, unit, and configured limit that tripped each row.
solve_opf.py emits these in its escalation payload.
| Observation | Escalate to |
|---|---|
Bus vm_pu outside the configured [min_vm_pu, max_vm_pu] band (AC only) | voltage-violation-mitigation |
res_line / res_trafo loading_percent above its configured max_loading_percent | thermal-overload-mitigation |
termination_condition is infeasible or unbounded, or curtailment exceeds 5 % of available renewable energy | operations-planning-mitigation |
Solve ends in any other non-optimal condition (other, maxIterations, maxTimeLimit), or the base pp.runpp fails | convergence-failure-mitigation |
| Net export through the external grid, or PV-driven voltage rise on a distribution feeder | der-hosting-capacity-mitigation |
| A newly added generator, storage unit, or large load causes any of the above | interconnection-impact-mitigation |
Deliver
- Network source and size, study type and formulation, horizon and resolution.
- Objective, what it means in units, and the solver plus its termination condition.
- Power balance, voltage extrema with buses, worst line and transformer loading, dispatch by group, curtailment, and storage SOC extrema where relevant.
- Binding constraints, and limitations (local optimum, DC assumptions, storage modelling caveats).
- Any justified escalation, with the numbers behind it.
示例提示词
帮我用potpourri对这个配电网做一次多时段最优潮流优化。
所属插件
安装该插件会一并获得同领域的 63 个 Skill / MCP。
同插件的其他科研 Skill
- ANDES电力系统动态仿真Runs ANDES power-system dynamic studies via PowerMCP: power flow, eigenvalue analysis, and time-domain simulation. Use for damping, stability, or oscillation-mode questions.
- 电池选型与电源预算Builds an evidence-tagged power budget and sizes a manufacturable battery with pouch outline, seals, and derating. Use when sizing runtime, mAh, charging, or supply rails.
- FPGA比特流生成与烧录Generates a Xilinx FPGA bitstream and programs it over JTAG, or burns an MCS image into flash for power-on boot. Use when flashing a board or diagnosing boot failures.
- 硬件项目发布包组装Assembles a hardware release package (fab files, BOM/CPL, carts, assembly guide, hashed manifest) and runs a ready-to-build gate. Use before ordering prototypes.
- 时钟域交叉风险审查Audits clock-domain-crossing risk on an FPGA design and applies the smallest safe synchronizer or constraint fix. Use to resolve CDC violations before sign-off.
- 硬件产品认证合规规划Plans certifications a hardware product needs per target market (FCC, CE/RED, UKCA, battery/radio rules), with cost and lead-time estimates. Use before PCB or enclosure tooling.
- Vivado XDC时序约束编写Authors a Vivado XDC timing constraint set from scratch: clocks, I/O delays, and timing exceptions. Use first, before timing closure, on a design with no or incomplete constraints.
- N-1/N-2应急违规处置Playbook for N-1/N-2 contingency violations: ranks contingencies and proposes preventive and corrective actions. Use after a study shows voltage or thermal problems.
- 潮流计算不收敛诊断Playbook for power-flow convergence failures in PSS/E, PSLF, PowerWorld, pandapower, PyPSA, surge, or OpenDSS. Use when a case diverges or fails to solve.
- 硬件成本核算与采购Prices a hardware product at multiple volumes with one-time vs per-unit cost, landed cost per country, and sourcing leads. Use to estimate unit cost before a pitch.
- RTL仿真覆盖率收敛Measures RTL simulation code coverage and iteratively closes it toward a target by adding testbench stimulus. Use for a sign-off-grade coverage report.
- 配电网DER接纳能力治理Playbook for distribution DER hosting-capacity limits: voltage rise, reverse flow, and thermal limits from PV and storage. Use to estimate how much DER a feeder can host.
- 电子电路设计与审查Designs, audits, or corrects an electronic circuit from a brief, schematic, or netlist, checking power domains, reset sequencing, and ratings. Use for circuit review.
- 硬件可制造性红队审查Red-team audit that fix-loops a hardware project to ready-to-build, re-deriving parts, rails, battery physics, and cost. Use for a reality check before committing to a design.
- 电力系统动态稳定处置Playbook for dynamic stability problems: poor damping, angle instability, or sustained oscillations from eigenvalue or time-domain studies. Use after an unstable study result.
- Egret电力市场调度优化Runs Egret market/operations optimization (DC-OPF, AC-OPF, unit commitment) via PowerMCP. Use for cheapest dispatch, unit commitment, or congestion checks.
- 电子元器件选型核查Researches electronic components against primary sources: part numbers, datasheet limits, lifecycle, stock, and price breaks, one dossier per part. Use to verify or source a BOM.
- EMC电磁兼容预测试Plans grounding, shielding, and filtering for EMC/EMI, and runs an emissions pre-scan with a root-cause fix sequence. Use before a lab test or after a failed EMI scan.
- 产品外壳参数化建模Designs a hardware enclosure as parametric CAD with STEP/STL/GLB output, a DFM check, and Blender assembly validation. Use when designing a case or checking fit.
- 电网频率响应问题处置Playbook for frequency problems: low inertia, high RoCoF, weak primary response, or UFLS risk after loss of the largest unit. Use when a study flags frequency issues.
- FPGA RTL到比特流全流程Drives a Xilinx FPGA design end to end through RTL, simulation, synthesis, implementation, and bitstream, gated at every stage. Use to run the complete build flow in one pass.
- 硬件产品全流程总协调Leads a physical electronic product from idea to a doable design, coordinating specs, parts, battery, PCB, enclosure, render, and cost sub-skills. Use starting a hardware product.
- 硬件原理图与BOM审查Reviews hardware projects: checks schematics against datasheets, pin connections, and firmware-to-hardware alignment across KiCad/Altium files. Use for a design alignment check.
- FPGA ILA在线逻辑调试Inserts an Integrated Logic Analyzer, programs the board, arms a trigger, and reads captured waveforms on real FPGA hardware. Use when sim passes but the board fails.
常见问题
pandapower最优潮流优化能做什么?
Runs AC/DC and multi-period optimal power flow on pandapower networks with storage and flexible resources, via bundled scripts. Use to optimize a feeder or diagnose infeasible OPF。
如何安装pandapower最优潮流优化?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「pandapower最优潮流优化」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
pandapower最优潮流优化需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
pandapower最优潮流优化经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。