simona
simona copied to clipboard
Load Gradient of BMModel should consider time delta between tick and last tick
Currently the BMModel
implicitly considers time steps of one hour for applying the loadGradient.
private def applyLoadGradient(
pEl: ComparableQuantity[Power]
): ComparableQuantity[Power] = {
_lastPower match {
case None => pEl
case Some(lastPowerVal) =>
val pElDeltaMaxAbs = sRated
.multiply(loadGradient)
.multiply(Quantities.getQuantity(1d, HOUR))
.multiply(cosPhi)
.asType(classOf[Power])
pEl.subtract(lastPowerVal) match {
case pElDelta if pElDelta.isGreaterThan(pElDeltaMaxAbs) =>
lastPowerVal.add(pElDeltaMaxAbs)
case pElDelta if pElDelta.isLessThan(pElDeltaMaxAbs.multiply(-1)) =>
lastPowerVal.subtract(pElDeltaMaxAbs)
case _ =>
pEl
}
}
}
}
to do:
- [ ] check intended behaviour of BM plant
- [ ] adapt methods to consider tick and last tick
- [ ] Use PowerRamp when changed to squants in meantime