PhotovoltaicEfficiencyAnalysis.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package com.gyee.power.fitting.dispersionanalysis;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. public class PhotovoltaicEfficiencyAnalysis {
  5. public static void main(String[] args) {
  6. // 模拟全站光伏逆变单元的数据,这里用一个Map来表示每个逆变单元的发电功率和入射光能
  7. Map<String, Double[]> inverterData = new HashMap<>();
  8. inverterData.put("Inverter1", new Double[]{500.0, 600.0});
  9. inverterData.put("Inverter2", new Double[]{550.0, 600.0});
  10. inverterData.put("Inverter3", new Double[]{450.0, 600.0});
  11. inverterData.put("Inverter4", new Double[]{600.0, 600.0});
  12. inverterData.put("Inverter5", new Double[]{350.0, 600.0});
  13. // 分析光伏逆变单元的运行水平
  14. for (Map.Entry<String, Double[]> entry : inverterData.entrySet()) {
  15. String inverterName = entry.getKey();
  16. Double[] data = entry.getValue();
  17. double actualOutputPower = data[0]; // 实际发电功率
  18. double incidentSolarPower = data[1]; // 入射光能
  19. double efficiency = calculatePhotovoltaicEfficiency(actualOutputPower, incidentSolarPower);
  20. OperatingLevel currentLevel = determinePhotovoltaicLevel(efficiency);
  21. // 输出每个逆变单元的运行水平
  22. System.out.println(inverterName + "的运行水平是: " + currentLevel);
  23. }
  24. }
  25. // 根据转换效率确定光伏运行水平
  26. private static OperatingLevel determinePhotovoltaicLevel(double efficiency) {
  27. if (efficiency >= 90.0) {
  28. return OperatingLevel.STABLE;
  29. } else if (efficiency >= 80.0) {
  30. return OperatingLevel.GOOD;
  31. } else if (efficiency >= 70.0) {
  32. return OperatingLevel.NEEDS_IMPROVEMENT;
  33. } else {
  34. return OperatingLevel.MUST_CORRECT;
  35. }
  36. }
  37. // 计算光伏转换效率
  38. private static double calculatePhotovoltaicEfficiency(double actualOutputPower, double incidentSolarPower) {
  39. // 转换为百分比
  40. return (actualOutputPower / incidentSolarPower) * 100.0;
  41. }
  42. }