Skip to content

Commit

Permalink
Adjusted to correct definition of uniformity
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
  • Loading branch information
figueroa1395 committed Nov 4, 2024
1 parent 2497f3e commit 5bc7cf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions docs/examples/Power Flow Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@
"id": "f5179288",
"metadata": {},
"source": [
"Optional IDs for an update in columnar-data format are supported for uniform updates"
"Optional IDs for an update in columnar-data format are supported for uniform components"
]
},
{
Expand All @@ -684,9 +684,11 @@
"# leave to-side swiching status the same, no need to specify\n",
"\n",
"columnar_bad_update_line = {\n",
" \"from_status\": np.array([0], dtype=line_update_dtype[\"from_status\"]), # This is a bad update, as it is not uniform.\n",
" \"from_status\": np.array(\n",
" [0, 1], dtype=line_update_dtype[\"from_status\"]\n",
" ), # This is a bad update, as it is not uniform.\n",
"}\n",
"# This will throw an error.\n",
"# This would throw a ValidationException and may generate undefined behaviour.\n",
"\n",
"update_data = {ComponentType.sym_load: update_sym_load, ComponentType.line: columnar_no_ID_update_line}"
]
Expand Down Expand Up @@ -1377,16 +1379,16 @@
"output_type": "stream",
"text": [
"Node data with invalid results\n",
"[[0.99940117 0.99268579 0.99452137]\n",
" [0.99934769 0.98622639 0.98935286]\n",
" [0.99928838 0.97965401 0.98409554]\n",
" [0. 0. 0. ]\n",
" [0.99915138 0.96614948 0.97329879]\n",
" [0.99907317 0.95920586 0.96775071]\n",
" [0.9989881 0.95212621 0.96209647]\n",
" [0. 0. 0. ]\n",
" [0.99879613 0.93753005 0.95044796]\n",
" [0.9986885 0.92999747 0.94444167]]\n",
"[[9.99401170e-001 9.92685785e-001 9.94521366e-001]\n",
" [9.99347687e-001 9.86226389e-001 9.89352855e-001]\n",
" [9.99288384e-001 9.79654011e-001 9.84095542e-001]\n",
" [8.48798316e-313 8.48798316e-313 1.10343781e-312]\n",
" [9.99151380e-001 9.66149483e-001 9.73298790e-001]\n",
" [9.99073166e-001 9.59205860e-001 9.67750710e-001]\n",
" [9.98988099e-001 9.52126208e-001 9.62096474e-001]\n",
" [4.66231806e-310 6.93030286e-310 6.93030286e-310]\n",
" [9.98796126e-001 9.37530046e-001 9.50447962e-001]\n",
" [9.98688504e-001 9.29997471e-001 9.44441670e-001]]\n",
"Node data with only valid results\n",
"[[0.99940117 0.99268579 0.99452137]\n",
" [0.99934769 0.98622639 0.98935286]\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/user_manual/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The base type for all power-grid-model components.
| ---- | --------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :----------------------------------------------------------------------------: |
| `id` | `int32_t` | - | ID of a component. The ID should be unique across all components within the same scenario, e.g., you cannot have a node with `id=5` and another line with `id=5`. | &#10004; | &#10060; (If a component update is uniform (See below), the ID can be omitted or set to `nan`. Otherwise, the id needs to be specified in the update query, but cannot be changed) |

A component update is uniform when the number of elements is consistent across all scenarios and matches the number of elements in the input data for that component. Therefore, the ID is not optional for updates on sparse data, and when the ID of a component is ommited, the updated field must be explicit across all scenarios (even if it is not always updated). An example of the usage of optional IDs is given in [Power Flow Example](./Power%20Flow%20Example.ipynb)
A uniform component is defined as one in which every scenario modifies the same number of elements within that component. Therefore, a dense component is always uniform, hence the ID can be optional; whereas a sparse component may or may not be uniform. An example of the usage of optional IDs is given in [Power Flow Example](./Power%20Flow%20Example.ipynb)

#### Steady state output and Short circuit output

Expand Down

0 comments on commit 5bc7cf5

Please sign in to comment.