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 4aa47ddf authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added function Radian.ToInclinationPercent()

parent 3ea516ef
Branches
Tags
No related merge requests found
...@@ -135,6 +135,10 @@ namespace TUGraz.VectoCommon.Utils ...@@ -135,6 +135,10 @@ namespace TUGraz.VectoCommon.Utils
[DebuggerHidden] [DebuggerHidden]
private Radian(double val) : base(val, Units) { } private Radian(double val) : base(val, Units) { }
public double ToInclinationPercent() {
return Math.Tan(Val);
}
} }
/// <summary> /// <summary>
......
...@@ -32,7 +32,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -32,7 +32,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var preProcessor = new PCCEcoRollEngineStopPreprocessor(Container, slopes, PCCDriverData.MinSpeed, maxSpeed); var preProcessor = new PCCEcoRollEngineStopPreprocessor(Container, slopes, PCCDriverData.MinSpeed, maxSpeed);
preProcessor.RunPreprocessing(); preProcessor.RunPreprocessing();
DebugWriteLine("Slopes:\n" + string.Join("\n", slopes.Select(p => $"{p.Key.Value():F}\t{Math.Tan(p.Value.Value()):P}"))); DebugWriteLine("Slopes:\n" + string.Join("\n", slopes.Select(p => $"{p.Key.AsKmph:F}\t{p.Value.ToInclinationPercent():P}")));
var runData = Container.RunData; var runData = Container.RunData;
...@@ -93,7 +93,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -93,7 +93,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var minSlope = (slopes.Interpolate(x => x.Key.Value(), y => y.Value.Value(), start.VehicleTargetSpeed.Value()) var minSlope = (slopes.Interpolate(x => x.Key.Value(), y => y.Value.Value(), start.VehicleTargetSpeed.Value())
+ slopeEngineDrag / start.VehicleTargetSpeed.Value()).SI<Radian>(); + slopeEngineDrag / start.VehicleTargetSpeed.Value()).SI<Radian>();
//DebugWriteLine($"MinSlope:{minSlope.ToInclinationPercent():P}");
if (pccSegment == null && slope < minSlope) { if (pccSegment == null && slope < minSlope) {
pccSegment = new PCCSegment { pccSegment = new PCCSegment {
DistanceMinSpeed = start.Distance, DistanceMinSpeed = start.Distance,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment