diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index f1700d328c94f2b9de7dd5718be8a83e0308fed9..92b0c3d694ff527e5b262f53ea1161527ca3be7d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -319,7 +319,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl currentGear > 1 ? ModelData.Gears[currentGear].ShiftPolygon.InterpolateDownshift(response.EngineSpeed) : double.MaxValue.SI<NewtonMeter>()); - var reserve = 1 - inTorque / maxTorque; + var reserve = maxTorque.IsEqual(0) ? -1 : (1 - inTorque / maxTorque).Value(); if (reserve >= ModelData.TorqueReserve && IsBelowUpShiftCurve(currentGear, inTorque, inAngularVelocity)) { continue; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index a61d618f14425a2072e264b65f96aef65f6fc0b2..e35060782f54176735a71f1934eeaa8178c3142b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -184,7 +184,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var fullDragTorque = ModelData.FullLoadCurve.DragLoadStationaryTorque(avgEngineSpeed); var dynamicFullLoadPower = ComputeFullLoadPower(avgEngineSpeed, dt, dryRun); if (dynamicFullLoadPower < 0) { - dynamicFullLoadPower = double.MinValue.SI<Watt>(); + dynamicFullLoadPower = 0.SI<Watt>(); } var dynamicFullLoadTorque = dynamicFullLoadPower / avgEngineSpeed; var inertiaTorqueLoss = diff --git a/VectoCore/VectoCore/OutputData/ModFilter/ModalData1HzFilter.cs b/VectoCore/VectoCore/OutputData/ModFilter/ModalData1HzFilter.cs index 929f9b2e11d3a2d70197e30d9610e8f514f8029e..aaf1c8c3e2e200180e740c85aac20c555f7e7a6a 100644 --- a/VectoCore/VectoCore/OutputData/ModFilter/ModalData1HzFilter.cs +++ b/VectoCore/VectoCore/OutputData/ModFilter/ModalData1HzFilter.cs @@ -157,6 +157,10 @@ namespace TUGraz.VectoCore.OutputData.ModFilter var dt = remainingDt; var a = (MeterPerSquareSecond)last[(int)ModalResultField.acc]; var ds = v * dt + a / 2 * dt * dt; + if (v.IsEqual(0)) { + ds = 0.SI<Meter>(); + a = 0.SI<MeterPerSquareSecond>(); + } if (ds.IsSmaller(0)) { throw new VectoSimulationException("1Hz-Filter: simulation distance must not be negative. ds: {0} {1}", ds, "4"); }