Skip to content

Commit 3ed7d1e

Browse files
committed
Adding updated BdewStandardLoadProfiles.
1 parent c2e4878 commit 3ed7d1e

File tree

19 files changed

+1680
-163
lines changed

19 files changed

+1680
-163
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Implemented GitHub Actions for automatic code integration. [#1237](https://github.com/ie3-institute/PowerSystemDataModel/issues/1237)
1111
- Added `CopyBuilders` to `Line-/Transformer2W-/Tranformer3WTypeInput` [#1275](https://github.com/ie3-institute/PowerSystemDataModel/issues/1275)
1212
- Implementing auto-merge for dependabot PRs [#1299](https://github.com/ie3-institute/PowerSystemDataModel/issues/1299)
13+
- Added updated `BdewStandardLoadProfiles` [#1292](https://github.com/ie3-institute/PowerSystemDataModel/issues/1292)
1314

1415
### Fixed
1516
- Fixed SonarQube junit path issue in GitHub Actions [#1284](https://github.com/ie3-institute/PowerSystemDataModel/issues/1284)

src/main/java/edu/ie3/datamodel/io/factory/timeseries/BdewLoadProfileFactory.java

Lines changed: 154 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
import edu.ie3.datamodel.models.timeseries.repetitive.BdewLoadProfileTimeSeries;
1616
import edu.ie3.datamodel.models.timeseries.repetitive.LoadProfileEntry;
1717
import edu.ie3.datamodel.models.value.load.BdewLoadValues;
18+
import edu.ie3.datamodel.models.value.load.BdewLoadValues.BDEW1999;
19+
import edu.ie3.datamodel.models.value.load.BdewLoadValues.BDEW2025;
20+
import edu.ie3.util.quantities.PowerSystemUnits;
1821
import java.util.*;
1922
import java.util.function.Function;
2023
import java.util.stream.Stream;
@@ -25,6 +28,7 @@
2528

2629
public class BdewLoadProfileFactory
2730
extends LoadProfileFactory<BdewStandardLoadProfile, BdewLoadValues> {
31+
// 1999 profile scheme
2832
public static final String SUMMER_SATURDAY = "SuSa";
2933
public static final String SUMMER_SUNDAY = "SuSu";
3034
public static final String SUMMER_WEEKDAY = "SuWd";
@@ -35,6 +39,44 @@ public class BdewLoadProfileFactory
3539
public static final String WINTER_SUNDAY = "WiSu";
3640
public static final String WINTER_WEEKDAY = "WiWd";
3741

42+
// 2025 profile scheme
43+
public static final String JANUARY_SATURDAY = "JanSa";
44+
public static final String JANUARY_SUNDAY = "JanSu";
45+
public static final String JANUARY_WEEKDAY = "JanWd";
46+
public static final String FEBRUARY_SATURDAY = "FebSa";
47+
public static final String FEBRUARY_SUNDAY = "FebSu";
48+
public static final String FEBRUARY_WEEKDAY = "FebWd";
49+
public static final String MARCH_SATURDAY = "MarSa";
50+
public static final String MARCH_SUNDAY = "MarSu";
51+
public static final String MARCH_WEEKDAY = "MarWd";
52+
public static final String APRIL_SATURDAY = "AprSa";
53+
public static final String APRIL_SUNDAY = "AprSu";
54+
public static final String APRIL_WEEKDAY = "AprWd";
55+
public static final String MAY_SATURDAY = "MaySa";
56+
public static final String MAY_SUNDAY = "MaySu";
57+
public static final String MAY_WEEKDAY = "MayWd";
58+
public static final String JUNE_SATURDAY = "JunSa";
59+
public static final String JUNE_SUNDAY = "JunSu";
60+
public static final String JUNE_WEEKDAY = "JunWd";
61+
public static final String JULY_SATURDAY = "JulSa";
62+
public static final String JULY_SUNDAY = "JulSu";
63+
public static final String JULY_WEEKDAY = "JulWd";
64+
public static final String AUGUST_SATURDAY = "AugSa";
65+
public static final String AUGUST_SUNDAY = "AugSu";
66+
public static final String AUGUST_WEEKDAY = "AugWd";
67+
public static final String SEPTEMBER_SATURDAY = "SepSa";
68+
public static final String SEPTEMBER_SUNDAY = "SepSu";
69+
public static final String SEPTEMBER_WEEKDAY = "SepWd";
70+
public static final String OCTOBER_SATURDAY = "OctSa";
71+
public static final String OCTOBER_SUNDAY = "OctSu";
72+
public static final String OCTOBER_WEEKDAY = "OctWd";
73+
public static final String NOVEMBER_SATURDAY = "NovSa";
74+
public static final String NOVEMBER_SUNDAY = "NovSu";
75+
public static final String NOVEMBER_WEEKDAY = "NovWd";
76+
public static final String DECEMBER_SATURDAY = "DecSa";
77+
public static final String DECEMBER_SUNDAY = "DecSu";
78+
public static final String DECEMBER_WEEKDAY = "DecWd";
79+
3880
public BdewLoadProfileFactory() {
3981
this(BdewLoadValues.class);
4082
}
@@ -47,18 +89,64 @@ public BdewLoadProfileFactory(Class<BdewLoadValues> valueClass) {
4789
protected LoadProfileEntry<BdewLoadValues> buildModel(LoadProfileData<BdewLoadValues> data) {
4890
int quarterHour = data.getInt(QUARTER_HOUR);
4991

50-
return new LoadProfileEntry<>(
51-
new BdewLoadValues(
52-
data.getDouble(SUMMER_SATURDAY),
53-
data.getDouble(SUMMER_SUNDAY),
54-
data.getDouble(SUMMER_WEEKDAY),
55-
data.getDouble(TRANSITION_SATURDAY),
56-
data.getDouble(TRANSITION_SUNDAY),
57-
data.getDouble(TRANSITION_WEEKDAY),
58-
data.getDouble(WINTER_SATURDAY),
59-
data.getDouble(WINTER_SUNDAY),
60-
data.getDouble(WINTER_WEEKDAY)),
61-
quarterHour);
92+
boolean is1999Scheme = data.containsKey(SUMMER_SATURDAY);
93+
94+
BdewLoadValues values;
95+
96+
if (is1999Scheme) {
97+
values =
98+
new BDEW1999(
99+
data.getDouble(SUMMER_SATURDAY),
100+
data.getDouble(SUMMER_SUNDAY),
101+
data.getDouble(SUMMER_WEEKDAY),
102+
data.getDouble(TRANSITION_SATURDAY),
103+
data.getDouble(TRANSITION_SUNDAY),
104+
data.getDouble(TRANSITION_WEEKDAY),
105+
data.getDouble(WINTER_SATURDAY),
106+
data.getDouble(WINTER_SUNDAY),
107+
data.getDouble(WINTER_WEEKDAY));
108+
} else {
109+
values =
110+
new BDEW2025(
111+
data.getDouble(JANUARY_SATURDAY),
112+
data.getDouble(JANUARY_SUNDAY),
113+
data.getDouble(JANUARY_WEEKDAY),
114+
data.getDouble(FEBRUARY_SATURDAY),
115+
data.getDouble(FEBRUARY_SUNDAY),
116+
data.getDouble(FEBRUARY_WEEKDAY),
117+
data.getDouble(MARCH_SATURDAY),
118+
data.getDouble(MARCH_SUNDAY),
119+
data.getDouble(MARCH_WEEKDAY),
120+
data.getDouble(APRIL_SATURDAY),
121+
data.getDouble(APRIL_SUNDAY),
122+
data.getDouble(APRIL_WEEKDAY),
123+
data.getDouble(MAY_SATURDAY),
124+
data.getDouble(MAY_SUNDAY),
125+
data.getDouble(MAY_WEEKDAY),
126+
data.getDouble(JUNE_SATURDAY),
127+
data.getDouble(JUNE_SUNDAY),
128+
data.getDouble(JUNE_WEEKDAY),
129+
data.getDouble(JULY_SATURDAY),
130+
data.getDouble(JULY_SUNDAY),
131+
data.getDouble(JULY_WEEKDAY),
132+
data.getDouble(AUGUST_SATURDAY),
133+
data.getDouble(AUGUST_SUNDAY),
134+
data.getDouble(AUGUST_WEEKDAY),
135+
data.getDouble(SEPTEMBER_SATURDAY),
136+
data.getDouble(SEPTEMBER_SUNDAY),
137+
data.getDouble(SEPTEMBER_WEEKDAY),
138+
data.getDouble(OCTOBER_SATURDAY),
139+
data.getDouble(OCTOBER_SUNDAY),
140+
data.getDouble(OCTOBER_WEEKDAY),
141+
data.getDouble(NOVEMBER_SATURDAY),
142+
data.getDouble(NOVEMBER_SUNDAY),
143+
data.getDouble(NOVEMBER_WEEKDAY),
144+
data.getDouble(DECEMBER_SATURDAY),
145+
data.getDouble(DECEMBER_SUNDAY),
146+
data.getDouble(DECEMBER_WEEKDAY));
147+
}
148+
149+
return new LoadProfileEntry<>(values, quarterHour);
62150
}
63151

64152
@Override
@@ -74,7 +162,46 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
74162
TRANSITION_WEEKDAY,
75163
WINTER_SATURDAY,
76164
WINTER_SUNDAY,
77-
WINTER_WEEKDAY));
165+
WINTER_WEEKDAY),
166+
newSet(
167+
JANUARY_SATURDAY,
168+
JANUARY_SUNDAY,
169+
JANUARY_WEEKDAY,
170+
FEBRUARY_SATURDAY,
171+
FEBRUARY_SUNDAY,
172+
FEBRUARY_WEEKDAY,
173+
MARCH_SATURDAY,
174+
MARCH_SUNDAY,
175+
MARCH_WEEKDAY,
176+
APRIL_SATURDAY,
177+
APRIL_SUNDAY,
178+
APRIL_WEEKDAY,
179+
MAY_SATURDAY,
180+
MAY_SUNDAY,
181+
MAY_WEEKDAY,
182+
JUNE_SATURDAY,
183+
JUNE_SUNDAY,
184+
JUNE_WEEKDAY,
185+
JULY_SATURDAY,
186+
JULY_SUNDAY,
187+
JULY_WEEKDAY,
188+
AUGUST_SATURDAY,
189+
AUGUST_SUNDAY,
190+
AUGUST_WEEKDAY,
191+
SEPTEMBER_SATURDAY,
192+
SEPTEMBER_SUNDAY,
193+
SEPTEMBER_WEEKDAY,
194+
OCTOBER_SATURDAY,
195+
OCTOBER_SUNDAY,
196+
OCTOBER_SUNDAY,
197+
OCTOBER_WEEKDAY,
198+
NOVEMBER_SATURDAY,
199+
NOVEMBER_SUNDAY,
200+
NOVEMBER_WEEKDAY,
201+
DECEMBER_SATURDAY,
202+
DECEMBER_SUNDAY,
203+
DECEMBER_WEEKDAY,
204+
QUARTER_HOUR));
78205
}
79206

80207
@Override
@@ -106,12 +233,9 @@ public ComparableQuantity<Power> calculateMaxPower(
106233
if (loadProfile == BdewStandardLoadProfile.H0) {
107234
// maximum dynamization factor is on day 366 (leap year) or day 365 (regular year).
108235
// The difference between day 365 and day 366 is negligible, thus pick 366
109-
valueExtractor =
110-
v ->
111-
Stream.of(v.getWiSa(), v.getWiSu(), v.getWiWd())
112-
.map(p -> BdewLoadValues.dynamization(p, 366));
236+
valueExtractor = v -> v.lastDayOfYearValues().map(p -> BdewLoadValues.dynamization(p, 366));
113237
} else {
114-
valueExtractor = v -> v.values().stream();
238+
valueExtractor = BdewLoadValues::values;
115239
}
116240

117241
double maxPower =
@@ -123,4 +247,16 @@ public ComparableQuantity<Power> calculateMaxPower(
123247

124248
return Quantities.getQuantity(maxPower, WATT);
125249
}
250+
251+
/** Returns the load profile energy scaling. The default value is 1000 kWh */
252+
public ComparableQuantity<Energy> getLoadProfileEnergyScaling(
253+
BdewStandardLoadProfile loadProfile) {
254+
255+
// the updated profiled are scaled to 1 million kWh -> 1000 MWh
256+
// old profiles are scaled to 1000 kWh
257+
return switch (loadProfile) {
258+
case H25, G25, L25, P25, S25 -> Quantities.getQuantity(1000d, PowerSystemUnits.MEGAWATTHOUR);
259+
default -> Quantities.getQuantity(1000d, PowerSystemUnits.KILOWATTHOUR);
260+
};
261+
}
126262
}

src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ public class TimeSeriesProcessor<
5555
new TimeSeriesProcessorKey(
5656
IndividualTimeSeries.class, TimeBasedValue.class, HeatAndSValue.class),
5757
new TimeSeriesProcessorKey(
58-
BdewLoadProfileTimeSeries.class, LoadProfileEntry.class, BdewLoadValues.class),
58+
BdewLoadProfileTimeSeries.class,
59+
LoadProfileEntry.class,
60+
BdewLoadValues.BDEW1999.class),
61+
new TimeSeriesProcessorKey(
62+
BdewLoadProfileTimeSeries.class,
63+
LoadProfileEntry.class,
64+
BdewLoadValues.BDEW2025.class),
5965
new TimeSeriesProcessorKey(
6066
RandomLoadProfileTimeSeries.class, LoadProfileEntry.class, RandomLoadValues.class));
6167

