You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/networks.rst
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -431,24 +431,22 @@ As explained above, once the network variables have been set, a vector with the
431
431
Outages and Contingencies
432
432
=========================
433
433
434
-
PFNET provides a way to specify outages of certain components and analyze network contingencies. In particular, branches and generators can be set to be on outage. This can be done by setting their :data:`outage <pfnet.Generator.outage>` attribute to ``True``, as the next example shows::
434
+
PFNET provides a way to set components out of service and analyze network contingencies. This can be done by setting the ``in_service`` attribute to ``False``, as the next example shows::
A contingency is represented by an object of type :class:`Contingency <pfnet.Contingency>`, and is characterized by one or more :class:`generator <pfnet.Generator>` or :class:`branch <pfnet.Branch>` outages. The lists of generator and branch outages of a contingency can be specified at construction, or by using the class methods :func:`add_generator_outage() <pfnet.Contingency.add_generator_outage>` and :func:`add_branch_outage() <pfnet.Contingency.add_branch_outage>`, respectively. The following example shows how to construct a contingency::
450
448
451
-
>>> net.clear_outages()
449
+
>>> net.make_all_in_service()
452
450
453
451
>>> gen = net.get_generator(3)
454
452
>>> branch = net.get_branch(2)
@@ -463,18 +461,18 @@ A contingency is represented by an object of type :class:`Contingency <pfnet.Con
463
461
464
462
Once a contingency has been constructed, it can be applied and later cleared. This is done using the class methods :func:`apply() <pfnet.Contingency.apply>` and :func:`clear() <pfnet.Contingency.clear>`. The :func:`apply() <pfnet.Contingency.apply>` method sets the specified generator and branches on outage. The :func:`clear() <pfnet.Contingency.clear>` method undoes the changes made by the :func:`apply() <pfnet.Contingency.apply>` method. The following example shows how to apply and clear contingencies, and illustrates some of the side effects::
More information about network contingencies can be found in the :ref:`API reference <ref_cont>`.
480
478
@@ -575,4 +573,4 @@ It is also possible to add and remove components to a network. This can be done
575
573
>>> print len(bus.generators), len(bus.loads)
576
574
1 1
577
575
578
-
.. warning:: Making |Network| modifications programmatically is not yet guaranteed to be safe. One can easily leave out components with no bus connections, which could lead to errors in the underlying PFNET C library. Also, when adding or removing components from the network, the underlying PFNET C library copies existing data to new memory locations and hence any existing PFNET Python network components can point to invalid C memory locations. It is therefore recommended not to use existing PFNET Python network components adding or removing components of the same type from the network, but instead re-extract them from the updated network using :func:`get_bus() <pfnet.Network.get_bus>`, :func:`get_generator() <pfnet.Network.get_generator>`, etc.
576
+
.. warning:: Making |Network| modifications programmatically is not yet guaranteed to be safe. One can easily leave out components with no bus connections, which could lead to errors in the underlying PFNET C library. Also, when adding or removing components from the network, the underlying PFNET C library copies existing data to new memory locations and hence any existing PFNET Python network components can point to invalid C memory locations. It is therefore recommended not to use existing PFNET Python network components after adding or removing components of the same type from the network, but instead re-extract them from the updated network using :func:`get_bus() <pfnet.Network.get_bus>`, :func:`get_generator() <pfnet.Network.get_generator>`, etc.
Copy file name to clipboardExpand all lines: docs/problems.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,7 +288,7 @@ The matrices and vectors associated with the linear constraints can be extracted
288
288
0.042
289
289
290
290
>>> bus = net.get_bus(5)
291
-
>>> Hi = constr.get_H_single(bus.index_P)
291
+
>>> Hi = constr.get_H_single(bus.dP_index)
292
292
293
293
>>> print type(Hi), Hi.shape, Hi.nnz
294
294
<class 'scipy.sparse.coo.coo_matrix'> (28, 28) 27
@@ -322,7 +322,7 @@ This constraint is associated with the string ``"AC power balance"``. It enforce
322
322
323
323
where :math:`t` are time periods, :math:`P^g` and :math:`Q^g` are generator active and reactive powers, :math:`P^l` and :math:`Q^l` are load active and reactive powers, :math:`S^{sh}` are apparent powers flowing out of buses through shunt devices, :math:`S` are apparent powers flowing out of buses through branches, :math:`n` is the number of buses, :math:`T` is the number of time periods, and :math:`[n] := \{1,\ldots,n\}`.
324
324
325
-
The :class:`Bus <pfnet.Bus>` class attributes :data:`index_P <pfnet.Bus.index_P>` and :data:`index_Q <pfnet.Bus.index_Q>` can be used to obtain the row indices of the constraint function :data:`f <pfnet.ConstraintBase.f>` and Jacobian :data:`J <pfnet.ConstraintBase.J>` that are associated with the active and reactive power mismatches of a specific bus.
325
+
The :class:`Bus <pfnet.Bus>` class attributes :data:`dP_index <pfnet.Bus.dP_index>` and :data:`dQ_index <pfnet.Bus.dQ_index>` can be used to obtain the row indices of the constraint function :data:`f <pfnet.ConstraintBase.f>` and Jacobian :data:`J <pfnet.ConstraintBase.J>` that are associated with the active and reactive power mismatches of a specific bus.
326
326
327
327
.. _prob_constr_DCPF:
328
328
@@ -337,7 +337,7 @@ This constraint is associated with the string ``"DC power balance"``. It enforce
337
337
338
338
where :math:`t` are time periods, :math:`P^g` are generator active powers, :math:`P^l` are load active powers, :math:`b_{km}` are branch susceptances, :math:`\theta_k` are bus voltage angles, :math:`\phi_{km}` are phase shifts of phase-shifting transformers, :math:`n` is the number of buses, :math:`T` is the number of time periods, and :math:`[n] := \{1,\ldots,n\}`.
339
339
340
-
The :class:`Bus <pfnet.Bus>` class attribute :data:`index_P <pfnet.Bus.index_P>` can be used to obtain the row indices of the constraint matrix :data:`A <pfnet.ConstraintBase.A>` and right-hand-side :data:`b <pfnet.ConstraintBase.b>` that are associated with the active (DC) power mismatches of a specific bus.
340
+
The :class:`Bus <pfnet.Bus>` class attribute :data:`dP_index <pfnet.Bus.dP_index>` can be used to obtain the row indices of the constraint matrix :data:`A <pfnet.ConstraintBase.A>` and right-hand-side :data:`b <pfnet.ConstraintBase.b>` that are associated with the active (DC) power mismatches of a specific bus.
0 commit comments