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

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

CycleClutch: Added Search for Idling-Operating point if ResponseUnderload from Engine

parent 541efcf0
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,13 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
......@@ -59,7 +63,27 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
} else {
// disengaged -> clutch open
var retVal = NextComponent.Request(absTime, dt, outTorque, angularVelocityIn, dryRun);
return retVal;
if (dryRun) {
return retVal;
} else {
retVal.Switch().
Case<ResponseSuccess>().
Case<ResponseUnderload>(r => {
var angularSpeed = SearchAlgorithm.Search(angularVelocityIn, r.Delta,
Constants.SimulationSettings.EngineIdlingSearchInterval,
getYValue: result => ((ResponseDryRun)result).DeltaDragLoad,
evaluateFunction: n => NextComponent.Request(absTime, dt, outTorque, n, true),
criterion: result => ((ResponseDryRun)result).DeltaDragLoad.Value());
Log.Debug(
"Found operating point for idling in cycle clutch. absTime: {0}, dt: {1}, torque: {2}, angularSpeed: {3}",
absTime, dt,
outTorque, angularSpeed);
retVal = NextComponent.Request(absTime, dt, outTorque, angularSpeed);
}).
Default(r => { throw new UnexpectedResponseException("searching CycleClutch Idling point", r); });
return retVal;
}
}
}
......
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