-
Notifications
You must be signed in to change notification settings - Fork 5
/
PvInput.java
350 lines (318 loc) · 10.6 KB
/
PvInput.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.input.system;
import edu.ie3.datamodel.models.OperationTime;
import edu.ie3.datamodel.models.StandardUnits;
import edu.ie3.datamodel.models.input.EmInput;
import edu.ie3.datamodel.models.input.NodeInput;
import edu.ie3.datamodel.models.input.OperatorInput;
import edu.ie3.datamodel.models.input.system.characteristic.ReactivePowerCharacteristic;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Angle;
import javax.measure.quantity.Dimensionless;
import javax.measure.quantity.Power;
import tech.units.indriya.ComparableQuantity;
/** Describes a photovoltaic plant */
public class PvInput extends SystemParticipantInput {
/** Albedo value (typically a value between 0 and 1) */
private final double albedo;
/** Inclination in a compass direction (typically °: South 0◦; West 90◦; East -90◦) */
private final ComparableQuantity<Angle> azimuth;
/** Efficiency of converter (typically in %) */
private final ComparableQuantity<Dimensionless> etaConv;
/** Tilted inclination from horizontal (typically in °) */
private final ComparableQuantity<Angle> elevationAngle;
/** Generator correction factor merging different technical influences */
private final double kG;
/** Temperature correction factor */
private final double kT;
/** Is this asset market oriented? */
private final boolean marketReaction;
/** Rated apparent power (typically in kVA) */
private final ComparableQuantity<Power> sRated;
/** Rated power factor */
private final double cosPhiRated;
/**
* Constructor for an operated photovoltaic plant
*
* @param uuid of the input entity
* @param id of the asset
* @param operator of the asset
* @param operationTime Time for which the entity is operated
* @param node the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param em The {@link EmInput} controlling this system participant. Null, if not applicable.
* @param albedo Albedo value (typically a value between 0 and 1)
* @param azimuth Inclination in a compass direction (typically °: South 0◦; West 90◦; East -90◦)
* @param etaConv Efficiency of converter (typically in %)
* @param elevationAngle Tilted inclination from horizontal (typically in °)
* @param kG Generator correction factor merging different technical influences
* @param kT Generator correction factor merging different technical influences
* @param marketReaction Is this asset market oriented?
* @param sRated Rated apparent power (typically in kVA)
* @param cosPhiRated Power factor
*/
public PvInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
EmInput em,
double albedo,
ComparableQuantity<Angle> azimuth,
ComparableQuantity<Dimensionless> etaConv,
ComparableQuantity<Angle> elevationAngle,
double kG,
double kT,
boolean marketReaction,
ComparableQuantity<Power> sRated,
double cosPhiRated) {
super(uuid, id, operator, operationTime, node, qCharacteristics, em);
this.albedo = albedo;
this.azimuth = azimuth.to(StandardUnits.AZIMUTH);
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
this.elevationAngle = elevationAngle.to(StandardUnits.SOLAR_ELEVATION_ANGLE);
this.kG = kG;
this.kT = kT;
this.marketReaction = marketReaction;
this.sRated = sRated.to(StandardUnits.S_RATED);
this.cosPhiRated = cosPhiRated;
}
/**
* Constructor for an operated, always on photovoltaic plant
*
* @param uuid of the input entity
* @param id of the asset
* @param node the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param em The {@link EmInput} controlling this system participant. Null, if not applicable.
* @param albedo Albedo value (typically a value between 0 and 1)
* @param azimuth Inclination in a compass direction (typically °: South 0◦; West 90◦; East -90◦)
* @param etaConv Efficiency of converter (typically in %)
* @param elevationAngle Tilted inclination from horizontal (typically in °)
* @param kG Generator correction factor merging different technical influences
* @param kT Generator correction factor merging different technical influences
* @param marketReaction Is this asset market oriented?
* @param sRated Rated apparent power (typically in kVA)
* @param cosPhiRated Power factor
*/
public PvInput(
UUID uuid,
String id,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
EmInput em,
double albedo,
ComparableQuantity<Angle> azimuth,
ComparableQuantity<Dimensionless> etaConv,
ComparableQuantity<Angle> elevationAngle,
double kG,
double kT,
boolean marketReaction,
ComparableQuantity<Power> sRated,
double cosPhiRated) {
super(uuid, id, node, qCharacteristics, em);
this.albedo = albedo;
this.azimuth = azimuth.to(StandardUnits.AZIMUTH);
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
this.elevationAngle = elevationAngle.to(StandardUnits.SOLAR_ELEVATION_ANGLE);
this.kG = kG;
this.kT = kT;
this.marketReaction = marketReaction;
this.sRated = sRated.to(StandardUnits.S_RATED);
this.cosPhiRated = cosPhiRated;
}
public double getAlbedo() {
return albedo;
}
public ComparableQuantity<Angle> getAzimuth() {
return azimuth;
}
public ComparableQuantity<Dimensionless> getEtaConv() {
return etaConv;
}
public ComparableQuantity<Angle> getElevationAngle() {
return elevationAngle;
}
public boolean isMarketReaction() {
return marketReaction;
}
public double getCosPhiRated() {
return cosPhiRated;
}
public double getkG() {
return kG;
}
public double getkT() {
return kT;
}
public ComparableQuantity<Power> getsRated() {
return sRated;
}
public PvInputCopyBuilder copy() {
return new PvInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PvInput pvInput)) return false;
if (!super.equals(o)) return false;
return Double.compare(pvInput.albedo, albedo) == 0
&& Double.compare(pvInput.kG, kG) == 0
&& Double.compare(pvInput.kT, kT) == 0
&& marketReaction == pvInput.marketReaction
&& Double.compare(pvInput.cosPhiRated, cosPhiRated) == 0
&& azimuth.equals(pvInput.azimuth)
&& etaConv.equals(pvInput.etaConv)
&& elevationAngle.equals(pvInput.elevationAngle)
&& sRated.equals(pvInput.sRated);
}
@Override
public int hashCode() {
return Objects.hash(
super.hashCode(),
albedo,
azimuth,
etaConv,
elevationAngle,
kG,
kT,
marketReaction,
sRated,
cosPhiRated);
}
@Override
public String toString() {
return "PvInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", operator="
+ getOperator().getUuid()
+ ", operationTime="
+ getOperationTime()
+ ", node="
+ getNode().getUuid()
+ ", qCharacteristics='"
+ getqCharacteristics()
+ "', em="
+ getEm()
+ ", albedo="
+ albedo
+ ", azimuth="
+ azimuth
+ ", etaConv="
+ etaConv
+ ", elevationAngle="
+ elevationAngle
+ ", kG="
+ kG
+ ", kT="
+ kT
+ ", marketReaction="
+ marketReaction
+ ", sRated="
+ sRated
+ ", cosphiRated="
+ cosPhiRated
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link PvInput} entities with altered
* field values. For detailed field descriptions refer to java docs of {@link PvInput}
*
* @version 0.1
* @since 05.06.20
*/
public static class PvInputCopyBuilder
extends SystemParticipantInputCopyBuilder<PvInputCopyBuilder> {
private double albedo;
private ComparableQuantity<Angle> azimuth;
private ComparableQuantity<Dimensionless> etaConv;
private ComparableQuantity<Angle> elevationAngle;
private double kG;
private double kT;
private boolean marketReaction;
private ComparableQuantity<Power> sRated;
private double cosPhiRated;
public PvInputCopyBuilder(PvInput entity) {
super(entity);
this.albedo = entity.getAlbedo();
this.azimuth = entity.getAzimuth();
this.etaConv = entity.getEtaConv();
this.elevationAngle = entity.getElevationAngle();
this.kG = entity.getkG();
this.kT = entity.getkT();
this.marketReaction = entity.isMarketReaction();
this.sRated = entity.getsRated();
this.cosPhiRated = entity.getCosPhiRated();
}
public PvInputCopyBuilder albedo(double albedo) {
this.albedo = albedo;
return this;
}
public PvInputCopyBuilder azimuth(ComparableQuantity<Angle> azimuth) {
this.azimuth = azimuth;
return this;
}
public PvInputCopyBuilder etaConv(ComparableQuantity<Dimensionless> etaConv) {
this.etaConv = etaConv;
return this;
}
public PvInputCopyBuilder elevationAngle(ComparableQuantity<Angle> elevationAngle) {
this.elevationAngle = elevationAngle;
return this;
}
public PvInputCopyBuilder kG(double kG) {
this.kG = kG;
return this;
}
public PvInputCopyBuilder kT(double kT) {
this.kT = kT;
return this;
}
public PvInputCopyBuilder marketReaction(boolean marketReaction) {
this.marketReaction = marketReaction;
return this;
}
public PvInputCopyBuilder sRated(ComparableQuantity<Power> sRated) {
this.sRated = sRated;
return this;
}
public PvInputCopyBuilder cosPhiRated(double cosPhiRated) {
this.cosPhiRated = cosPhiRated;
return this;
}
@Override
public PvInput build() {
return new PvInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getNode(),
getqCharacteristics(),
getEm(),
albedo,
azimuth,
etaConv,
elevationAngle,
kG,
kT,
marketReaction,
sRated,
cosPhiRated);
}
@Override
protected PvInputCopyBuilder thisInstance() {
return this;
}
}
}