|
@@ -10,16 +10,24 @@ public class resistanceCalculator {
|
|
|
private int highVoltage;
|
|
|
|
|
|
@Expose
|
|
|
- private int diameter;
|
|
|
+ private int lowDiameter;
|
|
|
+
|
|
|
+ @Expose
|
|
|
+ private int highDiameter;
|
|
|
+
|
|
|
+ @Expose
|
|
|
+ private double lowSpecificMaterialResistance;
|
|
|
|
|
|
@Expose
|
|
|
- private double specificMaterialResistance;
|
|
|
+ private double highSpecificMaterialResistance;
|
|
|
|
|
|
- public resistanceCalculator(int lowVoltage, int highVoltage, int diameter, double specificMaterialResistance){
|
|
|
+ public resistanceCalculator(int lowVoltage, int highVoltage, int lowDiameter, int highDiameter, double lowSpecificMaterialResistance, double highSpecificMaterialResistance){
|
|
|
this.lowVoltage = lowVoltage;
|
|
|
this.highVoltage = highVoltage;
|
|
|
- this.diameter = diameter;
|
|
|
- this.specificMaterialResistance = specificMaterialResistance;
|
|
|
+ this.lowDiameter = lowDiameter;
|
|
|
+ this.highDiameter = highDiameter;
|
|
|
+ this.lowSpecificMaterialResistance = lowSpecificMaterialResistance;
|
|
|
+ this.highSpecificMaterialResistance = highSpecificMaterialResistance;
|
|
|
}
|
|
|
|
|
|
public void setDistancesToCalcResistance(HolonObject powerPlant) {
|
|
@@ -72,12 +80,13 @@ public class resistanceCalculator {
|
|
|
}
|
|
|
|
|
|
float calcEnergyAfterResistance(float currentEnergy, double lowDistance, double highDistance, float energyRequiredForPowerplantBlackstart){
|
|
|
- double energyAfterLowVoltage = calcEnergyAfterPartOfGrid(currentEnergy, lowVoltage, lowDistance, energyRequiredForPowerplantBlackstart);
|
|
|
+ double energyAfterLowVoltage = calcEnergyAfterPartOfGrid(currentEnergy, lowVoltage, lowDistance, lowSpecificMaterialResistance, lowDiameter, energyRequiredForPowerplantBlackstart);
|
|
|
energyAfterLowVoltage = (0.98 * energyAfterLowVoltage); //transfomer loses
|
|
|
- return (float) calcEnergyAfterPartOfGrid(energyAfterLowVoltage, highVoltage, highDistance, energyRequiredForPowerplantBlackstart);
|
|
|
+ return (float) calcEnergyAfterPartOfGrid(energyAfterLowVoltage, highVoltage, highDistance, highSpecificMaterialResistance, highDiameter, energyRequiredForPowerplantBlackstart);
|
|
|
}
|
|
|
|
|
|
- private double calcEnergyAfterPartOfGrid(double currentEnergy, int voltage, double distance, float energyRequiredForPowerplantBlackstart){
|
|
|
+ private double calcEnergyAfterPartOfGrid(double currentEnergy, int voltage, double distance,
|
|
|
+ double specificMaterialResistance, int diameter, float energyRequiredForPowerplantBlackstart){
|
|
|
double blackstartResistance = blackstartResistance(voltage, energyRequiredForPowerplantBlackstart);
|
|
|
double cableResistance = cableResistance(specificMaterialResistance, distance, diameter);
|
|
|
return (1 - (cableResistance / (cableResistance + blackstartResistance))) * currentEnergy;
|
|
@@ -92,12 +101,13 @@ public class resistanceCalculator {
|
|
|
}
|
|
|
|
|
|
float calcEnergyNeededForCertainEnergyAfterResistance(float energyWanted, double lowDistance, double highDistance, float energyRequiredForPowerplantBlackstart){
|
|
|
- double energyBeforeHighVoltage = calcEnergyNeededBeforePartOfGrid(energyWanted, highVoltage, highDistance,energyRequiredForPowerplantBlackstart);
|
|
|
+ double energyBeforeHighVoltage = calcEnergyNeededBeforePartOfGrid(energyWanted, highVoltage, highDistance, highSpecificMaterialResistance, highDiameter, energyRequiredForPowerplantBlackstart);
|
|
|
energyBeforeHighVoltage = 1.02 * energyBeforeHighVoltage;
|
|
|
- return (float) calcEnergyNeededBeforePartOfGrid(energyBeforeHighVoltage, lowVoltage, lowDistance, energyRequiredForPowerplantBlackstart);
|
|
|
+ return (float) calcEnergyNeededBeforePartOfGrid(energyBeforeHighVoltage, lowVoltage, lowDistance, lowSpecificMaterialResistance, lowDiameter, energyRequiredForPowerplantBlackstart);
|
|
|
}
|
|
|
|
|
|
- private double calcEnergyNeededBeforePartOfGrid(double energyWanted, int voltage, double distance, float energyRequiredForPowerplantBlackstart){
|
|
|
+ private double calcEnergyNeededBeforePartOfGrid(double energyWanted, int voltage, double distance,
|
|
|
+ double specificMaterialResistance, int diameter, float energyRequiredForPowerplantBlackstart){
|
|
|
double blackstartResistance = blackstartResistance(voltage, energyRequiredForPowerplantBlackstart);
|
|
|
double cableResistance = cableResistance(specificMaterialResistance, distance, diameter);
|
|
|
return (energyWanted / (1 - (cableResistance / (cableResistance + blackstartResistance))));
|