-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/csv-dir-store
- Loading branch information
Showing
7 changed files
with
177 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model IO project <[email protected]> | ||
SPDX-License-Identifier: MPL-2.0 | ||
--> | ||
|
||
# Vision converter | ||
|
||
The vision converter converts the excel exports of vision to PGM data. As mentioned in [Converters](converters/converter.md), vision converter is an implementation of the tabular converter. | ||
The mapping of all attributes is stored in the `vision_en.yaml` and `vision_nl.yaml` files in [config](https://github.com/alliander-opensource/power-grid-model-io/tree/main/src/power_grid_model_io/config) directory. | ||
|
||
## Load rate of elements | ||
|
||
Certain `elements` in vision, ie. appliances like transformer loads and induction motor have a result parameter of load rate. | ||
In vision the load rate is calculated without considering the simultaneity factor of the connected node. | ||
So we may observe a variation in power inflow/outflow result (ie. P,Q and S) due to different simultaneity factors. But the load rate always corresponds to `simultaneity of loads=1`. | ||
|
||
When we make conversion to PGM, the input data attributes of PGM for loads like `p_specified` and `q_specified` are modified as per simultaneity. The resulting loading then takes simultaneity into account. | ||
**Hence, the loading of such elements may not correspond to the load rate obtained in vision** | ||
|
||
## Transformer load modelling | ||
|
||
power-grid-model-io converts the transformer load into a individual transformer and a load for usage in power-grid-model. | ||
In vision, the modelling of a transformer load seems to be different from an individual transformer and load. | ||
There is a minor difference in both in the reactive power consumed/generated. | ||
This can correspond to a minor voltage deviation too in the results. | ||
|
||
```{tip} | ||
It is recommended to split the transformer load into a individual components in vision beforehand to avoid this issue. | ||
This can be done by first selecting the transformer loads: (Start | Select | Object -> Element -> Check Transformer load, Ok) | ||
Then split it into individual components: (Start | Edit | Topological | Split) | ||
``` | ||
|
||
## Voltage angle of buses in symmetric power-flow | ||
|
||
Note that vision does not include clock angles of transformer for symmetrical calculations in the result of voltage angles. power-grid-model however does consider them so a direct comparison of angle results needs to be done with this knowledge. | ||
|
||
## Modelling differences or unsupported attributes | ||
|
||
Some components are yet to be modelled for conversions because they might not have a straightforward mapping in power-grid-model. Those are listed here. | ||
|
||
- power-grid-model currently does not support PV(Active Power-Voltage) bus and related corresponding features. | ||
- Currently, the efficiency type of PVs(Photovoltaics) element is also unsupported for all types except the `100%` type. | ||
- The conversions for load behaviors of `industry`, `residential`, `business` are not yet modelled. The load behaviors usually do not create a significant difference in power-flow results for most grids when the voltage at bus is close to 1 p.u. Hence, the conversion of the mentioned load behaviors is approximated to be of `Constant Power` type for now. | ||
- The source bus in PGM is mapped with a source impedance. `Sk"nom`, `R/X` and `Z0/Z1` are the attributes used in modelling source impedance. In vision, these attributes are used only for short circuit calculations | ||
- A minor difference in results is expected since Vision uses a power mismatch in p.u. as convergence criteria whereas power-grid-model uses voltage mismatch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
""" | ||
General regular expressions | ||
""" | ||
|
||
import re | ||
|
||
TRAFO_CONNECTION_RE = re.compile(r"^(Y|YN|D|Z|ZN)(y|yn|d|z|zn)(\d|1[0-2])?$") | ||
r""" | ||
Regular expressions to the winding_from and winding_to codes and optionally the clock number: | ||
^ Start of the string | ||
(Y|YN|D|Z|ZN) From winding type | ||
(y|yn|d|z|zn) To winding type | ||
(\d|1[0-2])? Optional clock number (0-12) | ||
$ End of the string | ||
""" | ||
|
||
TRAFO3_CONNECTION_RE = re.compile(r"^(Y|YN|D|Z|ZN)(y|yn|d|z|zn)(y|yn|d|z|zn)(\d|1[0-2])?$") | ||
r""" | ||
Regular expressions to the winding_1, winding_2 and winding_3 codes and optionally the clock number: | ||
^ Start of the string | ||
(Y|YN|D|Z|ZN) First winding type | ||
(y|yn|d|z|zn) Second winding type | ||
(y|yn|d|z|zn) Third winding type | ||
(\d|1[0-2])? Optional clock number (0-12) | ||
$ End of the string | ||
""" | ||
|
||
NODE_REF_RE = re.compile(r"^(.+_)?node(_.+)?$") | ||
r""" | ||
Regular expressions to match the word node with an optional prefix or suffix, e.g.: | ||
- node | ||
- from_node | ||
- node_1 | ||
^ Start of the string | ||
(.+_)? Optional prefix, ending with an underscore | ||
node The word 'node' | ||
(_.+)? Optional suffix, starting with in an underscore | ||
$ End of the string | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
import pytest | ||
|
||
from power_grid_model_io.utils.regex import NODE_REF_RE, TRAFO3_CONNECTION_RE, TRAFO_CONNECTION_RE | ||
|
||
|
||
def test_trafo_connection__pos(): | ||
assert TRAFO_CONNECTION_RE.fullmatch("Dyn").groups() == ("D", "yn", None) | ||
assert TRAFO_CONNECTION_RE.fullmatch("Yyn").groups() == ("Y", "yn", None) | ||
assert TRAFO_CONNECTION_RE.fullmatch("Yzn").groups() == ("Y", "zn", None) | ||
assert TRAFO_CONNECTION_RE.fullmatch("YNy").groups() == ("YN", "y", None) | ||
assert TRAFO_CONNECTION_RE.fullmatch("Dy5").groups() == ("D", "y", "5") | ||
assert TRAFO_CONNECTION_RE.fullmatch("Dy11").groups() == ("D", "y", "11") | ||
|
||
|
||
def test_trafo_connection__neg(): | ||
assert not TRAFO_CONNECTION_RE.fullmatch("Xyn") | ||
assert not TRAFO_CONNECTION_RE.fullmatch("yyn") | ||
assert not TRAFO_CONNECTION_RE.fullmatch("YZN") | ||
assert not TRAFO_CONNECTION_RE.fullmatch("YNx") | ||
assert not TRAFO_CONNECTION_RE.fullmatch("Dy13") | ||
assert not TRAFO_CONNECTION_RE.fullmatch("Dy-1") | ||
|
||
|
||
def test_trafo3_connection__pos(): | ||
assert TRAFO3_CONNECTION_RE.fullmatch("Dynyn").groups() == ("D", "yn", "yn", None) | ||
assert TRAFO3_CONNECTION_RE.fullmatch("Yynd").groups() == ("Y", "yn", "d", None) | ||
assert TRAFO3_CONNECTION_RE.fullmatch("Yzny").groups() == ("Y", "zn", "y", None) | ||
assert TRAFO3_CONNECTION_RE.fullmatch("YNdz").groups() == ("YN", "d", "z", None) | ||
assert TRAFO3_CONNECTION_RE.fullmatch("Dyy5").groups() == ("D", "y", "y", "5") | ||
assert TRAFO3_CONNECTION_RE.fullmatch("Dyd11").groups() == ("D", "y", "d", "11") | ||
|
||
|
||
def test_trafo3_connection__neg(): | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("Xynd") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("ydyn") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("DYZN") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("YNxd") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("Dyd13") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("DyD13") | ||
assert not TRAFO3_CONNECTION_RE.fullmatch("Dynd-1") | ||
|
||
|
||
def test_node_ref__pos(): | ||
assert NODE_REF_RE.fullmatch("node") | ||
assert NODE_REF_RE.fullmatch("from_node") | ||
assert NODE_REF_RE.fullmatch("to_node") | ||
assert NODE_REF_RE.fullmatch("node_1") | ||
assert NODE_REF_RE.fullmatch("node_2") | ||
assert NODE_REF_RE.fullmatch("node_3") | ||
|
||
|
||
def test_node_ref__neg(): | ||
assert not NODE_REF_RE.fullmatch("nodes") | ||
assert not NODE_REF_RE.fullmatch("anode") | ||
assert not NODE_REF_RE.fullmatch("immunodeficient") |