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

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

bugfix in electric motor: max power caluclated for discharge may be greater...

bugfix in electric motor: max power caluclated for discharge may be greater than 0 because assumed current is higher than current for max power
parent c9419645
No related branches found
No related tags found
No related merge requests found
......@@ -52,12 +52,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public Watt MaxDischargePower(Second dt)
{
var maxPower = -InternalVoltage / (4 * ModelData.InternalResistance) * InternalVoltage;
var maxPowerCurrent = maxPower / InternalVoltage;
var maxDischargeCurrent =
VectoMath.Max((ModelData.Capacity * ModelData.MinVoltage - PreviousState.Charge) / dt,
ModelData.MaxCurrentDischarge);
maxDischargeCurrent = VectoMath.Max(maxDischargeCurrent, maxPowerCurrent);
var maxDischargePower = InternalVoltage * maxDischargeCurrent +
maxDischargeCurrent * ModelData.InternalResistance * maxDischargeCurrent;
var maxPower = -InternalVoltage / (4 * ModelData.InternalResistance) * InternalVoltage;
return VectoMath.Max(maxDischargePower, maxPower);
}
......
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