openpy-dsse


Nameopenpy-dsse JSON
Version 0.1.4 PyPI version JSON
download
home_page
SummaryOpen source library for state estimation of a distribution network modeled in OpenDSS
upload_time2023-04-22 20:21:04
maintainer
docs_urlNone
authorJorge Lara
requires_python>=3.8,<4.0
licenseLICENSE
keywords opendss dsse state estimation smart grid openpy-dsse openpy_dsse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenPY_DSSE

It is an open-source library developed in Python for estimating distribution networks (DSSE). It communicates with the free software for the simulation of electrical networks ([OpenDSS](https://sourceforge.net/projects/electricdss/)) and collects the results of power flow and distribution system parameters and executes the DSSE, obtaining an estimated state according to the type and location of measurements.

It is developed within the framework of the[ OpenREiD](https://iee-unsjconicet.org/reid/) project (Integral software for simulation and optimization of electrical distribution networks), of the [Instituto de Energía Eléctrica (IEE), UNSJ - CONICET, San Juan - Argentina](https://iee-unsjconicet.org/).

**Index**

- [Weighted Least Squares](#id0)
- [Installation](#id1)
- [How to use](#id2)
  - [Measurements](#id3)
    - [Definition and creation of meters](#id4)
    - [Generate metrics from OpenDSS results](#id5)
  - [Run the state estimation algorithm](#id6)
  - [Sample tests](#id7)
- [License](#id8)

<div id='id0' />

## Weighted Least Squares (WLS)

The library uses a hybrid weighted least squares algorithm that incorporates traditional and D-PMU measurements. It supports single-phase and multiphase networks that are modeled as electromagnetically decoupled positive sequence impedances. More details can be found in [docs/methodology](https://github.com/jlara6/OpenPy-DSSE/blob/main/docs/methodology/Nonlinear_Hybrid_State_Estimator.ipynb)

<div id='id1' />

## Installation

With pip

``pip install py-open-dsse``

Without pip, clone or download the repository, in the dist folder is the .whl file, copy the location of the file, and in the CMD:

``pip install {path-save-files}/openpy_dsse-{version}-py3-none-any.whl’``

<div id='id2'/>

## How to use  <a name="id1"></a>

First, in the IDE (Integrated Development Environment) of preference, we import the library:

```Python
import openpy_dsse
```

The object class that contains all the functions of the library is activated as follows:

```Python
dsse = openpy_dsse.init_DSSE()
```

The class ``init_DSSE()``, has default values as shown in table 1 and can be modified as appropriate.

**Table 1.** Description and attributes of function ``init_DSSE()``
| **Parameters** | **Description** | **Default value** |
|:---:|---|:---:|
| ``Sbas3ph_MVA`` | Three-phase system base power     | ``30`` |
| ``tolerance`` | Convergence tolerance of selected algorithm | ``1e-3`` |
| ``max_iter`` | Maximum number of iterations of the selected algorithm | ``30`` |
| ``init_values`` | Initial values for state estimation. With ``flat`` start with 1.0 p.u. / 0° on all buses and with ``dss`` start with OpenDSS voltage and angle results| ``flat`` |

Once the class is initialized, we can use the functions described below.

<div id='id3' />

### Measurements

<div id='id4' />

#### Definition and creation of meters

The library supports meters and their respective error variance described in Table 2.

**Table 2.** Measurement type of the ``openpy_dsse`` library.

|              **Meter**                 |                                **Description**                |
|:--------------------------------------:|---------------------------------------------------------------|
| $\left\|V_{i}\right\|$                 | Node voltage magnitude.                                       |
| $PQ_{ft}$                              | Branch power flow                                             |
| $\left\|I_{ft}\right\|$                | Magnitude of branch current.                                  |
| $PQ_{i}^{SM}$                          | Injection power or node consumption obtained by a smart meter |
| $PQ_{i}^{0}$                           | Passive node or zero injection power.                         |
| $PQ_{i}^{PSD}$                         | Artificial node injection power known as pseudo-measurement   |
| $\left\|V_{i}\right\|\angle \theta$    | Voltage phasor measurement                                    |
| $\left\|I_{ft}\right\|\angle \delta$   | Current phasor measurement                                              |

The measurement data per phase **𝜌 (1, 2, 3)** and measurement error variance ``Rii`` of a network modeled in OpenDSS. They must be entered in the ``MEAS_Bus_i.json``, ``MEAS_Elem_ft.json``, ``MEAS_Bus_i_PMU.json`` and ``MEAS_Elem_ft_PMU.json`` files. The ``.json`` measurement files without data are generated with the ``empty_MEAS_files()`` function and the parameters from table 3 must be entered.

**Table 3.** Parameters and description of ``empty_file_MEAS()`` function
|    **Parameter**   |                           **Description**                         |**Default value** |
|:------------------:|-------------------------------------------------------------------|:----------------:|
| ``DSS_path``       | A path of the ``.DSS`` files of the circuit modeled in OpenDSS    | ``None ``        |
| ``MEAS_path_save`` | Path where the measurement ``.json`` files will be saved          | ``None ``        |

The description of the identifiers that can be modified is detailed in tables 4, 5, 6, and 7. The other identifiers in the ``.json`` files, are node characteristics or elements extracted from the circuit modeled in OpenDSS, these data should not be modified since they would affect the result of the state estimation algorithm.

**Table 4.** Description of identifiers of the ``MEAS_Bus_i.json`` file.

| **Identifier**     |                                       **Description**                         |
|:---------------------:|-------------------------------------------------------------------------------|
| ``STS_Vm``            | Status (1: Enabled, 0: Disabled)                                              |
| ``Rii_Vm``            | Variance of voltage magnitude measurement error.                              |
| ``Vρm(pu)``           | Measurement of voltage magnitude voltage in phase 𝜌.                          |
| ``STS_PQd(SM)``       | Status (1: Enabled, 0: Disabled)                                              |
| ``Rii_SM``            | Measurement error variance of injection power or consumption of a smart meter.|
| ``STS_PQd(0)``        | Status (1: Enabled, 0: Disabled)                                              |
| ``Rii_0``             | Zero or passive injection power measurement error variance.                   |
| ``STS_PQd(Psd)``      | Status (1: Enabled, 0: Disabled)                                              |
| ``Rii_Psd``           | Measurement error variance of pseudo power injection measurement              |
| ``Pρmd(pu)``          | Measurement of active power injection in phase 𝜌.                             |
| ``Qρmd(pu)``          | Measurement of reactive power injection in phase 𝜌.                           |

**Table 5.** Description of identifiers of the ``MEAS_Elem_ft.json`` file.

| **Identifier**        | **Description**                                    |
|:---------------------:|----------------------------------------------------|
| ``STS_PQft``          | Status (1: Enabled, 0: Disabled)                   |
| ``Rii_PQft``          | Branch power flow measurement error variance.      |
| ``Pρmft(pu)``         | Measurement of branch active power in phase 𝜌.     |
| ``Qρmft(pu)``         | Measurement of branch reactive power in phase 𝜌.   |
| ``STS_Ift``           | Status (1: Enabled, 0: Disabled)                   |
| ``Rii_Ift``           | Branch current magnitude error variance.           |
| ``Iρmft(pu)``         | Measurement of branch current magnitude in phase 𝜌.|

**Table 6.** Description of identifiers of the ``MEAS_Elem_ft_PMU.json`` file.
| **Identifier**     |                   **Description**           |
|:---------------------:|---------------------------------------------|
| ``STS_Vm``            | Status (1: Enabled, 0: Disabled)            |
| ``Rii_Vm``            | Variance of voltage phasor measurement error|
| ``Vρm(pu)``           | Measurement of voltage magnitude in phase 𝜌 |
| ``Angρm(deg)``        | Measurement of volage angle in phase 𝜌      |

**Table 7.** Description of identifiers of the ``MEAS_Elem_ft_PMU.json`` file.
| **Identifier**    |                 **Description**             |
|:-----------------:|---------------------------------------------|
| ``STS_Ift``       | Status (1: Enabled, 0: Disabled)            |
| ``Rii_Ift``       | Variance of current phasor measurement error|
| ``Iρmft(pu)``     | Measurement of current magnitude in phase 𝜌 |
| ``Angρm(deg)``    | Measurement of current angle in phase 𝜌     |

<div id='id5' />

#### Generate metrics from OpenDSS results

##### Initial measurements with uncertainty of measurement error

The ``empty_init_files_MEAS_Unc()`` function generates ``.json`` files where all the nodes and elements that can participate as measurement in the state estimation algorithm are placed. For this purpose, the parameters of table 8 must be specified.

**Table 8.** Parameters and description of ``empty_file_MEAS()`` function
|    **Parameters**   |                           **Description**                     | **Default value** |
|:------------------:|----------------------------------------------------------------|:-----------------:|
| ``DSS_path``       | A path of the ``.DSS`` files of the circuit modeled in OpenDSS | ``None``          |
| ``MEAS_path_save`` | Path where the measurement ``.json`` files will be saved       | ``None``          |

In the ``MEAS_path_save`` path, it generates the files ``Init_Bus_i.json``, ``Init_Elem_ft.json``, ``Init_Bus_i_PMU.json`` and ``Init_Elem_ft_PMU.json``. Depending on the case study, the ``STS`` meter status (1: Enabled, 0: Disabled) and the measurement error rate in ``Unc(%)`` can be modified.

##### Adding random errors and generating measurement files

With the ``.json`` files generated by the ``empty_file_MEAS()`` function and the changes indicated by the user, with the ``add_error_file_MEAS()`` function and the Parameters described in Table 9.

**Table 9.** Description and attributes of function ``add_error_files_MEAS()``
| **Parameters** |                        **Description**                        | **Default value**|
|:--------------:|---------------------------------------------------------------|:----------------:|
| ``DSS_path``   | A path of the ``.DSS`` files of the circuit modeled in OpenDSS| ``None``         |
| ``MEAS_path``  | Path of initial ``.json`` files                               | ``None``         |
| ``seed_DS``    | Random error generation seed                                  | ``1``            |

Adds random errors from a normal distribution to the OpenDSS power flow results, for use as a measurement. The result of generating random errors is contained in the files ``MEAS_Bus_i.json``, ``MEAS_Elem_ft.json``, ``MEAS_Bus_i_PMU.json`` and ``MEAS_Elem_ft_PMU.json``, stored in ``MEAS_path``.

<div id='id6' />

### Run the state estimation algorithm

To run the state estimation algorithm, function ``estimate()`` is called, it is necessary to enter or change parameters detailed in table 10. 

**Table 10.** Parameters and description of ``estimate()`` function

|   **Parameters** |                                   **Description**                                  | **Default value** |
|:----------------:|------------------------------------------------------------------------------------|:---------------------:|
| ``DSS_path``     | A path of the ``.DSS`` files of the circuit modeled in OpenDSS.                    | ``None``              |
| ``MEAS_path``    | Path where measurement files are located.                                          | ``None``              |
| ``path_save``    | Path where the results will be saved                                               | ``None``              |
| ``Typ_cir``      | Circuit type, can be ``1ph`` or ``Pos``.                                           | ``None``              |
| ``ALG``          | Type of algorithm state variables. At the moment ``NV``                            | ``NV``                |
| ``coord``        | Type of coordinates to solve. For the moment ``polar``.                            | ``Polar``             |
| ``method``       | Solution method, can be ``nonlinear``, ``linear_PMU`` and ``nonlinear_PMU``.| ``nonlinear_PMU``|
| ``name_project`` | Project name                                                                       | ``Default``           |
| ``View_res``     | Displays the result of the selected algorithm by console                           | ``False``             |
| ``DSS_coll``     | Displays next to the estimated status, the actual status according to OpenDSS      | ``False``             |
| ``summary``      | Displays a summary of the simulation by console                                    | ``False``             |
| ``MEAS_Pos``     | ``True`` if it is a ``Pos`` circuit, take the ``.json`` files in positive sequence.| ``False``             |

<div id='id7' />

## Sample tests

In the path ``:{Python_library_path}/openpy_dsse/examples``, the ``.DSS`` and ``.json`` files of single-phase (``1ph``) and positive sequence equivalent (``Pos``) circuit measurements detailed in Table 11 are located.

**Table 11.** Sample tests
| **Circuit** | **Tpy_circ** | **Case** |
|:------------:|:------------:|:--------:|
|     4Node    |      1ph     |     1    |
|  [15NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/15NodeIEEE/15NodeIEEE.ipynb)  |      1ph     |     2    |
|  [13NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/13NodeIEEE/13NodeIEEE.ipynb)  |      Pos     |     1    |
|  [37NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/37NodeIEEE/37NodeIEEE.ipynb)  |      Pos     |     2    |

The function ``test_circuit(Typ_cir, case)``, returns a dictionary with the keys ``'DSS_file'``, ``'MEAS_path'``, ``'save_path'``, ``'name_project'`` and ``'Typ_cir'`` which correspond to the ``.DSS`` file path, measurement file path, path where results will be saved and circuit type respectively.
```Python
import openpy_dsse

dsse = openpy_dsse.init_DSSE() #Start the class.

if __name__ == '__main__':
    net = dsse.test_circuit(Typ_cir='1ph', case=1)
    
    #dsse.empty_init_files_MEAS_Unc(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])
    #dsse.add_error_files_MEAS(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])
    #dsse.empty_MEAS_files(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])

    #execute the state estimation algorithm
    Results = dsse.estimate(
        DSS_path=net['DSS_file'],
        MEAS_path=net['MEAS_path'],
        path_save=net['save_path'],
        Typ_cir=net['Typ_cir'],
        name_project=net['name_project'],
        View_res=True,
        summary=True,
        DSS_coll=True,
        #MEAS_Pos=True,
        #method='nonlinear'
        #method='linear_PMU',
    )
```

<div id='id8' />

### License

License: CC BY-NC-SA 4.0

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />

This work has a license <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "openpy-dsse",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "OpenDSS,DSSE,state estimation,smart grid,OpenPy-DSSE,OpenPy_DSSE",
    "author": "Jorge Lara",
    "author_email": "jlara@iee.unsj.edu.ar",
    "download_url": "https://files.pythonhosted.org/packages/20/67/9214c3d8f58b1014797817ac18cd4c74c264d0e57421a2cfa7c4079faf49/openpy_dsse-0.1.4.tar.gz",
    "platform": null,
    "description": "# OpenPY_DSSE\n\nIt is an open-source library developed in Python for estimating distribution networks (DSSE). It communicates with the free software for the simulation of electrical networks ([OpenDSS](https://sourceforge.net/projects/electricdss/)) and collects the results of power flow and distribution system parameters and executes the DSSE, obtaining an estimated state according to the type and location of measurements.\n\nIt is developed within the framework of the[ OpenREiD](https://iee-unsjconicet.org/reid/) project (Integral software for simulation and optimization of electrical distribution networks), of the [Instituto de Energ\u00eda El\u00e9ctrica (IEE), UNSJ - CONICET, San Juan - Argentina](https://iee-unsjconicet.org/).\n\n**Index**\n\n- [Weighted Least Squares](#id0)\n- [Installation](#id1)\n- [How to use](#id2)\n  - [Measurements](#id3)\n    - [Definition and creation of meters](#id4)\n    - [Generate metrics from OpenDSS results](#id5)\n  - [Run the state estimation algorithm](#id6)\n  - [Sample tests](#id7)\n- [License](#id8)\n\n<div id='id0' />\n\n## Weighted Least Squares (WLS)\n\nThe library uses a hybrid weighted least squares algorithm that incorporates traditional and D-PMU measurements. It supports single-phase and multiphase networks that are modeled as electromagnetically decoupled positive sequence impedances. More details can be found in [docs/methodology](https://github.com/jlara6/OpenPy-DSSE/blob/main/docs/methodology/Nonlinear_Hybrid_State_Estimator.ipynb)\n\n<div id='id1' />\n\n## Installation\n\nWith pip\n\n``pip install py-open-dsse``\n\nWithout pip, clone or download the repository, in the dist folder is the .whl file, copy the location of the file, and in the CMD:\n\n``pip install {path-save-files}/openpy_dsse-{version}-py3-none-any.whl\u2019``\n\n<div id='id2'/>\n\n## How to use  <a name=\"id1\"></a>\n\nFirst, in the IDE (Integrated Development Environment) of preference, we import the library:\n\n```Python\nimport openpy_dsse\n```\n\nThe object class that contains all the functions of the library is activated as follows:\n\n```Python\ndsse = openpy_dsse.init_DSSE()\n```\n\nThe class ``init_DSSE()``, has default values as shown in table 1 and can be modified as appropriate.\n\n**Table 1.** Description and attributes of function ``init_DSSE()``\n| **Parameters** | **Description** | **Default value** |\n|:---:|---|:---:|\n| ``Sbas3ph_MVA`` | Three-phase system base power     | ``30`` |\n| ``tolerance`` | Convergence tolerance of selected algorithm | ``1e-3`` |\n| ``max_iter`` | Maximum number of iterations of the selected algorithm | ``30`` |\n| ``init_values`` | Initial values for state estimation. With ``flat`` start with 1.0 p.u. / 0\u00b0 on all buses and with ``dss`` start with OpenDSS voltage and angle results| ``flat`` |\n\nOnce the class is initialized, we can use the functions described below.\n\n<div id='id3' />\n\n### Measurements\n\n<div id='id4' />\n\n#### Definition and creation of meters\n\nThe library supports meters and their respective error variance described in Table 2.\n\n**Table 2.** Measurement type of the ``openpy_dsse`` library.\n\n|              **Meter**                 |                                **Description**                |\n|:--------------------------------------:|---------------------------------------------------------------|\n| $\\left\\|V_{i}\\right\\|$                 | Node voltage magnitude.                                       |\n| $PQ_{ft}$                              | Branch power flow                                             |\n| $\\left\\|I_{ft}\\right\\|$                | Magnitude of branch current.                                  |\n| $PQ_{i}^{SM}$                          | Injection power or node consumption obtained by a smart meter |\n| $PQ_{i}^{0}$                           | Passive node or zero injection power.                         |\n| $PQ_{i}^{PSD}$                         | Artificial node injection power known as pseudo-measurement   |\n| $\\left\\|V_{i}\\right\\|\\angle \\theta$    | Voltage phasor measurement                                    |\n| $\\left\\|I_{ft}\\right\\|\\angle \\delta$   | Current phasor measurement                                              |\n\nThe measurement data per phase **\ud835\udf0c (1, 2, 3)** and measurement error variance ``Rii`` of a network modeled in OpenDSS. They must be entered in the ``MEAS_Bus_i.json``, ``MEAS_Elem_ft.json``, ``MEAS_Bus_i_PMU.json`` and ``MEAS_Elem_ft_PMU.json`` files. The ``.json`` measurement files without data are generated with the ``empty_MEAS_files()`` function and the parameters from table 3 must be entered.\n\n**Table 3.** Parameters and description of ``empty_file_MEAS()`` function\n|    **Parameter**   |                           **Description**                         |**Default value** |\n|:------------------:|-------------------------------------------------------------------|:----------------:|\n| ``DSS_path``       | A path of the ``.DSS`` files of the circuit modeled in OpenDSS    | ``None ``        |\n| ``MEAS_path_save`` | Path where the measurement ``.json`` files will be saved          | ``None ``        |\n\nThe description of the identifiers that can be modified is detailed in tables 4, 5, 6, and 7. The other identifiers in the ``.json`` files, are node characteristics or elements extracted from the circuit modeled in OpenDSS, these data should not be modified since they would affect the result of the state estimation algorithm.\n\n**Table 4.** Description of identifiers of the ``MEAS_Bus_i.json`` file.\n\n| **Identifier**     |                                       **Description**                         |\n|:---------------------:|-------------------------------------------------------------------------------|\n| ``STS_Vm``            | Status (1: Enabled, 0: Disabled)                                              |\n| ``Rii_Vm``            | Variance of voltage magnitude measurement error.                              |\n| ``V\u03c1m(pu)``           | Measurement of voltage magnitude voltage in phase \ud835\udf0c.                          |\n| ``STS_PQd(SM)``       | Status (1: Enabled, 0: Disabled)                                              |\n| ``Rii_SM``            | Measurement error variance of injection power or consumption of a smart meter.|\n| ``STS_PQd(0)``        | Status (1: Enabled, 0: Disabled)                                              |\n| ``Rii_0``             | Zero or passive injection power measurement error variance.                   |\n| ``STS_PQd(Psd)``      | Status (1: Enabled, 0: Disabled)                                              |\n| ``Rii_Psd``           | Measurement error variance of pseudo power injection measurement              |\n| ``P\u03c1md(pu)``          | Measurement of active power injection in phase \ud835\udf0c.                             |\n| ``Q\u03c1md(pu)``          | Measurement of reactive power injection in phase \ud835\udf0c.                           |\n\n**Table 5.** Description of identifiers of the ``MEAS_Elem_ft.json`` file.\n\n| **Identifier**        | **Description**                                    |\n|:---------------------:|----------------------------------------------------|\n| ``STS_PQft``          | Status (1: Enabled, 0: Disabled)                   |\n| ``Rii_PQft``          | Branch power flow measurement error variance.      |\n| ``P\u03c1mft(pu)``         | Measurement of branch active power in phase \ud835\udf0c.     |\n| ``Q\u03c1mft(pu)``         | Measurement of branch reactive power in phase \ud835\udf0c.   |\n| ``STS_Ift``           | Status (1: Enabled, 0: Disabled)                   |\n| ``Rii_Ift``           | Branch current magnitude error variance.           |\n| ``I\u03c1mft(pu)``         | Measurement of branch current magnitude in phase \ud835\udf0c.|\n\n**Table 6.** Description of identifiers of the ``MEAS_Elem_ft_PMU.json`` file.\n| **Identifier**     |                   **Description**           |\n|:---------------------:|---------------------------------------------|\n| ``STS_Vm``            | Status (1: Enabled, 0: Disabled)            |\n| ``Rii_Vm``            | Variance of voltage phasor measurement error|\n| ``V\u03c1m(pu)``           | Measurement of voltage magnitude in phase \ud835\udf0c |\n| ``Ang\u03c1m(deg)``        | Measurement of volage angle in phase \ud835\udf0c      |\n\n**Table 7.** Description of identifiers of the ``MEAS_Elem_ft_PMU.json`` file.\n| **Identifier**    |                 **Description**             |\n|:-----------------:|---------------------------------------------|\n| ``STS_Ift``       | Status (1: Enabled, 0: Disabled)            |\n| ``Rii_Ift``       | Variance of current phasor measurement error|\n| ``I\u03c1mft(pu)``     | Measurement of current magnitude in phase \ud835\udf0c |\n| ``Ang\u03c1m(deg)``    | Measurement of current angle in phase \ud835\udf0c     |\n\n<div id='id5' />\n\n#### Generate metrics from OpenDSS results\n\n##### Initial measurements with uncertainty of measurement error\n\nThe ``empty_init_files_MEAS_Unc()`` function generates ``.json`` files where all the nodes and elements that can participate as measurement in the state estimation algorithm are placed. For this purpose, the parameters of table 8 must be specified.\n\n**Table 8.** Parameters and description of ``empty_file_MEAS()`` function\n|    **Parameters**   |                           **Description**                     | **Default value** |\n|:------------------:|----------------------------------------------------------------|:-----------------:|\n| ``DSS_path``       | A path of the ``.DSS`` files of the circuit modeled in OpenDSS | ``None``          |\n| ``MEAS_path_save`` | Path where the measurement ``.json`` files will be saved       | ``None``          |\n\nIn the ``MEAS_path_save`` path, it generates the files ``Init_Bus_i.json``, ``Init_Elem_ft.json``, ``Init_Bus_i_PMU.json`` and ``Init_Elem_ft_PMU.json``. Depending on the case study, the ``STS`` meter status (1: Enabled, 0: Disabled) and the measurement error rate in ``Unc(%)`` can be modified.\n\n##### Adding random errors and generating measurement files\n\nWith the ``.json`` files generated by the ``empty_file_MEAS()`` function and the changes indicated by the user, with the ``add_error_file_MEAS()`` function and the Parameters described in Table 9.\n\n**Table 9.** Description and attributes of function ``add_error_files_MEAS()``\n| **Parameters** |                        **Description**                        | **Default value**|\n|:--------------:|---------------------------------------------------------------|:----------------:|\n| ``DSS_path``   | A path of the ``.DSS`` files of the circuit modeled in OpenDSS| ``None``         |\n| ``MEAS_path``  | Path of initial ``.json`` files                               | ``None``         |\n| ``seed_DS``    | Random error generation seed                                  | ``1``            |\n\nAdds random errors from a normal distribution to the OpenDSS power flow results, for use as a measurement. The result of generating random errors is contained in the files ``MEAS_Bus_i.json``, ``MEAS_Elem_ft.json``, ``MEAS_Bus_i_PMU.json`` and ``MEAS_Elem_ft_PMU.json``, stored in ``MEAS_path``.\n\n<div id='id6' />\n\n### Run the state estimation algorithm\n\nTo run the state estimation algorithm, function ``estimate()`` is called, it is necessary to enter or change parameters detailed in table 10. \n\n**Table 10.** Parameters and description of ``estimate()`` function\n\n|   **Parameters** |                                   **Description**                                  | **Default value** |\n|:----------------:|------------------------------------------------------------------------------------|:---------------------:|\n| ``DSS_path``     | A path of the ``.DSS`` files of the circuit modeled in OpenDSS.                    | ``None``              |\n| ``MEAS_path``    | Path where measurement files are located.                                          | ``None``              |\n| ``path_save``    | Path where the results will be saved                                               | ``None``              |\n| ``Typ_cir``      | Circuit type, can be ``1ph`` or ``Pos``.                                           | ``None``              |\n| ``ALG``          | Type of algorithm state variables. At the moment ``NV``                            | ``NV``                |\n| ``coord``        | Type of coordinates to solve. For the moment ``polar``.                            | ``Polar``             |\n| ``method``       | Solution method, can be ``nonlinear``, ``linear_PMU`` and ``nonlinear_PMU``.| ``nonlinear_PMU``|\n| ``name_project`` | Project name                                                                       | ``Default``           |\n| ``View_res``     | Displays the result of the selected algorithm by console                           | ``False``             |\n| ``DSS_coll``     | Displays next to the estimated status, the actual status according to OpenDSS      | ``False``             |\n| ``summary``      | Displays a summary of the simulation by console                                    | ``False``             |\n| ``MEAS_Pos``     | ``True`` if it is a ``Pos`` circuit, take the ``.json`` files in positive sequence.| ``False``             |\n\n<div id='id7' />\n\n## Sample tests\n\nIn the path ``:{Python_library_path}/openpy_dsse/examples``, the ``.DSS`` and ``.json`` files of single-phase (``1ph``) and positive sequence equivalent (``Pos``) circuit measurements detailed in Table 11 are located.\n\n**Table 11.** Sample tests\n| **Circuit** | **Tpy_circ** | **Case** |\n|:------------:|:------------:|:--------:|\n|     4Node    |      1ph     |     1    |\n|  [15NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/15NodeIEEE/15NodeIEEE.ipynb)  |      1ph     |     2    |\n|  [13NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/13NodeIEEE/13NodeIEEE.ipynb)  |      Pos     |     1    |\n|  [37NodeIEEE](https://github.com/jlara6/OpenPy-DSSE/blob/main/Sample_tests/37NodeIEEE/37NodeIEEE.ipynb)  |      Pos     |     2    |\n\nThe function ``test_circuit(Typ_cir, case)``, returns a dictionary with the keys ``'DSS_file'``, ``'MEAS_path'``, ``'save_path'``, ``'name_project'`` and ``'Typ_cir'`` which correspond to the ``.DSS`` file path, measurement file path, path where results will be saved and circuit type respectively.\n```Python\nimport openpy_dsse\n\ndsse = openpy_dsse.init_DSSE() #Start the class.\n\nif __name__ == '__main__':\n    net = dsse.test_circuit(Typ_cir='1ph', case=1)\n    \n    #dsse.empty_init_files_MEAS_Unc(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])\n    #dsse.add_error_files_MEAS(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])\n    #dsse.empty_MEAS_files(DSS_path=net['DSS_file'], MEAS_path=net['MEAS_path'])\n\n    #execute the state estimation algorithm\n    Results = dsse.estimate(\n        DSS_path=net['DSS_file'],\n        MEAS_path=net['MEAS_path'],\n        path_save=net['save_path'],\n        Typ_cir=net['Typ_cir'],\n        name_project=net['name_project'],\n        View_res=True,\n        summary=True,\n        DSS_coll=True,\n        #MEAS_Pos=True,\n        #method='nonlinear'\n        #method='linear_PMU',\n    )\n```\n\n<div id='id8' />\n\n### License\n\nLicense: CC BY-NC-SA 4.0\n\n<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" /></a><br />\n\nThis work has a license <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.\n\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "Open source library for state estimation of a distribution network modeled in OpenDSS",
    "version": "0.1.4",
    "split_keywords": [
        "opendss",
        "dsse",
        "state estimation",
        "smart grid",
        "openpy-dsse",
        "openpy_dsse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a59217ad4b528771141d622c5043a0ecf8cf37b534e1fe8ca54ddc5e7748f2e2",
                "md5": "64363f633dbc0462d3aba69b2484b92a",
                "sha256": "d51c150bf7ec0cf9c432d19fcba3e39f648ef90ddcf74559b8028523a3e715a3"
            },
            "downloads": -1,
            "filename": "openpy_dsse-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64363f633dbc0462d3aba69b2484b92a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 742255,
            "upload_time": "2023-04-22T20:21:00",
            "upload_time_iso_8601": "2023-04-22T20:21:00.742579Z",
            "url": "https://files.pythonhosted.org/packages/a5/92/17ad4b528771141d622c5043a0ecf8cf37b534e1fe8ca54ddc5e7748f2e2/openpy_dsse-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20679214c3d8f58b1014797817ac18cd4c74c264d0e57421a2cfa7c4079faf49",
                "md5": "c470bc0f87f10f17039dfc204b8c4f38",
                "sha256": "271d95299c09fb82a3f3ea2148f62ed6cf61674f72db0259ac773425ff10b1b8"
            },
            "downloads": -1,
            "filename": "openpy_dsse-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c470bc0f87f10f17039dfc204b8c4f38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 710533,
            "upload_time": "2023-04-22T20:21:04",
            "upload_time_iso_8601": "2023-04-22T20:21:04.920423Z",
            "url": "https://files.pythonhosted.org/packages/20/67/9214c3d8f58b1014797817ac18cd4c74c264d0e57421a2cfa7c4079faf49/openpy_dsse-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-22 20:21:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "openpy-dsse"
}
        
Elapsed time: 0.07350s