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 23026cdf authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

bugfix retarder: current state is not updated on dry-run request but used to call next component

parent a308454f
No related branches found
No related tags found
No related merge requests found
......@@ -77,10 +77,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
var avgAngularSpeed = (PreviousState.InAngularVelocity + angularVelocity) / 2.0;
var retarderTorqueLoss = avgAngularSpeed.IsEqual(0, 1e-9) ? 0.SI<NewtonMeter>() : _lossMap.GetTorqueLoss(avgAngularSpeed * _ratio) * _ratio;
var inTorque = torque + retarderTorqueLoss;
if (!dryRun) {
CurrentState.SetState(torque + retarderTorqueLoss, angularVelocity, torque, angularVelocity);
CurrentState.SetState(inTorque, angularVelocity, torque, angularVelocity);
}
return NextComponent.Request(absTime, dt, CurrentState.InTorque, CurrentState.InAngularVelocity, dryRun);
return NextComponent.Request(absTime, dt, inTorque, angularVelocity, dryRun);
}
protected override void DoWriteModalResults(Second time, Second simulationInterval, IModalDataContainer container)
......
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