|
@@ -1,7 +1,6 @@
|
|
package com.gyee.power.fitting.dispersionanalysis;
|
|
package com.gyee.power.fitting.dispersionanalysis;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
-import cn.hutool.core.collection.ListUtil;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
|
|
import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
|
|
import com.gyee.power.fitting.common.result.JsonResult;
|
|
import com.gyee.power.fitting.common.result.JsonResult;
|
|
@@ -120,14 +119,14 @@ public class InverterPowerAnalysis2 {
|
|
|
|
|
|
// 计算功率离散率
|
|
// 计算功率离散率
|
|
public double calcPowerDeviation(List<TsDoubleData> gzqd, List<TsDoubleData> yggl, double averagePower, long startTime, long endTime) {
|
|
public double calcPowerDeviation(List<TsDoubleData> gzqd, List<TsDoubleData> yggl, double averagePower, long startTime, long endTime) {
|
|
- if(CollectionUtil.isEmpty(gzqd) || CollectionUtil.isEmpty(yggl)) return 0;
|
|
|
|
- List<TsDoubleData> S = dataCompletion(gzqd, startTime, endTime);
|
|
|
|
- List<TsDoubleData> P = dataCompletion(yggl, startTime, endTime);
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(gzqd) || CollectionUtil.isEmpty(yggl)) return 0;
|
|
|
|
+ //List<TsDoubleData> S = dataCompletion(gzqd, startTime, endTime);
|
|
|
|
+ //List<TsDoubleData> P = dataCompletion(yggl, startTime, endTime);
|
|
WeightedObservedPoints points = new WeightedObservedPoints();
|
|
WeightedObservedPoints points = new WeightedObservedPoints();
|
|
double s, p;
|
|
double s, p;
|
|
- for (int i = 0; i < S.size(); i++) {
|
|
|
|
- s = S.get(i).getDoubleValue();
|
|
|
|
- p = P.get(i).getDoubleValue();
|
|
|
|
|
|
+ for (int i = 0; i < gzqd.size(); i++) {
|
|
|
|
+ s = gzqd.get(i).getDoubleValue();
|
|
|
|
+ p = yggl.get(i).getDoubleValue();
|
|
if (s < 1 || p < 1) {
|
|
if (s < 1 || p < 1) {
|
|
points.add(0, 0);
|
|
points.add(0, 0);
|
|
}
|
|
}
|
|
@@ -138,12 +137,12 @@ public class InverterPowerAnalysis2 {
|
|
|
|
|
|
double sum = 0.0, power;
|
|
double sum = 0.0, power;
|
|
// 计算标准差
|
|
// 计算标准差
|
|
- for (int i = 0; i < S.size(); i++) {
|
|
|
|
- s = S.get(i).getDoubleValue();
|
|
|
|
- p = P.get(i).getDoubleValue();
|
|
|
|
|
|
+ for (int i = 0; i < gzqd.size(); i++) {
|
|
|
|
+ s = gzqd.get(i).getDoubleValue();
|
|
|
|
+ p = yggl.get(i).getDoubleValue();
|
|
sum += Math.pow(p - pncf.calcPoly(s, run), 2);
|
|
sum += Math.pow(p - pncf.calcPoly(s, run), 2);
|
|
}
|
|
}
|
|
- return Math.sqrt(sum / S.size());
|
|
|
|
|
|
+ return Math.sqrt(sum / gzqd.size());
|
|
}
|
|
}
|
|
|
|
|
|
private List<TsDoubleData> dataCompletion(List<TsDoubleData> gzqd, long startTime, long endTime) {
|
|
private List<TsDoubleData> dataCompletion(List<TsDoubleData> gzqd, long startTime, long endTime) {
|