Matpower 71
Guide MATLAB/Octave coding and source-level work with MATPOWER 7.1. Use when writing, reviewing, debugging, or modifying project code involving MATPOWER case files, mpc structs, bus/gen/branch/gencost matrices, define_constants, idx_* constants, loadcase/savecase, runpf/rundcpf, runcpf, runopf/rundcopf, mpoption, OPF extensions, userfcn callbacks, solver options, result interpretation, convergence debugging, or project-local copies of MATPOWER 7.1 source files.From its SKILL.md
npx -y skills add wuzhenchong/power-skills --skill matpower-71Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
MATPOWER 7.1
Use this skill for MATLAB/Octave work that depends on MATPOWER 7.1. Prefer the MATPOWER 7.1 legacy APIs and behavior unless the user explicitly asks for a newer MATPOWER 8.x MP-Core workflow.
Core Rules
- Prefer named constants from
define_constantsoridx_bus,idx_gen,idx_brch,idx_costover hard-coded matrix column numbers. - Load cases with
loadcase; save cases withsavecase; preserve MATPOWER case struct semantics. - Use
runpforrundcpffor power flow,runcpffor continuation power flow, andrunopforrundcopffor optimal power flow. - Use
mpoptionfor solver, algorithm, tolerance, verbosity, and output configuration. - For custom OPF behavior, first check standard extension fields (
A,l,u,H,Cw,N,fparm,z0,zl,zu) andgencost; useuserfcncallbacks when staged customization is needed. - Do not edit the user's installed MATPOWER package in place. If MATPOWER source behavior must change, edit project-local copies of the relevant
.mfiles and verify MATLAB/Octave resolves those copies first.
Reference Routing
Load only the references needed for the task.
- Start with
references/quickstart.mdfor ordinary MATPOWER programming patterns. - Use
references/case-format.mdformpcstructs,baseMVA,bus,gen,branch,gencost, optional fields, and case construction. - Use
references/constants-and-indexing.mdfordefine_constants,idx_*helpers, and internal vs external numbering. - Use
references/power-flow.mdfor AC/DC PF withrunpf,rundcpf, Q-limit handling, and PF result fields. - Use
references/continuation-power-flow.mdfor CPF withruncpf. - Use
references/opf.mdfor AC/DC OPF,gencost,runopf,rundcopf, objectives, and common OPF results. - Use
references/opf-extensions.mdfor custom constraints, costs, variables, and OPF formulation extensions. - Use
references/callbacks-userfcn.mdforadd_userfcn, callback stages, and save/print/custom formulation hooks. - Use
references/options-solvers.mdformpoption, algorithms, solvers, output control, and reproducibility. - Use
references/results-and-postprocessing.mdfor interpreting solved cases and extracting flows, voltages, losses, costs, and success flags. - Use
references/testing-debugging.mdfor installation checks, regression cases, convergence debugging, and path issues. - Use
references/source-architecture.mdbefore reading or changing MATPOWER internals. - Use
references/source-modification-guide.mdbefore editing any project-local copy of a MATPOWER source file. - Use
references/source-index.mdfor official MATPOWER 7.1 documentation and source lookup locations.
Source Modification Rule
Never modify files inside the user's installed MATPOWER package.
When a requested change requires modifying MATPOWER source behavior, copy the relevant MATPOWER .m file or files into the current project/workspace and edit those project-local copies. Place the copies wherever fits the project structure, such as the project root, src/, a local overrides folder, a vendored source directory, or an existing MATLAB source folder. Follow the repository's conventions instead of imposing a fixed folder name.
Before editing a copied MATPOWER source file:
- Identify the installed MATPOWER source file being copied.
- Identify the project-local copy that will be edited.
- Confirm the project-local copy is earlier on the MATLAB/Octave path than the installed MATPOWER package.
- Use
which <function_name>to verify MATLAB/Octave resolves the intended project-local function. - Identify the affected call chain and the regression cases to run after the change.
If an extension can be implemented cleanly with case data, mpoption, OPF extension fields, or userfcn callbacks, prefer that over source copying.
Validation Expectations
For generated or modified MATLAB code, include a small runnable check when feasible:
define_constants;
mpc = loadcase('case9');
results = runpf(mpc, mpoption('verbose', 0, 'out.all', 0));
assert(results.success == 1);
For OPF work, test at least case9 or case30 plus the user's target case when available. For project-local MATPOWER source overrides, verify which <function_name> before running tests.
What ships with it: 17 files
20.2 KB alongside SKILL.md
agents/
- openai.yaml211 B
references/
- callbacks-userfcn.md1.3 KB
- case-format.md1.5 KB
- constants-and-indexing.md1.4 KB
- continuation-power-flow.md813 B
- opf-extensions.md1.5 KB
- opf.md1.3 KB
- options-solvers.md982 B
- power-flow.md1.5 KB
- quickstart.md1.2 KB
- results-and-postprocessing.md978 B
- source-architecture.md1.7 KB
- source-index.md1.3 KB
- source-modification-guide.md2.2 KB
- testing-debugging.md1.1 KB
- LICENSE.txt1.0 KB
- requirement.txt258 B