Browse Source

battery discharge efficiency according to soc not linear not stairs

David Heck 4 years ago
parent
commit
a72a0c420f
2 changed files with 11 additions and 6 deletions
  1. 2 1
      src/blackstart/controlAlgorithm.java
  2. 9 5
      src/classes/StorageElement.java

+ 2 - 1
src/blackstart/controlAlgorithm.java

@@ -541,7 +541,8 @@ public class controlAlgorithm implements AddOn {
 		for (StorageElement ele :
 				getStorageElements()) {
 			println(ele.getEleName() + " " + ele.getId() + ", soc: " + (ele.getStateOfCharge()/60)/1000 + "kWh, "
-					+ "nominal power: " + ele.getNominalOutRatio()/1000 + " kW, "
+					+ "SOC%: " + ele.getStateOfChargeInPercent()
+					+ " nominal power: " + ele.getNominalOutRatio()/1000 + " kW, "
 					+ "currentMaxOutPower: "+ ele.getCurrentMaxOutRatio()/1000 + " kW, "
 					+ "distance: " + (ele.getLowDistance()+ele.getHighDistance()));
 		}

+ 9 - 5
src/classes/StorageElement.java

@@ -167,11 +167,15 @@ public class StorageElement extends HolonElement implements Comparable<StorageEl
 		setCurrentMaxOutRatio();
 	}
 
+	public float getStateOfChargeInPercent(){// 1.0 = 100%
+		return stateOfCharge / capacity;
+	}
+
 	private void setCurrentMaxOutRatio(){
-		if(stateOfCharge > capacity * 0.8){
-			currentMaxOutRatio = (float) (nominalOutRatio * 1.1);
-		}else if(stateOfCharge < capacity * 0.2){
-			currentMaxOutRatio = (float) (nominalOutRatio * 0.8);
+		if(getStateOfChargeInPercent() > 0.8){
+			currentMaxOutRatio = (float) (nominalOutRatio * (1 + (0.005 * (getStateOfChargeInPercent() * 100 - 0.8 * 100))));
+		}else if(getStateOfChargeInPercent() < 0.2){
+			currentMaxOutRatio = (float) (nominalOutRatio * (1 - (0.01 * (0.2 * 100 - getStateOfChargeInPercent() * 100))));
 		}else{
 			currentMaxOutRatio = nominalOutRatio;
 		}
@@ -225,7 +229,7 @@ public class StorageElement extends HolonElement implements Comparable<StorageEl
 		}else if(this.stateOfCharge > storageElement.getStateOfCharge()){
 			return 1;
 		}else{
-			return Double.compare(storageElement.getLowDistance()+storageElement.getHighDistance(), this.getLowDistance()+this.getHighDistance());
+			return Double.compare(storageElement.getLowDistance()+storageElement.getHighDistance(), this.getLowDistance() + this.getHighDistance());
 		}
 	}