Browse Source

功率曲线拟合修正

shilin 1 year ago
parent
commit
b1329b3fcb

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -21,7 +21,7 @@ import org.springframework.core.env.Environment;
 //@PropertySource("classpath:xxl-job-executor.properties")
 //@PropertySource("classpath:xxl-job-executor2.properties")
 //@PropertySource("classpath:xxl-job-executor3.properties")
-//@PropertySource("classpath:xxl-job-executor4.properties")
+@PropertySource("classpath:xxl-job-executor4.properties")
 //@PropertySource("classpath:xxl-job-executor5.properties")
 //@PropertySource("classpath:xxl-job-executorWPLY.properties")
 //@PropertySource("classpath:xxl-job-executorRG.properties")
@@ -30,7 +30,7 @@ import org.springframework.core.env.Environment;
 //@PropertySource("classpath:xxl-job-accuracy.properties")
 //@PropertySource("classpath:xxl-job-7001.properties")
 //@PropertySource("classpath:xxl-job-7002.properties")
-@PropertySource("classpath:xxl-job-7003.properties")
+//@PropertySource("classpath:xxl-job-7003.properties")
 //@PropertySource("classpath:xxl-job-executorGF000.properties")
 //@PropertySource("classpath:xxl-job-executorGF001.properties")
 //@PropertySource("classpath:xxl-job-executorGF002.properties")

+ 16 - 43
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java

@@ -1663,43 +1663,21 @@ public class PowerCurveFittingByTimeService {
             return false;
         }
 
-
-        if(i<10)
+        if(i!=0)
         {
-            return false;
-        }else {
 
-            for(int j=i-10;j<i;j++)
-            {
-//                //设置时间为10分钟前,10钟前有停机事件数据进行过滤
-//                if (ztls.get(j).getPointValueInDouble() == 4) {
-//
-//                    return false;
-//                }
-                //设置时间为10分钟后,运行后10分钟数据进行过滤
-                if (ztls.get(j).getPointValueInDouble() != 2) {
-
-                    return false;
-                }
+            if (ztls.get(i-1).getPointValueInDouble() != 2) {
+                return false;
             }
         }
 
-        int number=i+10;
-
-        if(number>ztls.size())
-        {
-            number=ztls.size();
+        //欠发
+        if (fs.getPointValueInDouble() == 0 && fs.getPointValueInDouble() >= 6 && fs.getPointValueInDouble() < 12.5 && qfztls.get(i).getPointValueInDouble() > 2) {
+            return false;
+        }else if (fs.getPointValueInDouble() >= 12.5 && qfztls.get(i).getPointValueInDouble() < 1) {
+            return false;
         }
 
-        for(int j=i;j<number;j++)
-        {
-
-            //设置时间为10分钟后,运行后10分钟数据进行过滤
-            if (ztls.get(j).getPointValueInDouble() != 2) {
-
-                return false;
-            }
-        }
 
         if (CacheContext.wtmap.containsKey(windturbineId)) {
             String modelid = CacheContext.wtmap.get(windturbineId).getModelId();
@@ -1727,30 +1705,25 @@ public class PowerCurveFittingByTimeService {
                         if (k < 0.9 && speed <= 4 && speed > 3.5) {
                             return false;
                         }
-//                        if (k < 0.85 && item.getSpeed() <= 3.5 && item.getSpeed() > 3) {
-//                            item.setFilter(1);
-//                        }
-//                        if (k < 0.4 && item.getSpeed() <= 3 && item.getSpeed() > 0) {
-//                            item.setFilter(1);
-//                        }
+
                     }
 
                 }
             }
         }
