PF#
Type for power flow routines.
Common Parameters: pd
Common Vars: pg
Available routines: DCPF, PFlow, DCPF1, PFlow1
DCPF#
DC power flow.
Objective#
Unit |
Expression |
|---|---|
$ |
\(min. 0\) |
Expressions#
Name |
Description |
Expression |
Unit |
Source |
|---|---|---|---|---|
plf |
Line flow |
\(B_{f} \theta_{bus} + P_{f}^{inj}\) |
p.u. |
Line |
Constraints#
Name |
Description |
Expression |
|---|---|---|
pb |
power balance |
\(B_{bus} \theta_{bus} + P_{bus}^{inj} + C_{l} p_{d} + C_{sh} g_{sh} - C_{g} p_g = 0\) |
sbus |
align slack bus angle |
\(I_{sb} \theta_{bus} = 0\) |
pvb |
PV generator |
\(C_{PV} (p_g - u_{g} p_{g, 0}) = 0\) |
Vars#
Name |
Symbol |
Description |
Unit |
Source |
Properties |
|---|---|---|---|---|---|
pg |
\(p_g\) |
Gen active power |
p.u. |
StaticGen.p |
|
vBus |
\(v_{Bus}\) |
Bus voltage magnitude, placeholder |
p.u. |
Bus.v |
|
aBus |
\(\theta_{bus}\) |
Bus voltage angle |
rad |
Bus.a |
Services#
Name |
Symbol |
Description |
Type |
|---|---|---|---|
pd |
\(p_{d}\) |
effective active demand |
NumOpDual |
isb |
\(I_{sb}\) |
Index slack bus from all buses |
VarSelect |
ipv |
\(C_{PV}\) |
Select PV from pg |
VarSelect |
Parameters#
Name |
Symbol |
Description |
Unit |
Source |
|---|---|---|---|---|
ug |
\(u_{g}\) |
Gen connection status |
StaticGen.u |
|
pg0 |
\(p_{g, 0}\) |
Gen initial active power |
p.u. |
StaticGen.p0 |
gsh |
\(g_{sh}\) |
shunt conductance |
Shunt.g |
|
buss |
\(B_{us,s}\) |
Bus slack |
Slack.bus |
|
ud |
\(u_{d}\) |
Load connection status |
StaticLoad.u |
|
pd0 |
\(p_{d,0}\) |
active demand |
p.u. |
StaticLoad.p0 |
Cg |
\(C_{g}\) |
Gen connection matrix |
MatProcessor.Cg |
|
Cl |
\(C_{l}\) |
Load connection matrix |
MatProcessor.Cl |
|
CftT |
\(C_{ft}^T\) |
Transpose of line connection matrix |
MatProcessor.CftT |
|
Csh |
\(C_{sh}\) |
Shunt connection matrix |
MatProcessor.Csh |
|
Bbus |
\(B_{bus}\) |
Bus admittance matrix |
MatProcessor.Bbus |
|
Bf |
\(B_{f}\) |
Bf matrix |
MatProcessor.Bf |
|
Pbusinj |
\(P_{bus}^{inj}\) |
Bus power injection vector |
MatProcessor.Pbusinj |
|
Pfinj |
\(P_{f}^{inj}\) |
Line power injection vector |
MatProcessor.Pfinj |
|
genpv |
\(g_{DG}\) |
gen of PV |
PV.idx |
PFlow#
Power flow analysis using ANDES PFlow routine.
More settings can be changed via PFlow2._adsys.config and PFlow2._adsys.PFlow.config.
All generator output powers, bus voltages, and angles are included in the variable definitions. However, not all of these are unknowns; the definitions are provided for easy access.
References#
Crow, Computational methods for electric power systems. 2015.
ANDES Documentation - Simulation and Plot. https://andes.readthedocs.io/en/stable/_examples/ex1.html
Objective#
Unit |
Expression |
|---|---|
$ |
\(min. 0\) |
Expressions#
Name |
Description |
Expression |
Unit |
Source |
|---|---|---|---|---|
plf |
Line flow |
\(B_{f} \theta_{bus} + P_{f}^{inj}\) |
p.u. |
Line |
Vars#
Name |
Symbol |
Description |
Unit |
Source |
Properties |
|---|---|---|---|---|---|
pg |
\(p_g\) |
Gen active power |
p.u. |
StaticGen.p |
|
qg |
\(q_g\) |
Gen reactive power |
p.u. |
StaticGen.q |
|
aBus |
\(\theta_{bus}\) |
Bus voltage angle |
rad |
Bus.a |
|
vBus |
\(V_{bus}\) |
Bus voltage magnitude |
p.u. |
Bus.v |
Parameters#
Name |
Symbol |
Description |
Unit |
Source |
|---|---|---|---|---|
Bf |
\(B_{f}\) |
Bf matrix |
MatProcessor.Bf |
|
Pfinj |
\(P_{f}^{inj}\) |
Line power injection vector |
MatProcessor.Pfinj |
Config Fields in [PFlow]
Option |
Symbol |
Value |
Info |
Accepted values |
|---|---|---|---|---|
tol |
0.000 |
convergence tolerance |
float |
|
max_iter |
25 |
max. number of iterations |
>=10 |
|
method |
NR |
calculation method |
('NR', 'dishonest', 'NK') |
|
check_conn |
1 |
check connectivity before power flow |
(0, 1) |
|
n_factorize |
4 |
first N iterations to factorize Jacobian in dishonest method |
>0 |
DCPF1#
DC Power Flow using PYPOWER.
This routine provides a wrapper for running DC power flow analysis using the PYPOWER. It leverages PYPOWER's internal DC power flow solver and maps results back to the AMS system.
Notes#
This class does not implement the AMS-style DC power flow formulation.
For detailed mathematical formulations and algorithmic details, refer to the MATPOWER User's Manual, section on Power Flow.
Added in version 1.0.10.
Objective#
Unit |
Expression |
|---|---|
$ |
\(min. 0\) |
Vars#
Name |
Symbol |
Description |
Unit |
Source |
Properties |
|---|---|---|---|---|---|
aBus |
\(a_{Bus}\) |
bus voltage angle |
rad |
Bus.a |
|
vBus |
\(v_{Bus}\) |
Bus voltage magnitude |
p.u. |
Bus.v |
|
pg |
\(p_{g}\) |
Gen active power |
p.u. |
StaticGen.p |
|
qg |
\(q_{g}\) |
Gen reactive power |
p.u. |
StaticGen.q |
|
plf |
\(p_{lf}\) |
Line flow |
p.u. |
Line |
ExpressionCalcs#
Name |
Description |
Expression |
Unit |
Source |
|---|---|---|---|---|
None |
Total cost |
\(\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})\) |
$ |
Parameters#
Name |
Symbol |
Description |
Unit |
Source |
|---|---|---|---|---|
ug |
\(u_{g}\) |
Gen connection status |
StaticGen.u |
|
c2 |
\(c_{2}\) |
Gen cost coefficient 2 |
$/(p.u.^2) |
GCost.c2 |
c1 |
\(c_{1}\) |
Gen cost coefficient 1 |
$/(p.u.) |
GCost.c1 |
c0 |
\(c_{0}\) |
Gen cost coefficient 0 |
$ |
GCost.c0 |
pd |
\(p_{d}\) |
active demand |
p.u. |
StaticLoad.p0 |
qd |
\(q_{d}\) |
reactive demand |
p.u. |
StaticLoad.q0 |
Config Fields in [DCPF1]
Option |
Symbol |
Value |
Info |
Accepted values |
|---|---|---|---|---|
verbose |
\(v_{erbose}\) |
1 |
0: no progress info, 1: little, 2: lots, 3: all |
(0, 1, 2, 3) |
out_all |
\(o_{ut\_all}\) |
0 |
-1: individual flags control what prints, 0: none, 1: all |
(-1, 0, 1) |
out_sys_sum |
\(o_{ut\_sys\_sum}\) |
1 |
print system summary |
(0, 1) |
out_area_sum |
\(o_{ut\_area\_sum}\) |
0 |
print area summaries |
(0, 1) |
out_bus |
\(o_{ut\_bus}\) |
1 |
print bus detail |
(0, 1) |
out_branch |
\(o_{ut\_branch}\) |
1 |
print branch detail |
(0, 1) |
out_gen |
\(o_{ut\_gen}\) |
0 |
print generator detail (OUT_BUS also includes gen info) |
(0, 1) |
out_all_lim |
\(o_{ut\_all\_lim}\) |
-1 |
-1: individual flags, 0: none, 1: binding, 2: all |
(-1, 0, 1, 2) |
out_v_lim |
\(o_{ut\_v\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_line_lim |
\(o_{ut\_line\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_pg_lim |
\(o_{ut\_pg\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_qg_lim |
\(o_{ut\_qg\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
PFlow1#
Power Flow using PYPOWER.
This routine provides a wrapper for running power flow analysis using the PYPOWER. It leverages PYPOWER's internal power flow solver and maps results back to the AMS system.
Notes#
This class does not implement the AMS-style power flow formulation.
For detailed mathematical formulations and algorithmic details, refer to the MATPOWER User's Manual, section on Power Flow.
Fast-Decoupled (XB version) and Fast-Decoupled (BX version) algorithms are not fully supported yet.
Added in version 1.0.10.
Objective#
Unit |
Expression |
|---|---|
$ |
\(min. 0\) |
Vars#
Name |
Symbol |
Description |
Unit |
Source |
Properties |
|---|---|---|---|---|---|
aBus |
\(a_{Bus}\) |
bus voltage angle |
rad |
Bus.a |
|
vBus |
\(v_{Bus}\) |
Bus voltage magnitude |
p.u. |
Bus.v |
|
pg |
\(p_{g}\) |
Gen active power |
p.u. |
StaticGen.p |
|
qg |
\(q_{g}\) |
Gen reactive power |
p.u. |
StaticGen.q |
|
plf |
\(p_{lf}\) |
Line flow |
p.u. |
Line |
ExpressionCalcs#
Name |
Description |
Expression |
Unit |
Source |
|---|---|---|---|---|
None |
Total cost |
\(\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})\) |
$ |
Parameters#
Name |
Symbol |
Description |
Unit |
Source |
|---|---|---|---|---|
ug |
\(u_{g}\) |
Gen connection status |
StaticGen.u |
|
c2 |
\(c_{2}\) |
Gen cost coefficient 2 |
$/(p.u.^2) |
GCost.c2 |
c1 |
\(c_{1}\) |
Gen cost coefficient 1 |
$/(p.u.) |
GCost.c1 |
c0 |
\(c_{0}\) |
Gen cost coefficient 0 |
$ |
GCost.c0 |
pd |
\(p_{d}\) |
active demand |
p.u. |
StaticLoad.p0 |
qd |
\(q_{d}\) |
reactive demand |
p.u. |
StaticLoad.q0 |
Config Fields in [PFlow1]
Option |
Symbol |
Value |
Info |
Accepted values |
|---|---|---|---|---|
verbose |
\(v_{erbose}\) |
1 |
0: no progress info, 1: little, 2: lots, 3: all |
(0, 1, 2, 3) |
out_all |
\(o_{ut\_all}\) |
0 |
-1: individual flags control what prints, 0: none, 1: all |
(-1, 0, 1) |
out_sys_sum |
\(o_{ut\_sys\_sum}\) |
1 |
print system summary |
(0, 1) |
out_area_sum |
\(o_{ut\_area\_sum}\) |
0 |
print area summaries |
(0, 1) |
out_bus |
\(o_{ut\_bus}\) |
1 |
print bus detail |
(0, 1) |
out_branch |
\(o_{ut\_branch}\) |
1 |
print branch detail |
(0, 1) |
out_gen |
\(o_{ut\_gen}\) |
0 |
print generator detail (OUT_BUS also includes gen info) |
(0, 1) |
out_all_lim |
\(o_{ut\_all\_lim}\) |
-1 |
-1: individual flags, 0: none, 1: binding, 2: all |
(-1, 0, 1, 2) |
out_v_lim |
\(o_{ut\_v\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_line_lim |
\(o_{ut\_line\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_pg_lim |
\(o_{ut\_pg\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
out_qg_lim |
\(o_{ut\_qg\_lim}\) |
1 |
0: don't print, 1: binding constraints only, 2: all constraints |
(0, 1, 2) |
pf_alg |
1 |
1: Newton, 2: Fast-Decoupled XB, 3: Fast-Decoupled BX, 4: Gauss Seidel |
(1, 2, 3, 4) |
|
pf_tol |
0.000 |
termination tolerance on per unit P & Q mismatch |
(0.0, 1e-08) |
|
pf_max_it |
10 |
maximum number of iterations for Newton's method |
>1 |
|
pf_max_it_fd |
30 |
maximum number of iterations for fast decoupled method |
>1 |
|
pf_max_it_gs |
1000 |
maximum number of iterations for Gauss-Seidel method |
>1 |
|
enforce_q_lims |
0 |
enforce gen reactive power limits, at expense of V magnitude |
(0, 1) |