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

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

Merge pull request #702 in VECTO/vecto-sim from...

Merge pull request #702 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:bugfix/VECTO-696_regression to develop

* commit '90e859f3':
  correct testcase: expected torque loss is 0 in case the angular speed is 0
  Gearbox: set torque loss to 0 if angular speed is 0. already done for transmission component and gearbox when disengaged. added for engaged gear.
parents 3ba75410 90e859f3
No related branches found
No related tags found
No related merge requests found
......@@ -316,6 +316,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var avgInAngularVelocity = (PreviousState.InAngularVelocity + inAngularVelocity) / 2.0;
var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;
var inTorqueLossResult = ModelData.Gears[Gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque);
if (avgOutAngularVelocity.IsEqual(0, 1e-9)) {
inTorqueLossResult.Value = 0.SI<NewtonMeter>();
}
var inTorque = !avgInAngularVelocity.IsEqual(0)
? outTorque * (avgOutAngularVelocity / avgInAngularVelocity)
: outTorque / ModelData.Gears[Gear].Ratio;
......
......@@ -448,7 +448,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
TestCase(2, 50, 600, 9.096, typeof(ResponseSuccess)),
TestCase(2, 2050, 1200, 52.132, typeof(ResponseSuccess)),
TestCase(2, 850, 600, 25.096, typeof(ResponseSuccess)),
TestCase(1, 850, 0, 22.06, typeof(ResponseSuccess)),
TestCase(1, 850, 0, 0, typeof(ResponseSuccess)), // torque loss is 0 if speed is 0
]
public void Gearbox_Request_engaged(int gear, double t, double n, double loss, Type responseType)
{
......
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