src/main/java/edu/ie3/datamodel/models/profile/BdewStandardLoadProfile.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@
1414
*/
1515
public enum BdewStandardLoadProfile implements StandardLoadProfile {
1616
H0("h0"), // Households
17+
H25("h25"), // household (Updated 2025)
1718
L0("l0"), // Agricultural enterprises without further differentiation
1819
L1("l1"), // Agricultural enterprises with dairy sector
1920
L2("l2"), // Agricultural enterprises without dairy sector
21+
L25("l25"), // Agricultural enterprises without further differentiation (Updated 2025)
2022
G0("g0"), // Businesses without further differentiation
2123
G1("g1"), // Workday businesses from 8 a.m. to 6 p.m.
2224
G2("g2"), // Businesses with high consumption in evening hours
2325
G3("g3"), // Businesses with enduring consumption
2426
G4("g4"), // Vendor or barber shop
2527
G5("g5"), // Bakery
26-
G6("g6"); // Business with main consumption on weekends
28+
G6("g6"), // Business with main consumption on weekends
29+
G25("g25"), // Businesses without further differentiation (Updated 2025)
30+
P25("p25"), // PV profile
31+
S25("s25"); // Combined PV and storage profile
2732

2833
private final String key;
2934

0 commit comments

Comments
 (0)