Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 906c478f authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge branch...

Merge branch 'feature/CodeEU-48_Consider-JunctionBox-ConnectorsSubsystemsIncluded' into 'amdm2/develop'

fix: calculation of max em power in case cable resistance is 0

See merge request !18
parents 5bf82210 e3d43dab
No related branches found
No related tags found
2 merge requests!34building new release candidate version,!18fix: calculation of max em power in case cable resistance is 0
......@@ -85,19 +85,24 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
protected Watt CalculateMaxEMPower(Watt P_batMax, Volt U_int)
{
//Note: consider losses of electric system (cables, junction box) when calculating max drive power
// see ElectricSystem implementation...
// I_est = P_EM / U_Int
// P_Conn = I_est ^ 2 * R_Conn = (P_EM / U_Int) ^ 2 * R_Conn
// P_EM_max = P_Bat_max - P_Chg + P_aux +P_Conn(P_EM)
// P_EM_max + P_Conn = P_Bat_max - P_Chg + P_aux
// P_EM_max + ((P_EM_max + P_Chg - P_aux) / U_Int) ^ 2 * R_Conn = P_Bat_max - P_Chg + P_aux
// P_EM_max^2 * R_Conn / U_Int^2 + P_EM_max - (P_Bat_max - P_Chg + P_aux) = 0
//Note: consider losses of electric system (cables, junction box) when calculating max drive power
// see ElectricSystem implementation...
// I_est = P_EM / U_Int
// P_Conn = I_est ^ 2 * R_Conn = (P_EM / U_Int) ^ 2 * R_Conn
// P_EM_max = P_Bat_max - P_Chg + P_aux + P_Conn(P_EM)
// P_EM_max + P_Conn = P_Bat_max - P_Chg + P_aux
// P_EM_max + ((P_EM_max + P_Chg - P_aux) / U_Int) ^ 2 * R_Conn = P_Bat_max - P_Chg + P_aux
// P_EM_max^2 * R_Conn / U_Int^2 + P_EM_max - (P_Bat_max - P_Chg + P_aux) = 0
// Px = P_Bat_max - P_Chg + P_aux
var Px = P_batMax -
(ChargingPower != null ? ChargingPower : 0.SI<Watt>()) +
(AuxPower != null ? AuxPower : 0.SI<Watt>());
if (ConnectionSystemResistance.IsEqual(0)) {
return Px;
}
var a = (ConnectionSystemResistance / U_int / U_int).Value();
var b = 1.0;
var c = -Px.Value();
......
......@@ -146,6 +146,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response.MaxDischargePower = maxDischargePower;
response.PowerDemand = powerDemand;
response.LossPower = batteryLoss;
response.InternalVoltage = InternalVoltage;
return response;
}
......
......@@ -373,6 +373,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response.MaxDischargePower = maxDischargePower;
response.PowerDemand = powerDemand;
response.LossPower = batteryLoss;
response.InternalVoltage = InternalVoltage;
return response;
}
......
......@@ -64,8 +64,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
MaxChargePower = double.MaxValue.SI<Watt>(),
MaxDischargePower = -double.MaxValue.SI<Watt>(),
AbsTime = absTime,
InternalVoltage = 0.SI<Volt>()
},
ConsumerPower = powerDemand
ConsumerPower = powerDemand,
ConnectionSystemResistance = 0.SI<Ohm>(),
};
}
......
......@@ -169,6 +169,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response.MaxDischargePower = maxDischargePower;
response.PowerDemand = powerDemand;
response.LossPower = batteryLoss;
response.InternalVoltage = InternalVoltage;
return response;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment