.. _PF: ================================================================================ PF ================================================================================ Type for power flow routines. Common Parameters: pd Common Vars: pg Available routines: DCPF_, PFlow_, CPF_, PFlow0_, DCPF0_ .. _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:`c_{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 | +======+================+===================+===========+ | csb | :math:`c_{sb}` | select slack bus | VarSelect | +------+----------------+-------------------+-----------+ | cpv | :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 | +----------+-----------------------+-------------------------------------+--------+----------------------+ | pd | :math:`p_{d}` | 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://docs.andes.app/en/latest/_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 | +--------------+--------+-------+--------------------------------------------------------------+---------------------------+ .. _CPF: -------------------------------------------------------------------------------- CPF -------------------------------------------------------------------------------- Continuous power flow. Still under development, not ready for use. 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 [CPF] +--------------+--------+-------+--------------------------------------------------------------+---------------------------+ | 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 | +--------------+--------+-------+--------------------------------------------------------------+---------------------------+ .. _PFlow0: -------------------------------------------------------------------------------- PFlow0 -------------------------------------------------------------------------------- AC Power Flow using PYPOWER. This class is deprecated as of version 0.9.12 and will be removed in 1.1.0. Notes ----- 1. AC pwoer flow is solved with PYPOWER ``runpf`` function. 2. AC power flow formulation in AMS style is NOT DONE YET, but this does not affect the results because the data are passed to PYPOWER for solving. Vars ---------------------------------- +-------+-----------------+---------------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+=================+===========================+========+=============+============+ | pg | :math:`p_{g}` | Gen active power | *p.u.* | StaticGen.p | | +-------+-----------------+---------------------------+--------+-------------+------------+ | aBus | :math:`a_{Bus}` | bus voltage angle | *rad* | Bus.a | | +-------+-----------------+---------------------------+--------+-------------+------------+ | plf | :math:`p_{lf}` | Line flow | *p.u.* | Line | | +-------+-----------------+---------------------------+--------+-------------+------------+ | vBus | :math:`v_{Bus}` | bus voltage magnitude | *p.u.* | Bus.v | | +-------+-----------------+---------------------------+--------+-------------+------------+ | qg | :math:`q_{g}` | reactive power generation | *p.u.* | StaticGen.q | | +-------+-----------------+---------------------------+--------+-------------+------------+ Parameters ---------------------------------- +------+----------------+---------------------------------------+----------+---------------+ | Name | Symbol | Description | Unit | Source | +======+================+=======================================+==========+===============+ | ug | :math:`u_{g}` | Gen connection status | | StaticGen.u | +------+----------------+---------------------------------------+----------+---------------+ | x | :math:`x` | line reactance | *p.u.* | Line.x | +------+----------------+---------------------------------------+----------+---------------+ | tap | :math:`t_{ap}` | transformer branch tap ratio | *float* | Line.tap | +------+----------------+---------------------------------------+----------+---------------+ | phi | :math:`\phi` | transformer branch phase shift in rad | *radian* | Line.phi | +------+----------------+---------------------------------------+----------+---------------+ | pd | :math:`p_{d}` | active deman | *p.u.* | StaticLoad.p0 | +------+----------------+---------------------------------------+----------+---------------+ | qd | :math:`q_{d}` | reactive power load in system base | *p.u.* | StaticLoad.q0 | +------+----------------+---------------------------------------+----------+---------------+ Config Fields in [PFlow0] +--------+--------+-------+----------------------------+-----------------+ | Option | Symbol | Value | Info | Accepted values | +========+========+=======+============================+=================+ | qlim | | 0 | Enforce generator q limits | (0, 1, 2) | +--------+--------+-------+----------------------------+-----------------+ .. _DCPF0: -------------------------------------------------------------------------------- DCPF0 -------------------------------------------------------------------------------- DC power flow using PYPOWER. This class is deprecated as of version 0.9.12 and will be removed in 1.1.0. Notes ----- 1. DCPF is solved with PYPOWER ``runpf`` function. 2. DCPF formulation is not complete yet, but this does not affect the results because the data are passed to PYPOWER for solving. Vars ---------------------------------- +-------+-----------------+-------------------+--------+-------------+------------+ | Name | Symbol | Description | Unit | Source | Properties | +=======+=================+===================+========+=============+============+ | pg | :math:`p_{g}` | Gen active power | *p.u.* | StaticGen.p | | +-------+-----------------+-------------------+--------+-------------+------------+ | aBus | :math:`a_{Bus}` | bus voltage angle | *rad* | Bus.a | | +-------+-----------------+-------------------+--------+-------------+------------+ | plf | :math:`p_{lf}` | Line flow | *p.u.* | Line | | +-------+-----------------+-------------------+--------+-------------+------------+ Parameters ---------------------------------- +------+----------------+---------------------------------------+----------+---------------+ | Name | Symbol | Description | Unit | Source | +======+================+=======================================+==========+===============+ | ug | :math:`u_{g}` | Gen connection status | | StaticGen.u | +------+----------------+---------------------------------------+----------+---------------+ | x | :math:`x` | line reactance | *p.u.* | Line.x | +------+----------------+---------------------------------------+----------+---------------+ | tap | :math:`t_{ap}` | transformer branch tap ratio | *float* | Line.tap | +------+----------------+---------------------------------------+----------+---------------+ | phi | :math:`\phi` | transformer branch phase shift in rad | *radian* | Line.phi | +------+----------------+---------------------------------------+----------+---------------+ | pd | :math:`p_{d}` | active deman | *p.u.* | StaticLoad.p0 | +------+----------------+---------------------------------------+----------+---------------+