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

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

Bugfix: sign connector losses

parent e3d43dab
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl
// 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_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
......
......@@ -36,7 +36,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent
var chargePower = Charger.Count == 0 ? 0.SI<Watt>() : Charger.Sum(x => x.PowerDemand(absTime, dt, powerDemand, auxDemand, dryRun));
var currentEst = powerDemand / Battery.InternalVoltage;
var connectorLoss = currentEst * (ModelData?.ConnectionSystemResistance ?? 0.SI<Ohm>() ) * currentEst;
var totalPowerDemand = powerDemand + chargePower - auxDemand + connectorLoss;
var totalPowerDemand = powerDemand + chargePower - auxDemand - connectorLoss;
var batResponse = Battery.MainBatteryPort.Request(absTime, dt, totalPowerDemand, dryRun);
......@@ -156,7 +156,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent
ConnectorLoss = connectorLoss;
}
public Watt TotalPowerDemand => ConsumerPower + ChargePower - AuxPower + ConnectorLoss;
public Watt TotalPowerDemand => ConsumerPower + ChargePower - AuxPower;
public State Clone() => (State)MemberwiseClone();
}
......
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