Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 086be7e4 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

make it compile again after merge

parent 08dcd48f
Branches
Tags
No related merge requests found
......@@ -81,5 +81,6 @@ namespace TUGraz.VectoCore.Models.Connector.Ports
/// <param name="startAcceleration"></param>
/// <param name="roadGradient"></param>
/// <returns></returns>
IResponse Initialize(MeterPerSecond vehicleSpeed, Radian roadGradient, MeterPerSquareSecond startAcceleration);
}
}
\ No newline at end of file
......@@ -241,11 +241,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
break;
case RetarderData.RetarderType.None:
tmp = AddComponent(tmp, GetGearbox(container, data.GearboxData));
tmp = AddComponent(tmp, new DummyRetarder(_container));
tmp = AddComponent(tmp, new DummyRetarder(container));
break;
case RetarderData.RetarderType.LossesIncludedInTransmission:
tmp = AddComponent(tmp, GetGearbox(container, data.GearboxData));
tmp = AddComponent(tmp, new DummyRetarder(_container));
tmp = AddComponent(tmp, new DummyRetarder(container));
break;
default:
throw new ArgumentOutOfRangeException();
......
......@@ -247,7 +247,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
EngineSpeed = angularSpeed,
dt = 1.SI<Second>(),
InertiaTorqueLoss = 0.SI<NewtonMeter>(),
StationaryFullLoadTorque = Data.FullLoadCurve.FullLoadStationaryTorque(angularSpeed),
StationaryFullLoadTorque = ModelData.FullLoadCurve.FullLoadStationaryTorque(angularSpeed),
FullDragTorque = ModelData.FullLoadCurve.DragLoadStationaryTorque(angularSpeed),
EngineTorque = torque + auxDemand,
EnginePower = (torque + auxDemand) * angularSpeed,
......@@ -343,29 +343,25 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
CurrentState.StationaryFullLoadTorque = ModelData.FullLoadCurve.FullLoadStationaryTorque(angularVelocity);
var stationaryFullLoadPower = CurrentState.StationaryFullLoadTorque * angularVelocity;
var pt1 = ModelData.FullLoadCurve.PT1(angularVelocity).Value();
Watt dynFullPowerCalculated;
// disable pt1 behaviour if PT1Disabled is true, or if the previous enginepower is greater than the current stationary fullload power (in this case the pt1 calculation fails)
if (PT1Disabled || PreviousState.EnginePower.IsGreaterOrEqual(CurrentState.StationaryFullLoadPower)) {
dynFullPowerCalculated = CurrentState.StationaryFullLoadPower;
if (PT1Disabled || PreviousState.EnginePower.IsGreaterOrEqual(stationaryFullLoadPower)) {
dynFullPowerCalculated = stationaryFullLoadPower;
} else {
var pt1 = Data.FullLoadCurve.PT1(angularVelocity).Value();
var powerRatio = (PreviousState.EnginePower / CurrentState.StationaryFullLoadPower).Value();
var tStarPrev = pt1 * Math.Log(1 / (1 - powerRatio), Math.E).SI<Second>();
var pt1 = ModelData.FullLoadCurve.PT1(angularVelocity).Value();
var powerRatio = (PreviousState.EnginePower / stationaryFullLoadPower).Value();
var tStarPrev = pt1 * Math.Log(1.0 / (1 - powerRatio), Math.E).SI<Second>();
var tStar = tStarPrev + PreviousState.dt;
dynFullPowerCalculated = CurrentState.StationaryFullLoadPower * (1 - Math.Exp((-tStar / pt1).Value()));
dynFullPowerCalculated = stationaryFullLoadPower * (1 - Math.Exp((-tStar / pt1).Value()));
}
? dynFullPowerCalculated
: stationaryFullLoadPower;
// new check in vecto 3.x (according to Martin Rexeis)
if (dynamicFullLoadPower < StationaryIdleFullLoadPower) {
dynamicFullLoadPower = StationaryIdleFullLoadPower;
if (dynFullPowerCalculated < StationaryIdleFullLoadPower) {
dynFullPowerCalculated = StationaryIdleFullLoadPower;
}
return dynamicFullLoadPower;
return dynFullPowerCalculated;
}
protected bool IsFullLoad(Watt requestedPower, Watt maxPower)
......
......@@ -122,7 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var dt = Constants.SimulationSettings.TargetTimeInterval;
// MK 2016-02-10: SI doesn't allow inifinity anymore -- therefore simply a very negative value is used.
ShiftTime = -1e10.SI<Second>(); //double.NegativeInfinity.SI<Second>();
_shiftTime = -1e10.SI<Second>(); //double.NegativeInfinity.SI<Second>();
if (Disengaged) {
Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity);
......@@ -133,7 +133,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var torqueLossInertia = outAngularVelocity.IsEqual(0)
? 0.SI<NewtonMeter>()
: Formulas.InertiaPower(inAngularVelocity, PreviousState.InAngularVelocity, ModelData.Inertia, dt) / inAngularVelocity;
: Formulas.InertiaPower(inAngularVelocity, PreviousState.InAngularVelocity, ModelData.Inertia, dt) /
inAngularVelocity;
inTorque += torqueLossInertia;
......@@ -171,7 +172,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Case<ResponseUnderload>().
Default(r => { throw new UnexpectedResponseException("Gearbox.Initialize", r); });
var fullLoadGearbox = ModelData.Gears[gear].FullLoadCurve.FullLoadStationaryTorque(inAngularVelocity) * inAngularVelocity;
var fullLoadGearbox = ModelData.Gears[gear].FullLoadCurve.FullLoadStationaryTorque(inAngularVelocity) *
inAngularVelocity;
var fullLoadEngine = DataBus.EngineStationaryFullPower(inAngularVelocity);
var fullLoad = VectoMath.Min(fullLoadGearbox, fullLoadEngine);
......@@ -224,7 +226,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </list>
/// </returns>
private IResponse RequestGearDisengaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity,
PerSecond outAngularVelocity, bool dryRun)
bool dryRun)
{
Log.Debug("Current Gear: Neutral");
......@@ -279,7 +281,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </list>
/// </returns>
private IResponse RequestGearEngaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity,
PerSecond outAngularVelocity, bool dryRun)
bool dryRun)
{
// Set a Gear if no gear was set and engineSpeed is not zero
if (Disengaged && !outAngularVelocity.IsEqual(0)) {
......
......@@ -88,9 +88,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
CurrentState.SimulationInterval = dt;
CurrentState.Acceleration = acceleration;
CurrentState.Velocity = PreviousState.Velocity + acceleration * dt;
if (CurrentState.Velocity.IsEqual(0.SI<MeterPerSecond>(),
if (_currentState.Velocity.IsSmaller(0.SI<MeterPerSecond>(), Constants.SimulationSettings.VehicleSpeedHaltTolerance)) {
Constants.SimulationSettings.VehicleSpeedHaltTolerance)) {
// if (CurrentState.Velocity.IsEqual(0.SI<MeterPerSecond>(),
// Constants.SimulationSettings.VehicleSpeedHaltTolerance)) {
if (CurrentState.Velocity.IsSmaller(0.SI<MeterPerSecond>(), Constants.SimulationSettings.VehicleSpeedHaltTolerance)) {
CurrentState.Velocity = 0.SI<MeterPerSecond>();
}
CurrentState.Distance = PreviousState.Distance + PreviousState.Velocity * dt + acceleration * dt * dt / 2;
......@@ -182,9 +182,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected internal Newton RollingResistance(Radian gradient)
{
var weight = _data.TotalVehicleWeight();
var weight = ModelData.TotalVehicleWeight();
var gravity = Physics.GravityAccelleration;
var rollCoefficient = _data.TotalRollResistanceCoefficient;
var rollCoefficient = ModelData.TotalRollResistanceCoefficient;
var retVal = Math.Cos(gradient.Value()) * weight * gravity * rollCoefficient;
Log.Debug("RollingResistance: {0}", retVal);
......@@ -193,14 +193,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected internal Newton DriverAcceleration(MeterPerSquareSecond accelleration)
{
var retVal = _data.TotalVehicleWeight() * accelleration;
var retVal = ModelData.TotalVehicleWeight() * accelleration;
Log.Debug("DriverAcceleration: {0}", retVal);
return retVal;
}
protected internal Newton SlopeResistance(Radian gradient)
{
var retVal = _data.TotalVehicleWeight() * Physics.GravityAccelleration * Math.Sin(gradient.Value());
var retVal = ModelData.TotalVehicleWeight() * Physics.GravityAccelleration * Math.Sin(gradient.Value());
Log.Debug("SlopeResistance: {0}", retVal);
return retVal;
}
......@@ -212,7 +212,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (vAverage.IsEqual(0)) {
return 0.SI<Newton>();
}
var result = ComputeAirDragPowerLoss(_previousState.Velocity, _previousState.Velocity + acceleration * dt, dt) /
var result = ComputeAirDragPowerLoss(PreviousState.Velocity, PreviousState.Velocity + acceleration * dt, dt) /
vAverage;
Log.Debug("AirDragResistance: {0}", result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment