diff --git a/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala b/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala index 136c9e69f2..34ca829923 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala @@ -542,27 +542,15 @@ final case class PvModel private ( private def calcEpsilon(eDifH: Irradiation, eBeamH: Irradiation, thetaZ: Angle): Double = { val thetaZInRad = thetaZ.toRadians - ((eDifH + eBeamH / cos(thetaZInRad)) / eDifH + - (5.535d * 1.0e-6) * pow( - thetaZ.toDegrees, - 3 - )) / (1d + (5.535d * 1.0e-6) * pow( - thetaZ.toDegrees, - 3 - )) + ((eDifH + eBeamH / cos(thetaZInRad)) / eDifH +(5.535d * 1.0e-6) * pow(thetaZ.toDegrees, 3)) / + (1d + (5.535d * 1.0e-6) * pow(thetaZ.toDegrees,3)) } private def calcEpsilonOld(eDifH: Irradiation, eBeamH: Irradiation, thetaZ: Angle): Double = { val thetaZInRad = thetaZ.toRadians - ((eDifH + eBeamH) / eDifH + - (5.535d * 1.0e-6) * pow( - thetaZ.toRadians, - 3 - )) / (1d + (5.535d * 1.0e-6) * pow( - thetaZ.toRadians, - 3 - )) + ((eDifH + eBeamH) / eDifH +(5.535d * 1.0e-6) * pow(thetaZ.toRadians, 3)) / + (1d + (5.535d * 1.0e-6) * pow(thetaZ.toRadians, 3)) } private def firstFraction(eDifH: Irradiation, eBeamH: Irradiation, thetaZ: Angle): Double = { @@ -593,12 +581,12 @@ final case class PvModel private ( if (eDifH.value.doubleValue > 0) { // if we have diffuse radiation on horizontal surface we have to check if we have another epsilon due to clouds get the epsilon - var epsilon = ((eDifH + eBeamH) / eDifH + + var epsilon = ((eDifH + eBeamH / cos(thetaZInRad)) / eDifH + (5.535d * 1.0e-6) * pow( - thetaZ.toRadians, + thetaZ.toDegrees, 3 )) / (1d + (5.535d * 1.0e-6) * pow( - thetaZ.toRadians, + thetaZ.toDegrees, 3 )) @@ -635,10 +623,7 @@ final case class PvModel private ( // calculate the f_ij components based on the epsilon bin val f11 = -0.0161 * pow(x, 3) + 0.1840 * pow(x, 2) - 0.3806 * x + 0.2324 - val f12 = 0.0134 * pow(x, 4) - 0.1938 * pow(x, 3) + 0.8410 * pow( - x, - 2 - ) - 1.4018 * x + 1.3579 + val f12 = 0.0134 * pow(x, 4) - 0.1938 * pow(x, 3) + 0.8410 * pow(x, 2) - 1.4018 * x + 1.3579 val f13 = 0.0032 * pow(x, 3) - 0.0280 * pow(x, 2) - 0.0056 * x - 0.0385 val f21 = -0.0048 * pow(x, 3) + 0.0536 * pow(x, 2) - 0.1049 * x + 0.0034 val f22 = 0.0012 * pow(x, 3) - 0.0067 * pow(x, 2) + 0.0091 * x - 0.0269 diff --git a/src/test/groovy/edu/ie3/simona/model/participant/PvModelTest.groovy b/src/test/groovy/edu/ie3/simona/model/participant/PvModelTest.groovy index 5b394809e7..71f8afb7fb 100644 --- a/src/test/groovy/edu/ie3/simona/model/participant/PvModelTest.groovy +++ b/src/test/groovy/edu/ie3/simona/model/participant/PvModelTest.groovy @@ -476,9 +476,9 @@ class PvModelTest extends Specification { // 0.244 MJ/m^2 = 67.777778 Wh/m^2 //Beam Radiation on horizontal surface Irradiation eBeamH = Sq.create(67.777778d, WattHoursPerSquareMeter$.MODULE$) - // 0.769 MJ/m^2 = 213,61111 Wh/m^2 + // 0.796 MJ/m^2 = 221,111288 Wh/m^2 //Diffuse beam Radiation on horizontal surface - Irradiation eDifH = Sq.create(213.61111d, WattHoursPerSquareMeter$.MODULE$) + Irradiation eDifH = Sq.create(221.111288d, WattHoursPerSquareMeter$.MODULE$) //Incidence Angle Angle thetaG = Sq.create(Math.toRadians(thetaGIn), Radians$.MODULE$) //Zenith Angle @@ -490,7 +490,7 @@ class PvModelTest extends Specification { "- should calculate the beam diffusion" // == 0,7792781569074354 MJ/m^2 - def epsilon = pvModel.calcEpsilon(eDifH, eBeamH, thetaZ) + def epsilon = pvModel.calcEpsilon(eDifH, eBeamH, thetaZ) // epsilon(Duffie) = 1,28451252 def epsilonOld = pvModel.calcEpsilonOld(eDifH, eBeamH, thetaZ) def firstFraction = pvModel.firstFraction(eDifH, eBeamH, thetaZ) @@ -499,7 +499,7 @@ class PvModelTest extends Specification { where: "the following parameters are given" thetaGIn | thetaZIn | slope | airMass | I0 || eDifSSol - 37.0 | 62.2 | 60 | 2.13873080095658d | 1399.0077631849722d || 216.46615469650982d + 37.0 | 62.2 | 60 | 2.144d | 1395.8445d || 220.83351d } def "Calculate the ground reflection eRefS"() {