.. _PF: ================================================================================ PF ================================================================================ Type for power flow routines. Common Parameters: pd Common Vars: pg Available routines: DCPF_, PFlow_, DCPF1_, PFlow1_ .. _DCPF: -------------------------------------------------------------------------------- DCPF -------------------------------------------------------------------------------- DC power flow. Objective ---------------------------------- +------+----------------+ | Unit | Expression | +======+================+ | *$* | :math:`min. 0` | +------+----------------+ Expressions ---------------------------------- +------+-------------+------------------------------------------+--------+--------+ | Name | Description | Expression | Unit | Source | +======+=============+==========================================+========+========+ | plf | Line flow | :math:`B_{f} \theta_{bus} + P_{f}^{inj}` | *p.u.* | Line | +------+-------------+------------------------------------------+--------+--------+ Constraints ---------------------------------- +-------+-----------------------+--------------------------------------------------------------------------------------------+ | Name | Description | Expression | +=======+=======================+============================================================================================+ | pb | power balance | :math:`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 | :math:`I_{sb} \theta_{bus} = 0` | +-------+-----------------------+--------------------------------------------------------------------------------------------+ | pvb | PV generator | :math:`C_{PV} (p_g - u_{g} p_{g, 0}) = 0` | +-------+-----------------------+--------------------------------------------------------------------------------------------+ Vars ---------------------------------- +-------+----------------------+------------------------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+======================+====================================+========+=============+============+ | pg | :math:`p_g` | Gen active power | *p.u.* | StaticGen.p | | +-------+----------------------+------------------------------------+--------+-------------+------------+ | vBus | :math:`v_{Bus}` | Bus voltage magnitude, placeholder | *p.u.* | Bus.v | | +-------+----------------------+------------------------------------+--------+-------------+------------+ | aBus | :math:`\theta_{bus}` | Bus voltage angle | *rad* | Bus.a | | +-------+----------------------+------------------------------------+--------+-------------+------------+ Services --------- +------+----------------+--------------------------------+-----------+ | Name | Symbol | Description | Type | +======+================+================================+===========+ | pd | :math:`p_{d}` | effective active demand | NumOpDual | +------+----------------+--------------------------------+-----------+ | isb | :math:`I_{sb}` | Index slack bus from all buses | VarSelect | +------+----------------+--------------------------------+-----------+ | ipv | :math:`C_{PV}` | Select PV from pg | VarSelect | +------+----------------+--------------------------------+-----------+ Parameters ---------------------------------- +----------+-----------------------+-------------------------------------+--------+----------------------+ | Name | Symbol | Description | Unit | Source | +==========+=======================+=====================================+========+======================+ | ug | :math:`u_{g}` | Gen connection status | | StaticGen.u | +----------+-----------------------+-------------------------------------+--------+----------------------+ | pg0 | :math:`p_{g, 0}` | Gen initial active power | *p.u.* | StaticGen.p0 | +----------+-----------------------+-------------------------------------+--------+----------------------+ | gsh | :math:`g_{sh}` | shunt conductance | | Shunt.g | +----------+-----------------------+-------------------------------------+--------+----------------------+ | buss | :math:`B_{us,s}` | Bus slack | | Slack.bus | +----------+-----------------------+-------------------------------------+--------+----------------------+ | ud | :math:`u_{d}` | Load connection status | | StaticLoad.u | +----------+-----------------------+-------------------------------------+--------+----------------------+ | pd0 | :math:`p_{d,0}` | active demand | *p.u.* | StaticLoad.p0 | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Cg | :math:`C_{g}` | Gen connection matrix | | MatProcessor.Cg | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Cl | :math:`C_{l}` | Load connection matrix | | MatProcessor.Cl | +----------+-----------------------+-------------------------------------+--------+----------------------+ | CftT | :math:`C_{ft}^T` | Transpose of line connection matrix | | MatProcessor.CftT | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Csh | :math:`C_{sh}` | Shunt connection matrix | | MatProcessor.Csh | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Bbus | :math:`B_{bus}` | Bus admittance matrix | | MatProcessor.Bbus | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Bf | :math:`B_{f}` | Bf matrix | | MatProcessor.Bf | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Pbusinj | :math:`P_{bus}^{inj}` | Bus power injection vector | | MatProcessor.Pbusinj | +----------+-----------------------+-------------------------------------+--------+----------------------+ | Pfinj | :math:`P_{f}^{inj}` | Line power injection vector | | MatProcessor.Pfinj | +----------+-----------------------+-------------------------------------+--------+----------------------+ | genpv | :math:`g_{DG}` | gen of PV | | PV.idx | +----------+-----------------------+-------------------------------------+--------+----------------------+ .. _PFlow: -------------------------------------------------------------------------------- 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 ---------- 1. M. L. Crow, Computational methods for electric power systems. 2015. 2. ANDES Documentation - Simulation and Plot. https://andes.readthedocs.io/en/stable/_examples/ex1.html Objective ---------------------------------- +------+----------------+ | Unit | Expression | +======+================+ | *$* | :math:`min. 0` | +------+----------------+ Expressions ---------------------------------- +------+-------------+------------------------------------------+--------+--------+ | Name | Description | Expression | Unit | Source | +======+=============+==========================================+========+========+ | plf | Line flow | :math:`B_{f} \theta_{bus} + P_{f}^{inj}` | *p.u.* | Line | +------+-------------+------------------------------------------+--------+--------+ Vars ---------------------------------- +-------+----------------------+-----------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+======================+=======================+========+=============+============+ | pg | :math:`p_g` | Gen active power | *p.u.* | StaticGen.p | | +-------+----------------------+-----------------------+--------+-------------+------------+ | qg | :math:`q_g` | Gen reactive power | *p.u.* | StaticGen.q | | +-------+----------------------+-----------------------+--------+-------------+------------+ | aBus | :math:`\theta_{bus}` | Bus voltage angle | *rad* | Bus.a | | +-------+----------------------+-----------------------+--------+-------------+------------+ | vBus | :math:`V_{bus}` | Bus voltage magnitude | *p.u.* | Bus.v | | +-------+----------------------+-----------------------+--------+-------------+------------+ Parameters ---------------------------------- +--------+---------------------+-----------------------------+------+--------------------+ | Name | Symbol | Description | Unit | Source | +========+=====================+=============================+======+====================+ | Bf | :math:`B_{f}` | Bf matrix | | MatProcessor.Bf | +--------+---------------------+-----------------------------+------+--------------------+ | Pfinj | :math:`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: -------------------------------------------------------------------------------- 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. .. versionadded:: 1.0.10 Objective ---------------------------------- +------+----------------+ | Unit | Expression | +======+================+ | *$* | :math:`min. 0` | +------+----------------+ Vars ---------------------------------- +-------+-----------------+-----------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+=================+=======================+========+=============+============+ | aBus | :math:`a_{Bus}` | bus voltage angle | *rad* | Bus.a | | +-------+-----------------+-----------------------+--------+-------------+------------+ | vBus | :math:`v_{Bus}` | Bus voltage magnitude | *p.u.* | Bus.v | | +-------+-----------------+-----------------------+--------+-------------+------------+ | pg | :math:`p_{g}` | Gen active power | *p.u.* | StaticGen.p | | +-------+-----------------+-----------------------+--------+-------------+------------+ | qg | :math:`q_{g}` | Gen reactive power | *p.u.* | StaticGen.q | | +-------+-----------------+-----------------------+--------+-------------+------------+ | plf | :math:`p_{lf}` | Line flow | *p.u.* | Line | | +-------+-----------------+-----------------------+--------+-------------+------------+ ExpressionCalcs ---------------------------------- +-------+-------------+---------------------------------------------------------------------+------+--------+ | Name | Description | Expression | Unit | Source | +=======+=============+=====================================================================+======+========+ | None | Total cost | :math:`\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})` | *$* | | +-------+-------------+---------------------------------------------------------------------+------+--------+ Parameters ---------------------------------- +------+---------------+------------------------+--------------+---------------+ | Name | Symbol | Description | Unit | Source | +======+===============+========================+==============+===============+ | ug | :math:`u_{g}` | Gen connection status | | StaticGen.u | +------+---------------+------------------------+--------------+---------------+ | c2 | :math:`c_{2}` | Gen cost coefficient 2 | *$/(p.u.^2)* | GCost.c2 | +------+---------------+------------------------+--------------+---------------+ | c1 | :math:`c_{1}` | Gen cost coefficient 1 | *$/(p.u.)* | GCost.c1 | +------+---------------+------------------------+--------------+---------------+ | c0 | :math:`c_{0}` | Gen cost coefficient 0 | *$* | GCost.c0 | +------+---------------+------------------------+--------------+---------------+ | pd | :math:`p_{d}` | active demand | *p.u.* | StaticLoad.p0 | +------+---------------+------------------------+--------------+---------------+ | qd | :math:`q_{d}` | reactive demand | *p.u.* | StaticLoad.q0 | +------+---------------+------------------------+--------------+---------------+ Config Fields in [DCPF1] +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | Option | Symbol | Value | Info | Accepted values | +===============+===========================+=======+=================================================================+=================+ | verbose | :math:`v_{erbose}` | 1 | 0: no progress info, 1: little, 2: lots, 3: all | (0, 1, 2, 3) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_all | :math:`o_{ut\_all}` | 0 | -1: individual flags control what prints, 0: none, 1: all | (-1, 0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_sys_sum | :math:`o_{ut\_sys\_sum}` | 1 | print system summary | (0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_area_sum | :math:`o_{ut\_area\_sum}` | 0 | print area summaries | (0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_bus | :math:`o_{ut\_bus}` | 1 | print bus detail | (0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_branch | :math:`o_{ut\_branch}` | 1 | print branch detail | (0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_gen | :math:`o_{ut\_gen}` | 0 | print generator detail (OUT_BUS also includes gen info) | (0, 1) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_all_lim | :math:`o_{ut\_all\_lim}` | -1 | -1: individual flags, 0: none, 1: binding, 2: all | (-1, 0, 1, 2) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_v_lim | :math:`o_{ut\_v\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_line_lim | :math:`o_{ut\_line\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_pg_lim | :math:`o_{ut\_pg\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ | out_qg_lim | :math:`o_{ut\_qg\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +---------------+---------------------------+-------+-----------------------------------------------------------------+-----------------+ .. _PFlow1: -------------------------------------------------------------------------------- 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. .. versionadded:: 1.0.10 Objective ---------------------------------- +------+----------------+ | Unit | Expression | +======+================+ | *$* | :math:`min. 0` | +------+----------------+ Vars ---------------------------------- +-------+-----------------+-----------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+=================+=======================+========+=============+============+ | aBus | :math:`a_{Bus}` | bus voltage angle | *rad* | Bus.a | | +-------+-----------------+-----------------------+--------+-------------+------------+ | vBus | :math:`v_{Bus}` | Bus voltage magnitude | *p.u.* | Bus.v | | +-------+-----------------+-----------------------+--------+-------------+------------+ | pg | :math:`p_{g}` | Gen active power | *p.u.* | StaticGen.p | | +-------+-----------------+-----------------------+--------+-------------+------------+ | qg | :math:`q_{g}` | Gen reactive power | *p.u.* | StaticGen.q | | +-------+-----------------+-----------------------+--------+-------------+------------+ | plf | :math:`p_{lf}` | Line flow | *p.u.* | Line | | +-------+-----------------+-----------------------+--------+-------------+------------+ ExpressionCalcs ---------------------------------- +-------+-------------+---------------------------------------------------------------------+------+--------+ | Name | Description | Expression | Unit | Source | +=======+=============+=====================================================================+======+========+ | None | Total cost | :math:`\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})` | *$* | | +-------+-------------+---------------------------------------------------------------------+------+--------+ Parameters ---------------------------------- +------+---------------+------------------------+--------------+---------------+ | Name | Symbol | Description | Unit | Source | +======+===============+========================+==============+===============+ | ug | :math:`u_{g}` | Gen connection status | | StaticGen.u | +------+---------------+------------------------+--------------+---------------+ | c2 | :math:`c_{2}` | Gen cost coefficient 2 | *$/(p.u.^2)* | GCost.c2 | +------+---------------+------------------------+--------------+---------------+ | c1 | :math:`c_{1}` | Gen cost coefficient 1 | *$/(p.u.)* | GCost.c1 | +------+---------------+------------------------+--------------+---------------+ | c0 | :math:`c_{0}` | Gen cost coefficient 0 | *$* | GCost.c0 | +------+---------------+------------------------+--------------+---------------+ | pd | :math:`p_{d}` | active demand | *p.u.* | StaticLoad.p0 | +------+---------------+------------------------+--------------+---------------+ | qd | :math:`q_{d}` | reactive demand | *p.u.* | StaticLoad.q0 | +------+---------------+------------------------+--------------+---------------+ Config Fields in [PFlow1] +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | Option | Symbol | Value | Info | Accepted values | +=================+===========================+=======+========================================================================+=================+ | verbose | :math:`v_{erbose}` | 1 | 0: no progress info, 1: little, 2: lots, 3: all | (0, 1, 2, 3) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_all | :math:`o_{ut\_all}` | 0 | -1: individual flags control what prints, 0: none, 1: all | (-1, 0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_sys_sum | :math:`o_{ut\_sys\_sum}` | 1 | print system summary | (0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_area_sum | :math:`o_{ut\_area\_sum}` | 0 | print area summaries | (0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_bus | :math:`o_{ut\_bus}` | 1 | print bus detail | (0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_branch | :math:`o_{ut\_branch}` | 1 | print branch detail | (0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_gen | :math:`o_{ut\_gen}` | 0 | print generator detail (OUT_BUS also includes gen info) | (0, 1) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_all_lim | :math:`o_{ut\_all\_lim}` | -1 | -1: individual flags, 0: none, 1: binding, 2: all | (-1, 0, 1, 2) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_v_lim | :math:`o_{ut\_v\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_line_lim | :math:`o_{ut\_line\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_pg_lim | :math:`o_{ut\_pg\_lim}` | 1 | 0: don't print, 1: binding constraints only, 2: all constraints | (0, 1, 2) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+ | out_qg_lim | :math:`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) | +-----------------+---------------------------+-------+------------------------------------------------------------------------+-----------------+