This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/power/case

Reading a MATPOWER case file

A MATPOWER case file (MATPOWER's caseformat, version 2, and the older version 1 of its test cases) is a MATLAB function that sets the system base baseMVA and three matrices, one row per bus, generator and branch. read_case(path) reads those four and ignores the rest (gencost, area data, the function line, comments after %).

The column numbers below are MATPOWER's (idx_bus, idx_gen, idx_brch), counted from 0. A power flow reads the input columns and fills the result columns: bus voltages, generator outputs and, in four extra branch columns, the power entering each end of a branch.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

This program declares a record type (Case), and records run only in compiled C for now, so the Run buttons here are off. Open it in the workbench and use its C tab to compile it.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 17–146