Skip to content

Commit 65dc940

Browse files
Merge remote-tracking branch 'origin/pp/#1089-enhance-loadinput-by-categories-for-markov' into pp/#1089-enhance-loadinput-by-categories-for-markov
2 parents b8b52a5 + e5b9ef1 commit 65dc940

File tree

17 files changed

+29
-169
lines changed

17 files changed

+29
-169
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323

2424
### Fixed
2525
- Fixed `equals` of `ResultEntity` and `TimeSeriesEntry` [#1037](https://github.com/ie3-institute/PowerSystemDataModel/issues/1037)
26+
- Fixed "depth of discharge" in documentation [#872](https://github.com/ie3-institute/PowerSystemDataModel/issues/872)
2627

2728
## [5.0.0] - 2024-03-06
2829

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id 'signing'
66
id 'pmd' // code check, working on source code
77
id 'com.diffplug.spotless' version '6.25.0' //code format
8-
id 'com.github.spotbugs' version '6.0.15' // code check, working on byte code
8+
id 'com.github.spotbugs' version '6.0.16' // code check, working on byte code
99
id 'de.undercouch.download' version '5.6.0'
1010
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
1111
id 'jacoco' // java code coverage plugin
@@ -73,7 +73,7 @@ dependencies {
7373
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
7474
testImplementation "org.spockframework:spock-core:2.3-groovy-$groovyVersion"
7575
testImplementation 'org.objenesis:objenesis:3.4' // Mock creation with constructor parameters
76-
testImplementation 'net.bytebuddy:byte-buddy:1.14.16' // Mocks of classes
76+
testImplementation 'net.bytebuddy:byte-buddy:1.14.17' // Mocks of classes
7777

7878
// testcontainers (docker framework for testing)
7979
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion"

docs/readthedocs/models/input/participant/storage.md

+6-20
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,6 @@ Model of an ideal electrical battery energy storage.
6060
- %
6161
- Efficiency of the electrical inverter
6262
63-
* - dod
64-
- %
65-
- | Maximum permissible depth of discharge. 80 % dod
66-
| is equivalent to a state of charge of 20 %.
67-
68-
* - lifeTime
69-
- h
70-
- Permissible hours of full use
71-
72-
* - lifeCycle
73-
- --
74-
- Permissible amount of full cycles
75-
76-
* - em
77-
- --
78-
- | UUID reference to an :ref:`Energy Management Unit<em_model>` that is controlling
79-
| this system participant. Field can be empty or missing, if this participant
80-
| is not controlled.
81-
8263
```
8364

8465
### Entity Model
@@ -125,7 +106,12 @@ Model of an ideal electrical battery energy storage.
125106
- --
126107
- | Foreseen operation strategy of the storage.
127108
| Eligible input: *"market"*, *"grid"*, *"self"*
128-
109+
110+
* - em
111+
- --
112+
- | UUID reference to an :ref:`Energy Management Unit<em_model>` that is controlling
113+
| this system participant. Field can be empty or missing, if this participant
114+
| is not controlled.
129115
130116
```
131117

docs/uml/main/input/SystemDatamodelConcept.puml

-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ package models {
153153
- pMax: ComparableQuantity<Power> [kW]
154154
- activePowerGradient: ComparableQuantity<DimensionlessRate> [%/h]
155155
- eta: ComparableQuantity<Dimensionless> [%]
156-
- dod: ComparableQuantity<Dimensionless> [%]
157-
- lifeTime: ComparableQuantity<Time> [h]
158-
- lifeCycle: int
159156
}
160157
StorageTypeInput --|> SystemParticipantTypeInput
161158

src/main/java/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactory.java

+2-28
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ public class SystemParticipantTypeInputFactory
5353
// StorageTypeInput
5454
private static final String P_MAX = "pMax";
5555
private static final String ETA = "eta";
56-
private static final String DOD = "dod";
57-
private static final String LIFETIME = "lifeTime";
58-
private static final String LIFECYCLE = "lifeCycle";
5956

6057
// WecTypeInput
6158
private static final String CP_CHARACTERISTIC = "cpCharacteristic";
@@ -89,15 +86,7 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
8986
expandSet(standardConstructorParams, ETA_EL, ETA_THERMAL, P_THERMAL, P_OWN);
9087
} else if (entityClass.equals(StorageTypeInput.class)) {
9188
constructorParameters =
92-
expandSet(
93-
standardConstructorParams,
94-
E_STORAGE,
95-
P_MAX,
96-
ACTIVE_POWER_GRADIENT,
97-
ETA,
98-
DOD,
99-
LIFETIME,
100-
LIFECYCLE);
89+
expandSet(standardConstructorParams, E_STORAGE, P_MAX, ACTIVE_POWER_GRADIENT, ETA);
10190
}
10291

10392
return Collections.singletonList(constructorParameters);
@@ -241,23 +230,8 @@ private SystemParticipantTypeInput buildStorageTypeInput(
241230
ComparableQuantity<DimensionlessRate> activePowerGradient =
242231
data.getQuantity(ACTIVE_POWER_GRADIENT, StandardUnits.ACTIVE_POWER_GRADIENT);
243232
ComparableQuantity<Dimensionless> eta = data.getQuantity(ETA, StandardUnits.EFFICIENCY);
244-
ComparableQuantity<Dimensionless> dod = data.getQuantity(DOD, StandardUnits.DOD);
245-
ComparableQuantity<Time> lifeTime = data.getQuantity(LIFETIME, StandardUnits.LIFE_TIME);
246-
int lifeCycle = data.getInt(LIFECYCLE);
247233

248234
return new StorageTypeInput(
249-
uuid,
250-
id,
251-
capEx,
252-
opEx,
253-
eStorage,
254-
sRated,
255-
cosPhi,
256-
pMax,
257-
activePowerGradient,
258-
eta,
259-
dod,
260-
lifeTime,
261-
lifeCycle);
235+
uuid, id, capEx, opEx, eStorage, sRated, cosPhi, pMax, activePowerGradient, eta);
262236
}
263237
}

src/main/java/edu/ie3/datamodel/models/StandardUnits.java

-4
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,8 @@ public class StandardUnits {
101101
KILOWATTHOUR_PER_KELVIN_TIMES_CUBICMETRE;
102102
/** Thermal transmission through an insulation in kW/K */
103103
public static final Unit<ThermalConductance> THERMAL_TRANSMISSION = KILOWATT_PER_KELVIN;
104-
/** Depth of discharge in % */
105-
public static final Unit<Dimensionless> DOD = PERCENT;
106104
/** State of charge in % */
107105
public static final Unit<Dimensionless> SOC = PERCENT;
108-
/** Life time of a system in h */
109-
public static final Unit<Time> LIFE_TIME = HOUR;
110106
/** Area covered by the rotor of a wind energy converter in m² */
111107
public static final Unit<Area> ROTOR_AREA = SQUARE_METRE;
112108
/** Height of the hub of an wind energy converter in metre */

src/main/java/edu/ie3/datamodel/models/input/system/type/StorageTypeInput.java

+5-48
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ public class StorageTypeInput extends SystemParticipantTypeInput {
2727
private final ComparableQuantity<DimensionlessRate> activePowerGradient;
2828
/** Efficiency of the charging and discharging process (typically in %) */
2929
private final ComparableQuantity<Dimensionless> eta;
30-
/** Minimum permissible depth of discharge (typically in %) */
31-
private final ComparableQuantity<Dimensionless> dod;
32-
/** Maximum life time of the storage (typically in h) */
33-
private final ComparableQuantity<Time> lifeTime;
34-
/** Maximum amount of full charging cycles */
35-
private final int lifeCycle;
3630

3731
/**
3832
* @param uuid of the input entity
@@ -45,9 +39,6 @@ public class StorageTypeInput extends SystemParticipantTypeInput {
4539
* @param pMax maximum permissible active power of the integrated inverter
4640
* @param activePowerGradient maximum permissible gradient of active power change
4741
* @param eta efficiency of the charging and discharging process
48-
* @param dod maximum permissible depth of discharge
49-
* @param lifeTime maximum life time of the storage
50-
* @param lifeCycle maximum amount of full charging/discharging cycles
5142
*/
5243
public StorageTypeInput(
5344
UUID uuid,
@@ -59,36 +50,18 @@ public StorageTypeInput(
5950
double cosPhiRated,
6051
ComparableQuantity<Power> pMax,
6152
ComparableQuantity<DimensionlessRate> activePowerGradient,
62-
ComparableQuantity<Dimensionless> eta,
63-
ComparableQuantity<Dimensionless> dod,
64-
ComparableQuantity<Time> lifeTime,
65-
int lifeCycle) {
53+
ComparableQuantity<Dimensionless> eta) {
6654
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosPhiRated);
6755
this.eStorage = eStorage.to(StandardUnits.ENERGY_IN);
6856
this.pMax = pMax.to(StandardUnits.ACTIVE_POWER_IN);
6957
this.activePowerGradient = activePowerGradient.to(StandardUnits.ACTIVE_POWER_GRADIENT);
7058
this.eta = eta.to(StandardUnits.EFFICIENCY);
71-
this.dod = dod.to(StandardUnits.DOD);
72-
this.lifeTime = lifeTime.to(StandardUnits.LIFE_TIME);
73-
this.lifeCycle = lifeCycle;
7459
}
7560

7661
public ComparableQuantity<Dimensionless> getEta() {
7762
return eta;
7863
}
7964

80-
public ComparableQuantity<Dimensionless> getDod() {
81-
return dod;
82-
}
83-
84-
public ComparableQuantity<Time> getLifeTime() {
85-
return lifeTime;
86-
}
87-
88-
public int getLifeCycle() {
89-
return lifeCycle;
90-
}
91-
9265
public ComparableQuantity<Energy> geteStorage() {
9366
return eStorage;
9467
}
@@ -111,19 +84,15 @@ public boolean equals(Object o) {
11184
if (this == o) return true;
11285
if (!(o instanceof StorageTypeInput that)) return false;
11386
if (!super.equals(o)) return false;
114-
return lifeCycle == that.lifeCycle
115-
&& eStorage.equals(that.eStorage)
87+
return eStorage.equals(that.eStorage)
11688
&& pMax.equals(that.pMax)
11789
&& activePowerGradient.equals(that.activePowerGradient)
118-
&& eta.equals(that.eta)
119-
&& dod.equals(that.dod)
120-
&& lifeTime.equals(that.lifeTime);
90+
&& eta.equals(that.eta);
12191
}
12292

12393
@Override
12494
public int hashCode() {
125-
return Objects.hash(
126-
super.hashCode(), eStorage, pMax, activePowerGradient, eta, dod, lifeTime, lifeCycle);
95+
return Objects.hash(super.hashCode(), eStorage, pMax, activePowerGradient, eta);
12796
}
12897

12998
@Override
@@ -149,12 +118,6 @@ public String toString() {
149118
+ activePowerGradient
150119
+ ", eta="
151120
+ eta
152-
+ ", dod="
153-
+ dod
154-
+ ", lifeTime="
155-
+ lifeTime
156-
+ ", lifeCycle="
157-
+ lifeCycle
158121
+ '}';
159122
}
160123

@@ -180,9 +143,6 @@ private StorageTypeInputCopyBuilder(StorageTypeInput entity) {
180143
this.pMax = entity.getpMax();
181144
this.activePowerGradient = entity.getActivePowerGradient();
182145
this.eta = entity.getEta();
183-
this.dod = entity.getDod();
184-
this.lifeTime = entity.getLifeTime();
185-
this.lifeCycle = entity.getLifeCycle();
186146
}
187147

188148
public StorageTypeInputCopyBuilder seteStorage(ComparableQuantity<Energy> eStorage) {
@@ -270,10 +230,7 @@ public StorageTypeInput build() {
270230
getCosPhiRated(),
271231
pMax,
272232
activePowerGradient,
273-
eta,
274-
dod,
275-
lifeTime,
276-
lifeCycle);
233+
eta);
277234
}
278235

279236
@Override

src/main/java/edu/ie3/datamodel/utils/validation/SystemParticipantValidationUtils.java

+1-19
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,10 @@ private static List<Try<Void, InvalidEntityException>> checkStorage(StorageInput
482482
* Validates a StorageTypeInput if:
483483
*
484484
* <ul>
485-
* <li>its permissible amount of full cycles is not negative
486485
* <li>its efficiency of the electrical converter is between 0% and 100%
487-
* <li>its maximum permissible depth of discharge is between 0% and 100%
488486
* <li>its active power gradient is not negative
489487
* <li>its battery capacity is positive
490488
* <li>its maximum permissible active power (in-feed or consumption) is not negative
491-
* <li>its permissible hours of full use is not negative
492489
* </ul>
493490
*
494491
* @param storageTypeInput StorageTypeInput to validate
@@ -499,14 +496,6 @@ private static List<Try<Void, InvalidEntityException>> checkStorageType(
499496
StorageTypeInput storageTypeInput) {
500497
List<Try<Void, InvalidEntityException>> exceptions = new ArrayList<>();
501498

502-
exceptions.add(
503-
Try.ofVoid(
504-
storageTypeInput.getLifeCycle() < 0,
505-
() ->
506-
new InvalidEntityException(
507-
"Permissible amount of life cycles of the storage type must be zero or positive",
508-
storageTypeInput)));
509-
510499
exceptions.addAll(
511500
Try.ofVoid(
512501
InvalidEntityException.class,
@@ -515,17 +504,10 @@ private static List<Try<Void, InvalidEntityException>> checkStorageType(
515504
storageTypeInput,
516505
storageTypeInput.getEta(),
517506
"Efficiency of the electrical converter"),
518-
() ->
519-
isBetweenZeroAndHundredPercent(
520-
storageTypeInput,
521-
storageTypeInput.getDod(),
522-
"Maximum permissible depth of discharge"),
523507
() ->
524508
detectNegativeQuantities(
525509
new Quantity<?>[] {
526-
storageTypeInput.getpMax(),
527-
storageTypeInput.getActivePowerGradient(),
528-
storageTypeInput.getLifeTime()
510+
storageTypeInput.getpMax(), storageTypeInput.getActivePowerGradient(),
529511
},
530512
storageTypeInput),
531513
() ->

src/test/groovy/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactoryTest.groovy

+4-10
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac
247247
"estorage" : "6",
248248
"pmax" : "8",
249249
"activepowergradient" : "1",
250-
"eta" : "9",
251-
"dod" : "10",
252-
"lifetime" : "11",
253-
"lifecycle" : "12"
250+
"eta" : "9"
254251
]
255252
def typeInputClass = StorageTypeInput
256253

@@ -273,24 +270,21 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac
273270
assert pMax == getQuant(parameter["pmax"], StandardUnits.ACTIVE_POWER_IN)
274271
assert activePowerGradient == getQuant(parameter["activepowergradient"], StandardUnits.ACTIVE_POWER_GRADIENT)
275272
assert eta == getQuant(parameter["eta"], StandardUnits.EFFICIENCY)
276-
assert dod == getQuant(parameter["dod"], StandardUnits.DOD)
277-
assert lifeTime == getQuant(parameter["lifetime"], StandardUnits.LIFE_TIME)
278-
assert lifeCycle == Integer.parseInt(parameter["lifecycle"])
279273
}
280274
}
281275

282276
def "A SystemParticipantTypeInputFactory should throw an exception on invalid or incomplete data"() {
283277
given: "a system participant factory and model data"
284278
def typeInputFactory = new SystemParticipantTypeInputFactory()
285-
def actualFields = SystemParticipantTypeInputFactory.newSet("uuid", "id", "capex", "opex", "srated", "cosPhiRated", "estorage", "pmin", "pmax", "eta", "dod", "lifetime",)
279+
def actualFields = SystemParticipantTypeInputFactory.newSet("uuid", "id", "capex", "opex", "srated", "cosPhiRated", "estorage", "pmin", "pmax", "eta",)
286280

287281
when:
288282
def input = typeInputFactory.validate(actualFields, StorageTypeInput)
289283

290284
then:
291285
input.failure
292-
input.exception.get().message == "The provided fields [capex, cosPhiRated, dod, estorage, eta, id, lifetime, opex, pmax, pmin, srated, uuid] are invalid for instance of 'StorageTypeInput'. \n" +
286+
input.exception.get().message == "The provided fields [capex, cosPhiRated, estorage, eta, id, opex, pmax, pmin, srated, uuid] are invalid for instance of 'StorageTypeInput'. \n" +
293287
"The following fields (without complex objects e.g. nodes, operators, ...) to be passed to a constructor of 'StorageTypeInput' are possible (NOT case-sensitive!):\n" +
294-
"0: [activePowerGradient, capex, cosPhiRated, dod, eStorage, eta, id, lifeCycle, lifeTime, opex, pMax, sRated, uuid] or [active_power_gradient, capex, cos_phi_rated, dod, e_storage, eta, id, life_cycle, life_time, opex, p_max, s_rated, uuid]\n"
288+
"0: [activePowerGradient, capex, cosPhiRated, eStorage, eta, id, opex, pMax, sRated, uuid] or [active_power_gradient, capex, cos_phi_rated, e_storage, eta, id, opex, p_max, s_rated, uuid]\n"
295289
}
296290
}

src/test/groovy/edu/ie3/datamodel/io/processor/input/InputEntityProcessorTest.groovy

+1-4
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,7 @@ class InputEntityProcessorTest extends Specification {
617617
"cosPhiRated" : "0.997",
618618
"pMax" : "12.961",
619619
"activePowerGradient": "3.0",
620-
"eta" : "92.0",
621-
"dod" : "20.0",
622-
"lifeTime" : "43800.0",
623-
"lifeCycle" : "100000"
620+
"eta" : "92.0"
624621
]
625622

626623
when:

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvTypeSourceTest.groovy

-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ class CsvTypeSourceTest extends Specification implements CsvTestDataMeta {
159159
pMax == sptd.storageTypeInput.pMax
160160
activePowerGradient == sptd.storageTypeInput.activePowerGradient
161161
eta == sptd.storageTypeInput.eta
162-
dod == sptd.storageTypeInput.dod
163-
lifeTime == sptd.storageTypeInput.lifeTime
164-
lifeCycle == sptd.storageTypeInput.lifeCycle
165162
}
166163
}
167164

src/test/groovy/edu/ie3/datamodel/models/input/system/type/StorageTypeInputTest.groovy

-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class StorageTypeInputTest extends Specification {
2323
def alteredUnit = storageTypeInput.copy()
2424
.seteStorage(Quantities.getQuantity(90, ENERGY_IN))
2525
.setpMax(Quantities.getQuantity(15, ACTIVE_POWER_IN))
26-
.setLifeTime(Quantities.getQuantity(999999, LIFE_TIME))
2726
.build()
2827

2928
then:
@@ -38,9 +37,6 @@ class StorageTypeInputTest extends Specification {
3837
assert pMax == Quantities.getQuantity(15, ACTIVE_POWER_IN)
3938
assert activePowerGradient == storageTypeInput.activePowerGradient
4039
assert eta == storageTypeInput.eta
41-
assert dod == storageTypeInput.dod
42-
assert lifeTime == Quantities.getQuantity(999999, LIFE_TIME)
43-
assert lifeCycle == storageTypeInput.lifeCycle
4440
}
4541
}
4642

@@ -63,9 +59,6 @@ class StorageTypeInputTest extends Specification {
6359
assert pMax == storageTypeInput.pMax * 2d
6460
assert activePowerGradient == storageTypeInput.activePowerGradient
6561
assert eta == storageTypeInput.eta
66-
assert dod == storageTypeInput.dod
67-
assert lifeTime == storageTypeInput.lifeTime
68-
assert lifeCycle == storageTypeInput.lifeCycle
6962
}
7063
}
7164
}

0 commit comments

Comments
 (0)