Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS: Master Thesis Dev #782

Draft
wants to merge 63 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f180b73
MS: Master Thesis Dev
staudtMarius Apr 6, 2024
880f276
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius Apr 12, 2024
f1dfe94
Adding config parameters.
staudtMarius Apr 12, 2024
db6a569
Improving and enhancing some implementations.
staudtMarius Apr 14, 2024
72d7a3c
Adding `DCMAlgorithmSupGridSpec`. Small improvement.
staudtMarius Apr 16, 2024
cbd036c
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius Apr 16, 2024
81b2308
Adding `DCMAlgorithmCenGridSpec`. Small improvement.
staudtMarius Apr 16, 2024
fbfa924
Small improvements.
staudtMarius Apr 16, 2024
c476558
Testing and fixing finding of congestions.
staudtMarius Apr 17, 2024
d917c04
Adding iterations to `Optimization` step of the `CongestionManagement`.
staudtMarius Apr 17, 2024
39eb8ca
Adding `AwaitingData` to `GridAgentData`.
staudtMarius Apr 22, 2024
65174a6
Adding `CongestionManagementSupport`.
staudtMarius Apr 23, 2024
f24d81b
Improving `CongestionManagementSupport`.
staudtMarius Apr 23, 2024
30380d8
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius Apr 25, 2024
aac25ff
Adding some function necessary for transformer tapping.
staudtMarius Apr 25, 2024
92622cc
Implementing the remaining code for transformer tapping.
staudtMarius Apr 25, 2024
c30ed4f
Adding some tests. Fixing some issues.
staudtMarius Apr 26, 2024
8589f13
Fixing some issues.
staudtMarius Apr 26, 2024
41cdb43
Fixing some issues.
staudtMarius Apr 26, 2024
838d151
Fixing some issues.
staudtMarius Apr 26, 2024
7ebd70c
Enhancing transformer tapping.
staudtMarius Apr 26, 2024
b5f810d
Enhancing transformer tapping.
staudtMarius Apr 27, 2024
79c71f6
Improving transformer tapping.
staudtMarius Apr 28, 2024
3c468d1
Improving transformer tapping.
staudtMarius Apr 28, 2024
9a8bae3
Improving tests.
staudtMarius Apr 29, 2024
60ac710
Improving tap calculation.
staudtMarius May 3, 2024
f21da0f
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius May 22, 2024
402daf3
Some additions.
staudtMarius May 22, 2024
c3fe3d8
Improve grid merging.
staudtMarius May 22, 2024
b06b110
Saving changes.
staudtMarius May 23, 2024
d6d2cce
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius May 23, 2024
b826977
Fix not stopping correctly on failed power flow if configured to stop
staudtMarius May 24, 2024
6a57f96
Saving changes.
staudtMarius May 24, 2024
90c7452
Enhance logging of power flow failures.
staudtMarius May 24, 2024
3b81a67
Fix simulation stopping at unhandled messages in `DBFSAlgorithm`.
staudtMarius May 31, 2024
180ede0
Merge branch 'dev' into ms/#800-fix-not-stopping-on-power-flow-exception
staudtMarius May 31, 2024
6a28de3
Updating `CHANGELOG`.
staudtMarius May 31, 2024
2846651
Merge branch 'dev' into ms/ma-thesis-dev
staudtMarius May 31, 2024
9719ff0
Merge branch 'ms/#800-fix-not-stopping-on-power-flow-exception' into …
staudtMarius May 31, 2024
9d30c71
Merge branch 'ms/#821-fix-simulation-stopping-at-uhnadled-messages-in…
staudtMarius May 31, 2024
30257e0
Adding more comments and explanations to parts of the code. Updating …
staudtMarius May 31, 2024
9da36a2
Small improvements.
staudtMarius Jun 4, 2024
4bca4b5
Small improvements to `CongestionManagementSupport`.
staudtMarius Jun 4, 2024
b313c06
Enhancing the selection of linking transformers in `DCMAlgorithm`.
staudtMarius Jun 6, 2024
195f9fe
Fixing issue.
staudtMarius Jun 6, 2024
2b1aaf3
Improvements and fixes.
staudtMarius Jun 9, 2024
3dfed33
Updating to `PSDM` version `6.0-SNAPSHOT`.
staudtMarius Jun 16, 2024
784bf66
Improving transformer tapping calculation.
staudtMarius Jun 17, 2024
fc423f5
Adding `TappingGroup`. Improving suggestion calculation in `VoltageRa…
staudtMarius Jun 18, 2024
458d236
Updating the default config.
staudtMarius Jun 18, 2024
d4c20fb
Fixing some issues.
staudtMarius Jun 18, 2024
5c8b7ce
Fixing some issues.
staudtMarius Jun 19, 2024
bbaca15
Improvements.
staudtMarius Jun 20, 2024
77211ff
Improvements.
staudtMarius Jun 21, 2024
88e4ec8
Updating PSDM.
staudtMarius Jun 24, 2024
1395188
Merge branch 'refs/heads/dev' into ms/ma-thesis-dev
staudtMarius Jul 1, 2024
84e6829
Improving the tap calculation.
staudtMarius Jul 2, 2024
ef30d7a
Fixing two bugs.
staudtMarius Jul 2, 2024
b0b616f
Saving changes.
staudtMarius Jul 3, 2024
8a8aab5
Update base config.
staudtMarius Jul 4, 2024
deb1226
Fixing bug in `possibleDeltas()`.
staudtMarius Jul 6, 2024
44a1a10
Fixing bugs in `updateWithInferiorRanges()`.
staudtMarius Jul 6, 2024
8dbccd7
Small improvement.
staudtMarius Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Providing documentation for EmAgent protocols and algorithms [#774](https://github.com/ie3-institute/simona/issues/774)
- Option to flush out `CylindricalStorageResults` [#826](https://github.com/ie3-institute/simona/issues/826)
- Printing the directory of log to terminal upon simulation failure [#626](https://github.com/ie3-institute/simona/issues/626)
- Enhanced Newton-Raphson-PowerFlow failures with more information [#815](https://github.com/ie3-institute/simona/issues/815)

### Changed
- Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435)
Expand Down Expand Up @@ -69,6 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed grid within GridSpec test [#806](https://github.com/ie3-institute/simona/issues/806)
- Fixed log entry after power flow calculation [#814](https://github.com/ie3-institute/simona/issues/814)
- Delete "Indices and tables" on the index page [#375](https://github.com/ie3-institute/simona/issues/375)
- Not stopping correctly on failed power flow if configured to stop [#800](https://github.com/ie3-institute/simona/issues/800)
- Simulation stopping at unhandled messages in `DBFSAlgorithm` [#821](https://github.com/ie3-institute/simona/issues/821)

## [3.0.0] - 2023-08-07

Expand Down
200 changes: 200 additions & 0 deletions input/ma_thesis/ma_thesis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
include "../samples/common/pekko.conf"

pekko.loglevel = "info"

#########
# ATTENTION: Do not change this config file directly but use it as a base for your personal delta config for the
# vn_simona scenario! Delta configs can be created by including the config you want to change
# parameters from via include <path-to-config> (e.g. include "input/samples/vn_simona/vn_simona.conf") at the
# beginning of your config file and then just override the parameters you want to change!
#########

##################################################################
# Simulation Parameters
##################################################################
simona.simulationName = "Szenario-1"

##################################################################
# Time Parameters
##################################################################
simona.time.startDateTime = "2016-07-24T00:00:00Z"
simona.time.endDateTime = "2016-07-31T00:00:00Z"
simona.time.schedulerReadyCheckWindow = 900

##################################################################
# Congestion Management Configuration
##################################################################

simona.congestionManagement.enable = true
simona.congestionManagement.enableTransformerTapping = false
simona.congestionManagement.enableTopologyChanges = false
simona.congestionManagement.useFlexOptions = false

##################################################################
# Grid Configuration
##################################################################

simona.gridConfig.voltageLimits = [
{vMin = 0.95, vMax = 1.05, voltLvls = [{id = "lv", vNom = "0.4 kV"}]},
{vMin = 0.95, vMax = 1.05, voltLvls = [{id = "mv", vNom = "20 kV"}]},
{vMin = 0.95, vMax = 1.05, voltLvls = [{id = "hv", vNom = "110 kV"}]},
]

##################################################################
# Input Parameters
##################################################################
simona.input.primary.csvParams = {
directoryPath: "input/ma_thesis/fullGrid/primary"
csvSep: ","
isHierarchic: false
}
simona.input.grid.datasource.id = "csv"
simona.input.grid.datasource.csvParams = {
directoryPath: "input/ma_thesis/fullGrid"
csvSep: ","
isHierarchic: false
}

simona.input.weather.datasource = {
scheme = "icon"
sampleParams.use = true
coordinateSource.sampleParams.use = true
maxCoordinateDistance = 50000
}

##################################################################
# Output Parameters
##################################################################
simona.output.base.dir = "output/ma_thesis"
simona.output.base.addTimestampToOutputDir = false

simona.output.sink.csv {
fileFormat = ".csv"
filePrefix = ""
fileSuffix = ""
}

simona.output.grid = {
notifier = "grid"
nodes = true
lines = true
switches = true
transformers2w = true
transformers3w = false
congestions = true
}
simona.output.participant.defaultConfig = {
notifier = "default"
powerRequestReply = false
simulationResult = false
}
simona.output.participant.individualConfigs = [
{
notifier = "fixedfeedin"
powerRequestReply = false
simulationResult = true
},
{
notifier = "load"
powerRequestReply = false
simulationResult = true
}
]

simona.output.thermal = {
defaultConfig = {
notifier = "default",
simulationResult = false
}
individualConfigs = []
}

##################################################################
# Runtime Configuration // todo refactor as this naming is misleading and partly unneeded
##################################################################
simona.runtime.selected_subgrids = []
simona.runtime.selected_volt_lvls = []

simona.runtime.participant.load = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
modelBehaviour = "fix"
reference = "power"
}
individualConfigs = []
}

simona.runtime.participant.fixedFeedIn = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

simona.runtime.participant.pv = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

simona.runtime.participant.wec = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

simona.runtime.participant.evcs = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

simona.runtime.participant.hp = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

# # # # #
# ATTENTION: calculateMissingReactivePowerWithModel and scaling is ignored here.
# # # # #
simona.runtime.participant.em = {
defaultConfig = {
calculateMissingReactivePowerWithModel = false
uuids = ["default"]
scaling = 1.0
}
individualConfigs = []
}

##################################################################
# Event Configuration
##################################################################
simona.event.listener = []

##################################################################
# Power Flow Configuration
##################################################################
simona.powerflow.maxSweepPowerDeviation = 1E-5 // the maximum allowed deviation in power between two sweeps, before overall convergence is assumed
simona.powerflow.newtonraphson.epsilon = [1E-9]
simona.powerflow.newtonraphson.iterations = 50
simona.powerflow.resolution = "3600s"
simona.powerflow.stopOnFailure = true

simona.control.transformer = []
25 changes: 25 additions & 0 deletions input/samples/vn_simona/vn_simona.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ simona.output.grid = {
switches = false
transformers2w = false
transformers3w = false
congestions = true
}
simona.output.participant.defaultConfig = {
notifier = "default"
Expand Down Expand Up @@ -190,6 +191,21 @@ simona.gridConfig.refSystems = [
{sNom = "1000 MVA", vNom = "380 kV", voltLvls = [{id = "EHV", vNom = "380 kV"}]}
]

simona.gridConfig.voltageLimits = [
{
vMin = 0.9,
vMax = 1.1,
voltLvls = [
{id = "lv", vNom = "0.4 kV"},
{id = "mv", vNom = "10 kV"},
{id = "mv", vNom = "20 kV"},
{id = "mv", vNom = "30 kV"},
{id = "hv", vNom = "110 kV"},
]},
{vMin = 0.9, vMax = 1.118, voltLvls = [{id = "EHV", vNom = "220 kV"}]},
{vMin = 0.9, vMax = 1.05, voltLvls = [{id = "EHV", vNom = "380 kV"}]},
]

##################################################################
# Power Flow Configuration
##################################################################
Expand All @@ -212,3 +228,12 @@ simona.control.transformer = [
vMax = 1.02
}
]

##################################################################
# Congestion Management Configuration
##################################################################

simona.congestionManagement.enable = false
simona.congestionManagement.enableTransformerTapping = false
simona.congestionManagement.enableTopologyChanges = false
simona.congestionManagement.useFlexOptions = false
25 changes: 25 additions & 0 deletions src/main/resources/config/config-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ RefSystemConfig {
gridIds: [string] # Sub grid numbers to apply to, expl.: 1,2,4..10
}

#@define
VoltageLimitsConfig {
vMin: double # minimal voltage
vMax: double # maximal voltage
#@optional
voltLvls: [VoltLvlConfig] # Voltage levels to apply to
#@optional
gridIds: [string] # Sub grid numbers to apply to, expl.: 1,2,4..10
}

#@define abstract extends !java.io.Serializable
BaseRuntimeConfig {
uuids: [string] # Unique id to identify the system participant models this config applies for
Expand Down Expand Up @@ -136,6 +146,7 @@ GridOutputConfig {
switches: boolean | false
transformers2w: boolean | false
transformers3w: boolean | false
congestions: boolean | false
}

#@define
Expand Down Expand Up @@ -347,6 +358,9 @@ simona.powerflow.stopOnFailure = boolean | false
#@optional
simona.gridConfig.refSystems = [RefSystemConfig]

#@optional
simona.gridConfig.voltageLimits = [VoltageLimitsConfig]

##################################################################
# Event Configuration
##################################################################
Expand All @@ -359,6 +373,17 @@ simona.event.listener = [
}
]

##################################################################
# Congestion Management Configuration
##################################################################

simona.congestionManagement.enable = boolean | false
simona.congestionManagement.enableTransformerTapping = boolean | false
simona.congestionManagement.enableTopologyChanges = boolean | false
simona.congestionManagement.maxOptimizationIterations = int | 1
simona.congestionManagement.useFlexOptions = boolean | false
simona.congestionManagement.timeout = "duration:seconds | 30 seconds" // maximum timeout

##################################################################
# Configuration of Control Schemes
##################################################################
Expand Down
71 changes: 71 additions & 0 deletions src/main/scala/edu/ie3/simona/PrimaryDataFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* © 2024. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/

package edu.ie3.simona;

import java.io.*;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;

public class PrimaryDataFilter {
public static void main(String[] args) {
Path base = Path.of(".", "input", "ma_thesis", "fullGrid");

Path input = base.resolve("primary");
Path output = base.resolve("primary-x1.5");
List<File> files = Arrays.stream(Objects.requireNonNull(input.toFile().listFiles())).toList();

AtomicInteger i = new AtomicInteger(0);

files.forEach(
file -> {
i.addAndGet(1);
System.out.println(i.get());

try {
BufferedReader reader = new BufferedReader(new FileReader(file));
String headline = reader.readLine();
List<String> lines = reader.lines().toList();

Stream<String> stream =
lines.stream()
// .filter(line ->line.contains("2016-07-") || line.contains("2016-08-01"))
.map(line -> multiply(line, 1.5));

String txt = stream.reduce(headline, (a, b) -> a + "\n" + b);

Writer writer =
new OutputStreamWriter(
new FileOutputStream(output.resolve(file.getName()).toFile()));
writer.write(txt);
writer.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}

public static String multiply(String str, double factor) {
String[] arr = str.split(",");

if (arr.length == 2) {
double modified = Double.parseDouble(arr[0]) * factor;

return modified + "," + arr[1];
} else if (arr.length == 3) {
double modified1 = Double.parseDouble(arr[0]) * factor;
double modified2 = Double.parseDouble(arr[1]) * factor;

return modified1 + "," + modified2 + "," + arr[2];
} else {
throw new RuntimeException("Size:" + arr.length);
}
}
}
Loading