Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 2c8b15e2 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Merge remote-tracking branch 'origin/develop' into dev/9-multi-target

parents c882de33 2e4bc3db
No related branches found
No related tags found
No related merge requests found
...@@ -53,10 +53,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data ...@@ -53,10 +53,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
var r1 = a.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque); var r1 = a.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
var r2 = b.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque); var r2 = b.EfficiencyMap.LookupTorque(electricPower, avgSpeed, maxEmTorque);
if (r1 == null && r2 == null) { if (r1 is null && r2 is null) {
return null; return null;
} }
// if one of the values is limited by EM, but the other is not (is null): use maxEmTorque instead
if (r1 is null) {
r1 = maxEmTorque;
}
if (r2 is null) {
r2 = maxEmTorque;
}
var retVal = VectoMath.Interpolate(a.Voltage, b.Voltage, var retVal = VectoMath.Interpolate(a.Voltage, b.Voltage,
r1, r2, voltage); r1, r2, voltage);
var elPwr = LookupElectricPower(voltage, avgSpeed, retVal, true); var elPwr = LookupElectricPower(voltage, avgSpeed, retVal, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment