From 35002a993a3fc56fd8b1e9702cf9a16fa7b257af Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Wed, 11 May 2016 12:05:57 +0200 Subject: [PATCH] LAC check, added some data on DataBus Interface --- .../Models/Simulation/DataBus/IEngineInfo.cs | 3 +- .../Models/Simulation/DataBus/IGearboxInfo.cs | 3 +- .../Models/Simulation/DataBus/IVehicleInfo.cs | 3 + .../Simulation/Impl/VehicleContainer.cs | 21 ++++- .../Impl/CombustionEngine.cs | 5 ++ .../SimulationComponent/Impl/CycleGearbox.cs | 8 ++ .../Impl/DefaultDriverStrategy.cs | 76 +++++++++++++++++-- .../Models/SimulationComponent/Impl/Driver.cs | 29 +++---- .../SimulationComponent/Impl/Gearbox.cs | 10 ++- .../SimulationComponent/Impl/Vehicle.cs | 5 +- .../Models/SimulationComponent/VehicleTest.cs | 1 + VectoCore/VectoCoreTest/Utils/MockGearbox.cs | 5 +- VectoCore/VectoCoreTest/Utils/MockPorts.cs | 8 +- .../Utils/MockVairVehicleContainer.cs | 18 +++++ VectoCore/VectoCoreTest/Utils/MockVehicle.cs | 10 +++ 15 files changed, 171 insertions(+), 34 deletions(-) diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs index 33e0e7bcd7..cbed6283ca 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IEngineInfo.cs @@ -43,13 +43,14 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus /// </summary> PerSecond EngineSpeed { get; } + NewtonMeter EngineTorque { get; } + Watt EngineStationaryFullPower(PerSecond angularSpeed); Watt EngineDragPower(PerSecond angularSpeed); PerSecond EngineIdleSpeed { get; } - PerSecond EngineRatedSpeed { get; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs index 395746f34d..a675388706 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs @@ -45,11 +45,12 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus /// <returns></returns> uint Gear { get; } - MeterPerSecond StartSpeed { get; } MeterPerSquareSecond StartAcceleration { get; } FullLoadCurve GearFullLoadCurve { get; } + + Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque); } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IVehicleInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IVehicleInfo.cs index 64b5ae61f2..e481bd8727 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IVehicleInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IVehicleInfo.cs @@ -51,5 +51,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus Kilogram VehicleLoading { get; } Kilogram TotalMass { get; } + + Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, Second dt); + Newton RollingResistance(Radian gradient); } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index 462023c637..8090ed60ee 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -116,6 +116,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl get { return Gearbox != null ? Gearbox.GearFullLoadCurve : null; } } + public Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque) + { + return Gearbox.GearboxLoss(inAngularVelocity, inTorque); + } + #endregion #region IEngineCockpit @@ -133,6 +138,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } } + public NewtonMeter EngineTorque + { + get { return Engine.EngineTorque; } + } + public Watt EngineStationaryFullPower(PerSecond angularSpeed) { return Engine.EngineStationaryFullPower(angularSpeed); @@ -177,6 +187,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl get { return Vehicle != null ? Vehicle.TotalMass : 0.SI<Kilogram>(); } } + public Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, Second dt) + { + return Vehicle.AirDragResistance(previousVelocity, acceleration, dt); + } + + public Newton RollingResistance(Radian gradient) + { + return Vehicle.RollingResistance(gradient); + } + #endregion public VehicleContainer(ExecutionMode executionMode, IModalDataContainer modData = null, @@ -231,7 +251,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl _components = _components.OrderBy(x => x.Item1).Reverse().ToList(); } - public void CommitSimulationStep(Second time, Second simulationInterval) { Log.Info("VehicleContainer committing simulation. time: {0}, dist: {1}, speed: {2}", time, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 90c9b97008..d6bf3efdcf 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -97,6 +97,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return PreviousState.EngineSpeed; } } + public NewtonMeter EngineTorque + { + get { return PreviousState.EngineTorque; } + } + public Watt EngineStationaryFullPower(PerSecond angularSpeed) { return ModelData.FullLoadCurve.FullLoadStationaryTorque(angularSpeed) * angularSpeed; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index 76a4f03349..6a32160a24 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -112,6 +112,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return Gear == 0 ? null : ModelData.Gears[Gear].FullLoadCurve; } } + public Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque) + { + var outTorque = ModelData.Gears[Gear].LossMap.GetOutTorque(inAngularVelocity, inTorque, true); + var torqueLoss = inTorque - outTorque * ModelData.Gears[Gear].Ratio; + + return torqueLoss * inAngularVelocity; + } + #endregion #region ITnInPort diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index ddcf7e0624..9e10084aa6 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -36,8 +36,11 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; +using TUGraz.VectoCore.InputData.Impl; using TUGraz.VectoCore.Models.Connector.Ports.Impl; +using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.DataBus; +using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; using DriverData = TUGraz.VectoCore.Models.SimulationComponent.Data.DriverData; @@ -70,7 +73,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected internal DrivingBehaviorEntry BrakeTrigger { get; set; } - public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient) { if (CurrentDrivingMode == DrivingMode.DrivingModeBrake) { @@ -83,6 +85,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } if (CurrentDrivingMode == DrivingMode.DrivingModeDrive) { var currentDistance = Driver.DataBus.Distance; + + var coasting = CheckLookAheadCoasting(ds); + UpdateDrivingAction(currentDistance, ds); if (NextDrivingAction != null) { var remainingDistance = NextDrivingAction.ActionDistance - currentDistance; @@ -111,6 +116,70 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } + /// <summary> + /// Checks if Look Ahead Coasting triggers + /// </summary> + private bool CheckLookAheadCoasting(Meter ds) + { + // (1) & (2) : x_decelerationpoint - d_prev <= x_veh < x_decelerationpoint + var d_prev = 10 * Driver.DataBus.VehicleSpeed.ConvertTo().Kilo.Meter.Per.Hour.Value(); + var lookAheadData = Driver.DataBus.LookAhead(d_prev.SI<Meter>()); + + // only deceleration points! + var v_veh = Driver.DataBus.VehicleSpeed; + var decelerationLookAhead = lookAheadData.Where(e => e.VehicleTargetSpeed <= v_veh); + + // (4) v_veh < v_max_deceleration * 0.98 + foreach (var dec in decelerationLookAhead) { + var x_dec = dec.Distance; + var x_delta = x_dec - Driver.DataBus.Distance; + var v_target = dec.VehicleTargetSpeed; + var retVal = new OperatingPoint { SimulationDistance = x_dec }; + + var x_max_deceleration = Driver.ComputeDecelerationDistance(v_target); + var coastingPossible = x_delta < x_max_deceleration * 0.98; + + // 3. CDP > DF_coasting + if (coastingPossible) { + var m = Driver.DataBus.VehicleMass; + var g = Physics.GravityAccelleration; + var h_target = dec.Altitude; + + // todo mk-2016-05-11 left or right sample of cycle data? + var h_vehicle = Driver.DataBus.CycleData.LeftSample.Altitude; + + var E_kin_veh = m * v_veh * v_veh / 2; + var E_kin_target = m * v_target * v_target / 2; + var E_pot_target = m * g * h_target; + var E_pot_veh = m * g * h_vehicle; + + var delta_E_deceleration = (E_kin_veh + E_pot_veh) - (E_kin_target + E_pot_target); + + var f_dec_average = delta_E_deceleration / x_delta; + + var avgVelocity = (v_veh + v_target) / 2; + var acc = (v_target - v_veh) * (avgVelocity / ds); + var F_air = Driver.DataBus.AirDragResistance(v_veh, acc, ds / v_veh); + var F_roll = Driver.DataBus.RollingResistance(Driver.DataBus.CycleData.LeftSample.RoadGradient); + + var P_enginedrag = Driver.DataBus.EngineDragPower(Driver.DataBus.EngineSpeed); + var P_loss_gb = Driver.DataBus.GearboxLoss(Driver.DataBus.EngineSpeed, Driver.DataBus.EngineTorque); + + // todo mk-2016-05-11 calculate ra loss + var P_loss_ra = 0.SI<Watt>(); + + var f_coasting = F_air + F_roll + (P_enginedrag + P_loss_gb + P_loss_ra) / v_veh; + + var CDP = f_dec_average / f_coasting; + var DF_coasting = LACDecisionFactor.Lookup(v_target, v_veh - v_target); + + return CDP > DF_coasting; + } + } + + return false; + } + public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient) { Driver.DriverBehavior = DrivingBehavior.Halted; @@ -118,7 +187,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return Driver.DrivingActionHalt(absTime, dt, targetVelocity, gradient); } - private void UpdateDrivingAction(Meter currentDistance, Meter ds) { var nextAction = GetNextDrivingAction(currentDistance, ds); @@ -166,7 +234,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("Next Driving Action: {0}", NextDrivingAction); } - protected DrivingBehaviorEntry GetNextDrivingAction(Meter minDistance, Meter ds) { var currentSpeed = Driver.DataBus.VehicleSpeed; @@ -225,7 +292,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //===================================== - public interface IDriverMode { DefaultDriverStrategy DriverStrategy { get; set; } @@ -266,7 +332,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return response; } - // if we accelerate in the current simulation interval the ActionDistance of the next action // changes and we might pass the ActionDistance - check again... if (response.Acceleration <= 0) { @@ -292,7 +357,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //DriverStrategy.BrakeTrigger = DriverStrategy.NextDrivingAction; } - Log.Debug("Exceeding next ActionDistance at {0}. Reducing max Distance from {2} to {1}", DriverStrategy.NextDrivingAction.ActionDistance, newds, ds); return new ResponseDrivingCycleDistanceExceeded() { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 4804a1d41c..0ed256cafd 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -79,7 +79,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl NextComponent = other; } - public IResponse Initialize(MeterPerSecond vehicleSpeed, Radian roadGradient) { if (DriverData.LookAheadCoasting.Deceleration < DriverData.AccelerationCurve.MinDeceleration()) { @@ -99,7 +98,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient) { IterationStatistics.Increment(this, "Requests"); @@ -119,7 +117,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient) { IterationStatistics.Increment(this, "Requests"); @@ -156,7 +153,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl IResponse previousResponse = null) { IterationStatistics.Increment(this, "Accelerate"); - + Log.Debug("DrivingAction Accelerate"); var operatingPoint = ComputeAcceleration(ds, targetVelocity); @@ -352,7 +349,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return response; } - public IResponse DrivingActionBrake(Second absTime, Meter ds, MeterPerSecond nextTargetSpeed, Radian gradient, IResponse previousResponse = null, Meter targetDistance = null) { @@ -371,7 +367,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var nextAcceleration = DriverData.AccelerationCurve.Lookup(v2).Deceleration; var tmp = ComputeTimeInterval(VectoMath.Min(operatingPoint.Acceleration, nextAcceleration), operatingPoint.SimulationDistance); - if (!operatingPoint.Acceleration.IsEqual(nextAcceleration) && operatingPoint.SimulationDistance.IsEqual(tmp.SimulationDistance)) { + if (!operatingPoint.Acceleration.IsEqual(nextAcceleration) && + operatingPoint.SimulationDistance.IsEqual(tmp.SimulationDistance)) { // only adjust operating point if the acceleration is different but the simulation distance is not modified // i.e., braking to the next sample point (but a little bit slower) Log.Debug("adjusting acceleration from {0} to {1}", operatingPoint.Acceleration, tmp.Acceleration); @@ -464,7 +461,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - // ================================================ /// <summary> @@ -518,7 +514,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl initialResponse.Switch(). Case<ResponseGearShift>(r => { IterationStatistics.Increment(this, "SearchBrakingPower"); - var nextResp = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration,gradient, true); + var nextResp = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, + gradient, true); deltaPower = nextResp.GearboxPowerRequest; }). Case<ResponseUnderload>(r => @@ -536,7 +533,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl operatingPoint = ComputeTimeInterval(operatingPoint.Acceleration, ds); IterationStatistics.Increment(this, "SearchBrakingPower"); - return NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient,true); + return NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient, + true); }, criterion: result => { var response = (ResponseDryRun)result; @@ -545,7 +543,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }); return operatingPoint; - } catch (Exception) { Log.Error("Failed to find operating point for braking power! absTime: {0}", absTime); throw; @@ -625,10 +622,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } if (!retVal.Acceleration.IsBetween(DriverData.AccelerationCurve.MaxDeceleration(), - DriverData.AccelerationCurve.MaxAcceleration())) { - Log.Info("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); - } - return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); + DriverData.AccelerationCurve.MaxAcceleration())) { + Log.Info("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); + } + return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); } /// <summary> @@ -679,7 +676,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal.SimulationDistance); } - /// <summary> /// computes the distance required to decelerate from the current velocity to the given target velocity considering /// the drivers acceleration/deceleration curve. @@ -691,7 +687,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return DriverData.AccelerationCurve.ComputeAccelerationDistance(DataBus.VehicleSpeed, targetSpeed); } - /// <summary> /// Computes the time interval for driving the given distance ds with the vehicle's current speed and the given acceleration. /// If the distance ds can not be reached (i.e., the vehicle would halt before ds is reached) then the distance parameter is adjusted. @@ -784,7 +779,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - public IDrivingCycleOutPort OutPort() { return this; @@ -803,7 +797,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.Response = null; } - public class DriverState { // ReSharper disable once InconsistentNaming diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index c52d979cd5..e56011adb5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -128,6 +128,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return Gear == 0 ? null : ModelData.Gears[Gear].FullLoadCurve; } } + public Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque) + { + var outTorque = ModelData.Gears[Gear].LossMap.GetOutTorque(inAngularVelocity, inTorque, true); + var torqueLoss = inTorque - outTorque * ModelData.Gears[Gear].Ratio; + + return torqueLoss * inAngularVelocity; + } + #endregion #region ITnOutPort @@ -221,7 +229,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (DataBus.VehicleStopped) { _engageTime = absTime; } - + IResponse retVal; // TODO MQ 2016/03/10: investigate further the effects of having the condition angularvelocity != 0 if (ClutchClosed(absTime) /* && !angularVelocity.IsEqual(0) */) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs index f1f79f63bb..ccdb42b44a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs @@ -191,7 +191,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl AdvanceState(); } - protected internal Newton RollingResistance(Radian gradient) + public Newton RollingResistance(Radian gradient) { var weight = ModelData.TotalVehicleWeight(); var gravity = Physics.GravityAccelleration; @@ -216,8 +216,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - protected internal Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, - Second dt) + public Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, Second dt) { var vAverage = previousVelocity + acceleration * dt / 2; if (vAverage.IsEqual(0)) { diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs index cc373bbc98..1182e073c2 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs @@ -40,6 +40,7 @@ using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Impl; using TUGraz.VectoCore.Tests.Utils; +using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Tests.Models.SimulationComponent { diff --git a/VectoCore/VectoCoreTest/Utils/MockGearbox.cs b/VectoCore/VectoCoreTest/Utils/MockGearbox.cs index f41e7497ff..0cd19ce42f 100644 --- a/VectoCore/VectoCoreTest/Utils/MockGearbox.cs +++ b/VectoCore/VectoCoreTest/Utils/MockGearbox.cs @@ -74,6 +74,10 @@ namespace TUGraz.VectoCore.Tests.Utils get { return null; } } + public Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque) + { + return 0.SI<Watt>(); + } public void Connect(ITnOutPort other) { @@ -99,7 +103,6 @@ namespace TUGraz.VectoCore.Tests.Utils throw new NotImplementedException(); } - protected override void DoWriteModalResults(IModalDataContainer container) { // nothing to write diff --git a/VectoCore/VectoCoreTest/Utils/MockPorts.cs b/VectoCore/VectoCoreTest/Utils/MockPorts.cs index 728b9e77df..0c06492212 100644 --- a/VectoCore/VectoCoreTest/Utils/MockPorts.cs +++ b/VectoCore/VectoCoreTest/Utils/MockPorts.cs @@ -96,6 +96,11 @@ namespace TUGraz.VectoCore.Tests.Utils get { return AngularVelocity; } } + public NewtonMeter EngineTorque + { + get { return Torque; } + } + public Watt EngineStationaryFullPower(PerSecond angularSpeed) { return 2300.SI<NewtonMeter>() * angularSpeed; @@ -133,7 +138,7 @@ namespace TUGraz.VectoCore.Tests.Utils Velocity = targetVelocity; Gradient = gradient; Log.Debug("Request: absTime: {0}, ds: {1}, velocity: {2}, gradient: {3}", absTime, ds, targetVelocity, gradient); - return new ResponseSuccess() { Source = this}; + return new ResponseSuccess() { Source = this }; } public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient) @@ -164,7 +169,6 @@ namespace TUGraz.VectoCore.Tests.Utils public Newton Force { get; set; } public MeterPerSecond Velocity { get; set; } - public IResponse Request(Second absTime, Second dt, Newton force, MeterPerSecond velocity, bool dryRun = false) { AbsTime = absTime; diff --git a/VectoCore/VectoCoreTest/Utils/MockVairVehicleContainer.cs b/VectoCore/VectoCoreTest/Utils/MockVairVehicleContainer.cs index 16563f53e1..de71ced5fe 100644 --- a/VectoCore/VectoCoreTest/Utils/MockVairVehicleContainer.cs +++ b/VectoCore/VectoCoreTest/Utils/MockVairVehicleContainer.cs @@ -51,7 +51,14 @@ namespace TUGraz.VectoCore.Tests.Utils public MeterPerSecond StartSpeed { get; private set; } public MeterPerSquareSecond StartAcceleration { get; private set; } public FullLoadCurve GearFullLoadCurve { get; private set; } + + public Watt GearboxLoss(PerSecond inAngularVelocity, NewtonMeter inTorque) + { + throw new System.NotImplementedException(); + } + public PerSecond EngineSpeed { get; private set; } + public NewtonMeter EngineTorque { get; private set; } public Watt EngineStationaryFullPower(PerSecond angularSpeed) { @@ -69,6 +76,17 @@ namespace TUGraz.VectoCore.Tests.Utils public Kilogram VehicleMass { get; private set; } public Kilogram VehicleLoading { get; private set; } public Kilogram TotalMass { get; private set; } + + public Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, Second dt) + { + throw new System.NotImplementedException(); + } + + public Newton RollingResistance(Radian gradient) + { + throw new System.NotImplementedException(); + } + public Meter Distance { get; private set; } public bool ClutchClosed(Second absTime) diff --git a/VectoCore/VectoCoreTest/Utils/MockVehicle.cs b/VectoCore/VectoCoreTest/Utils/MockVehicle.cs index 44081233f8..6e2ac79d6c 100644 --- a/VectoCore/VectoCoreTest/Utils/MockVehicle.cs +++ b/VectoCore/VectoCoreTest/Utils/MockVehicle.cs @@ -88,6 +88,16 @@ namespace TUGraz.VectoCore.Tests.Utils get { return VehicleMass; } } + public Newton AirDragResistance(MeterPerSecond previousVelocity, MeterPerSquareSecond acceleration, Second dt) + { + throw new NotImplementedException(); + } + + public Newton RollingResistance(Radian gradient) + { + throw new NotImplementedException(); + } + public void Connect(IFvOutPort other) { NextComponent = other; -- GitLab