-
-        //欠发状态大于2过滤掉
-        if (qfztls.get(i).getPointValueInDouble() > 2) {
-
-            return false;
-        }
+//
+//        //欠发状态大于2过滤掉
+//        if (qfztls.get(i).getPointValueInDouble() > 2) {
+//
+//            return false;
+//        }
 
         return true;
     }
 
     //功率曲线拟合
     private void curveFittingBuilder(Date begin, Date end, int dimension, double scale, String pointIdGL, String pointIdFS, String pointIdZT, List<PointVo> sjglPoints, List<PointVo> zyglPoints, String windturbineId) throws Exception {
-        double maxPower = windturbineCapacity.get(windturbineId) * 1.3;
+        double maxPower = windturbineCapacity.get(windturbineId) ;
         double maxSpeed = 25;
         List<PointfVo> sjglnhpoints = new ArrayList<>();
         Map<Double, PointfVo> zyglnhpoints = new HashMap<>();

+ 8 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CalculationService.java

@@ -106,7 +106,14 @@ public class CalculationService {
                 rlyxs = rfdl / (wp.getJrwindCapacity()+wp.getJrCapacity());
                 ylyxs = yfdl / (wp.getJrwindCapacity()+wp.getJrCapacity());
                 nlyxs = nfdl / (wp.getJrwindCapacity()+wp.getJrCapacity());
-                yfnlyl = yllfdl != 0 ?yfdl / yllfdl * 100:0;
+                if(yfdl!=0)
+                {
+                    yfnlyl = new BigDecimal(yfdl).divide(new BigDecimal(yllfdl), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                }
+              if(yfnlyl>100)
+              {
+                  yfnlyl=100;
+              }
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 34 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java

@@ -203,6 +203,19 @@ public class CycleCalculationService {
                     double yearfirstfdl = edosUtil.getSectionData(rssfdlPoint, yearFirstZero.getTime()).getPointValueInDouble() * rssfdlPoint.getCoefficient();
                     double date15agofdl = edosUtil.getSectionData(rssfdlPoint, date15age.getTime()).getPointValueInDouble() * rssfdlPoint.getCoefficient();
 
+
+                    Calendar c=Calendar.getInstance();
+                    c.setTime(currentDate);
+                    if(c.get(Calendar.DAY_OF_MONTH)!=1)
+                    {
+                        c.add(Calendar.DAY_OF_MONTH,-1);
+                        c.set(Calendar.HOUR_OF_DAY,23);
+                        c.set(Calendar.MINUTE,59);
+                    }
+
+                    double yssfdl = edosUtil.getSectionData(yfdlPoint, c.getTime().getTime()).getPointValueInDouble() ;
+                    double nssfdl = edosUtil.getSectionData(nfdlPoint, c.getTime().getTime()).getPointValueInDouble();
+
                     double rfdl = ssfdl - zerofdl;
 //                if(wt.getId().equals("SXJ_KGDL_XWT_F_WT_0014_EQ"))
 //                {
@@ -243,15 +256,34 @@ public class CycleCalculationService {
 
 
 
-                    double yfdl = ssfdl - monthfirstfdl;
+                    double yfdl = yssfdl - monthfirstfdl;
+                    if(c.get(Calendar.DAY_OF_MONTH)==1)
+                    {
+                        yfdl=rfdl;
+                    }else {
+                        yfdl=yfdl+rfdl;
+                    }
+
                     if (yfdl <= 0 || yfdl < rfdl || yfdl > modelpower.get(wt.getModelId()) * 24 * 31 * 1.5) {
                         yfdl = rfdl * day;
                     }
 
-                    double nfdl = ssfdl - yearfirstfdl;
+                    double nfdl = nssfdl - yearfirstfdl;
+
+
+                    if(c.get(Calendar.DAY_OF_MONTH)==1 && c.get(Calendar.MONTH)==0)
+                    {
+                        nfdl=rfdl;
+                    }else {
+                        nfdl=nfdl+rfdl;
+                    }
                     if (nfdl <= 0 || nfdl < yfdl || nfdl > modelpower.get(wt.getModelId()) * 24 * 31 * 12 * 1.5) {
                         nfdl = yfdl * month;
                     }
+
+
+
+
 //
 //                        if(wt.getWindpowerstationId().equals("SXJ_KGDL_YTY_FDC_STA"))
 //                        {

+ 2 - 11
realtime/generationXK-service/src/main/java/com/gyee/generation/util/DeviationRateUtil.java

@@ -136,19 +136,10 @@ public class DeviationRateUtil {
             //计算实际功率和理论功率的标准差
             double actualSD = 0.0;
             double theoreticalSD = 0.0;
-//            for (int i = 0; i < actualPowerMap.size(); i++) {
-//                actualSD += Math.pow(actualPowerMap.get(i).getY() - actualMean, 2);
-//
-//                if (theoreticalPowerMap.containsKey(actualPowerMap.get(i).getX())) {
-//                    PointVo vo = theoreticalPowerMap.get(actualPowerMap.get(i).getX());
-//                    theoreticalSD += Math.pow(vo.getY() - theoreticalMean, 2);
-//                }
-//
-//            }
+
 
             for(Map.Entry<Double,PointVo> entry : actualPowerMap.entrySet()){
-//                System.out.println(entry.getKey());
-//                System.out.println(entry.getValue());
+
 
                 actualSD += Math.pow(entry.getValue().getY() - actualMean, 2);
 

+ 7 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/math/LineUtil.java

@@ -74,6 +74,13 @@ public class LineUtil {
                 max = point.getY();
             }
 
+            if(point.getX()<10)
+            {
+                if(point.getY()<gl)
+                {
+                    point.setY(gl+0.02);
+                }
+            }
             if(point.getY()<gl)
             {
                 point.setY(gl);