simplenet.redistribute¶
Redistribute loads on the reduced model.
Port of matlab/NetworkReduction2/LoadRedistribution.m. The goal is
to make a DC power flow on the reduced model reproduce the full
model's bus voltage angles for the retained buses, given that
external generators have already been relocated.
Algorithm:
- If
pf_flagis true, solve a DC PF on the full model first; otherwise reusecase.bus[:, VA]directly. - Map every retained bus's
Vm/Vafrom the full solution. - Build the reduced model's DC PF matrix
B_r(with tap ratios, no shunts) and computeP_inj = B_r * theta. - Adjust each phase-shifting transformer's contribution and any HVDC line injections.
- Set
Pd_new = Pg_total_at_bus - P_injso the reduced DC PF matches the full solution exactly.
redistribute_loads
¶
redistribute_loads(full_case: PowerCase, reduced_case: PowerCase, *, pf_flag: bool = True) -> PowerCase
Return a new reduced :class:PowerCase with Pd rebalanced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
full_case
|
PowerCase
|
The full model (post-preprocess) before reduction. |
required |
reduced_case
|
PowerCase
|
The reduced model after external-generator placement. |
required |
pf_flag
|
bool
|
If |
True
|
Source code in src/simplenet/redistribute.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |