simplenet.dcpf¶
Standalone DC power flow.
Solves :math:B' \theta = P_{\text{net}} for non-slack buses where
B' is the bus susceptance matrix from
:func:simplenet.ymatrix.build_b_for_dcpf and P_net aggregates
generator output minus load minus phase-shifter and HVDC injections.
Slack-bus angle is fixed at zero.
DCPFResult
dataclass
¶
Result of :func:run_dcpf. theta is in radians.
run_dcpf
¶
Run a DC power flow on case and return the bus angles.
The result also includes a slack-bus rebalance: the slack
generator's Pg is overwritten so that total generation equals
total demand plus phase-shifter and HVDC contributions, matching
MATPOWER's behavior.
If no REF bus (type == 3) is present, the first PV bus
(type == 2) is auto-promoted to slack. This is needed when the
full model's slack bus has been eliminated by the reduction
pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
case
|
PowerCase
|
The input case. |
required |
Returns:
| Type | Description |
|---|---|
DCPFResult
|
Bus angles (radians), updated generator |
Source code in src/simplenet/dcpf.py
annotate_case_with_solution
¶
Return a copy of case with Va and slack Pg updated.
The bus Vm column is set to 1.0 throughout (DC assumption).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
case
|
PowerCase
|
Input case to annotate. Not mutated. |
required |
result
|
DCPFResult
|
DC power flow result from :func: |
required |
Returns:
| Type | Description |
|---|---|
PowerCase
|
Copy of |