Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

use torque to decide if propel or recuperate

parent 55ebffa7
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data {
public NewtonMeter LookupTorque(Watt batPower, PerSecond avgSpeed, NewtonMeter maxEmTorque)
{
var elPowerMaxEM = LookupElectricPower(avgSpeed, maxEmTorque, true);
if (batPower < 0) {
if (maxEmTorque < 0) { // distinguish between propulsion and recuperation
if (!elPowerMaxEM.Extrapolated & elPowerMaxEM.ElectricalPower.IsGreaterOrEqual(batPower)) {
// the battery can provide more electric power than the EM - no limitation here
return null;
......
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