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

Skip to content
Snippets Groups Projects
Commit 372fd5ef authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

fix: computation of slope for changing engine speed during traction interruption

parent 6eff5f5d
No related branches found
No related tags found
No related merge requests found
......@@ -444,7 +444,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var tStar = tStarPrev + PreviousState.dt;
dynFullPowerCalculated = stationaryFullLoadPower * (1 - Math.Exp((-tStar / pt1).Value()));
dynFullPowerCalculated = VectoMath.Max(PreviousState.EnginePower, dynFullPowerCalculated);
} catch (Exception ) {
} catch (Exception) {
Log.Error("failed to calculate dynamic full-load power - using stationary idle full-load. n: {0}", angularVelocity);
}
}
......@@ -500,6 +500,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private Second _idleStart;
private Watt _lastEnginePower;
private PerSecond _engineTargetSpeed;
public ITnOutPort RequestPort { private get; set; }
......@@ -539,11 +540,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (!outTorque.IsEqual(0)) {
throw new VectoException("Torque has to be 0 for idle requests!");
}
var targetVelocity = _engine.PreviousState.EngineSpeed / _dataBus.GetGearData(_dataBus.Gear).Ratio *
if (_idleStart == null) {
_idleStart = absTime;
_engineTargetSpeed = _engine.PreviousState.EngineSpeed / _dataBus.GetGearData(_dataBus.Gear).Ratio *
_dataBus.GetGearData(_dataBus.NextGear.Gear).Ratio;
var velocitySlope = (targetVelocity - _engine.PreviousState.EngineSpeed) / _dataBus.TractionInterruption;
}
var velocitySlope = (_engineTargetSpeed - _engine.PreviousState.EngineSpeed) / (_dataBus.TractionInterruption - (absTime - _idleStart));
var nextAngularSpeed = (velocitySlope * dt + _engine.PreviousState.EngineSpeed);
var nextAngularSpeed = (velocitySlope * dt + _engine.PreviousState.EngineSpeed);
if (nextAngularSpeed < _engine.ModelData.IdleSpeed) {
nextAngularSpeed = _engine.ModelData.IdleSpeed;
}
......
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