Skip to content

Commit

Permalink
Merge pull request #644 from PowerGridModel/feature/source-calculatio…
Browse files Browse the repository at this point in the history
…n-using-ybus

Use YBus to calculate source injection in power flow
  • Loading branch information
mgovers authored Jun 20, 2024
2 parents e2652ff + 2287bc5 commit 0e53a83
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 0 deletions.
56 changes: 56 additions & 0 deletions tests/data/power_flow/source-big-sk/asym_output_batch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "1.0",
"type": "asym_output",
"is_batch": true,
"attributes": {},
"data": [
{
"node": [
{"id": 1, "energized": 1, "u_pu": [1, 1, 1]},
{"id": 2, "energized": 1, "u_pu": [0.9, 0.9, 0.9]}
],
"line": [
{"id": 4, "energized": 1, "q_from": [10, 10, 10], "q_to": [-9, -9, -9]}
],
"source": [
{"id": 6, "energized": 0, "q": [0, 0, 0]},
{"id": 7, "energized": 1, "q": [10, 10, 10]}
],
"sym_load": [
{"id": 8, "energized": 1, "q": [9, 9, 9]}
]
},
{
"node": [
{"id": 1, "energized": 1, "u_pu": [1, 1, 1]},
{"id": 2, "energized": 1, "u_pu": [0.9, 0.9, 0.9]}
],
"line": [
{"id": 4, "energized": 1, "q_from": [10, 10, 10], "q_to": [-9, -9, -9]}
],
"source": [
{"id": 6, "energized": 1, "q": [10, 10, 10]},
{"id": 7, "energized": 0, "q": [0, 0, 0]}
],
"sym_load": [
{"id": 8, "energized": 1, "q": [9, 9, 9]}
]
},
{
"node": [
{"id": 1, "energized": 1, "u_pu": [1, 1, 1]},
{"id": 2, "energized": 1, "u_pu": [0.9, 0.9, 0.9]}
],
"line": [
{"id": 4, "energized": 1, "q_from": [10, 10, 10], "q_to": [-9, -9, -9]}
],
"source": [
{"id": 6, "energized": 1, "q": [4, 4, 4]},
{"id": 7, "energized": 1, "q": [6, 6, 6]}
],
"sym_load": [
{"id": 8, "energized": 1, "q": [9, 9, 9]}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
64 changes: 64 additions & 0 deletions tests/data/power_flow/source-big-sk/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": "1.0",
"type": "input",
"is_batch": false,
"attributes": {},
"data": {
"node": [
{
"id": 1,
"u_rated": 30.0
},
{
"id": 2,
"u_rated": 30.0
}
],
"line": [
{
"id": 4,
"from_node": 1,
"to_node": 2,
"from_status": 1,
"to_status": 1,
"r1": 0.0,
"x1": 3.0,
"c1": 0.0,
"tan1": 0.0,
"r0": 2.0,
"x0": 5.0,
"c0": 0.0,
"tan0": 0.0,
"i_n": 1e3
}
],
"source": [
{
"id": 6,
"node": 1,
"status": 0,
"u_ref": 1.0,
"sk": 2e50,
"rx_ratio": 0.1
},
{
"id": 7,
"node": 1,
"status": 0,
"u_ref": 1.0,
"sk": 3e50,
"rx_ratio": 0.1
}
],
"sym_load": [
{
"id": 8,
"node": 2,
"status": 1,
"type": 0,
"p_specified": 0.0,
"q_specified": 27.0
}
]
}
}
3 changes: 3 additions & 0 deletions tests/data/power_flow/source-big-sk/input.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
8 changes: 8 additions & 0 deletions tests/data/power_flow/source-big-sk/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"calculation_method": ["newton_raphson", "iterative_current"],
"rtol": 1e-6,
"atol": 1e-6,
"fail": {
"reason": "Source injection calculation #458"
}
}
3 changes: 3 additions & 0 deletions tests/data/power_flow/source-big-sk/params.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
56 changes: 56 additions & 0 deletions tests/data/power_flow/source-big-sk/sym_output_batch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "1.0",
"type": "sym_output",
"is_batch": true,
"attributes": {},
"data": [
{
"node": [
{"id": 1, "energized": 1, "u_pu": 1, "u": 30},
{"id": 2, "energized": 1, "u_pu": 0.9, "u": 27}
],
"line": [
{"id": 4, "energized": 1, "q_from": 30, "q_to": -27}
],
"source": [
{"id": 6, "energized": 0, "q": 0},
{"id": 7, "energized": 1, "q": 30}
],
"sym_load": [
{"id": 8, "energized": 1, "q": 27}
]
},
{
"node": [
{"id": 1, "energized": 1, "u_pu": 1, "u": 30},
{"id": 2, "energized": 1, "u_pu": 0.9, "u": 27}
],
"line": [
{"id": 4, "energized": 1, "q_from": 30, "q_to": -27}
],
"source": [
{"id": 6, "energized": 1, "q": 30},
{"id": 7, "energized": 0, "q": 0}
],
"sym_load": [
{"id": 8, "energized": 1, "q": 27}
]
},
{
"node": [
{"id": 1, "energized": 1, "u_pu": 1, "u": 30},
{"id": 2, "energized": 1, "u_pu": 0.9, "u": 27}
],
"line": [
{"id": 4, "energized": 1, "q_from": 30, "q_to": -27}
],
"source": [
{"id": 6, "energized": 1, "q": 12},
{"id": 7, "energized": 1, "q": 18}
],
"sym_load": [
{"id": 8, "energized": 1, "q": 27}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
44 changes: 44 additions & 0 deletions tests/data/power_flow/source-big-sk/update_batch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "1.0",
"type": "update",
"is_batch": true,
"attributes": {},
"data": [
{
"source": [
{
"id": 6,
"status": 0
},
{
"id": 7,
"status": 1
}
]
},
{
"source": [
{
"id": 6,
"status": 1
},
{
"id": 7,
"status": 0
}
]
},
{
"source": [
{
"id": 6,
"status": 1
},
{
"id": 7,
"status": 1
}
]
}
]
}
3 changes: 3 additions & 0 deletions tests/data/power_flow/source-big-sk/update_batch.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0

0 comments on commit 0e53a83

Please sign in to comment.