diff --git a/VectoCore/Models/Simulation/Data/ModalDataWriter.cs b/VectoCore/Models/Simulation/Data/ModalDataWriter.cs index 43583377de967ed9727dcb6d06dd791aad77fe07..56ad553c78c48d098f50d064bde5cd2d357ce69c 100644 --- a/VectoCore/Models/Simulation/Data/ModalDataWriter.cs +++ b/VectoCore/Models/Simulation/Data/ModalDataWriter.cs @@ -47,43 +47,4 @@ namespace TUGraz.VectoCore.Models.Simulation.Data set { CurrentRow[(int)key] = value; } } } - - - /* - jobName Unit Description - Job [-] Job number. Format is "x-y" with x = file number and y = cycle number - Input File [-] jobName of the input file - Cycle [-] jobName of the cycle file - time [s] Total simulation time - distance [km] Total travelled distance - speed [km/h] Average vehicle speed - ∆altitude [m] Altitude difference between start and end of cycle - Ppos [kW] Average positive engine power - Pneg [kW] Average negative engine power - FC [g/km] Average fuel consumption - FC-AUXc [g/km] Fuel consumption after Auxiliary-Start/Stop Correction. (Based on FC.) - FC-WHTCc [g/km] Fuel consumption after WHTC Correction. (Based on FC-AUXc.) - Pbrake [kW] Average brake power (not including engine drag) - EposICE [kWh] Total positive engine work - EnegICE [kWh] Total negative engine work (engine brake) - Eair [kWh] Total work of air resistance - Eroll [kWh] Total work of rolling resistance - Egrad [kWh] Total work of gradient resistance - Eacc [kWh] Total work from accelerations (<0) / decelerations (>0) - Eaux [kWh] Total energy demand of auxiliaries - Eaux_xxx [kWh] Energy demand of auxiliary with ID xxx. See also Aux Dialog and Driving Cycle. - Ebrake [kWh] Total work dissipated in mechanical braking (sum of service brakes, retader and additional engine exhaust brakes) - Etransm [kWh] Total work of transmission losses - Eretarder [kWh] Total retarder losses - Mass [kg] Vehicle mass (equals Curb Weight Vehicle plus Curb Weight Extra Trailer/Body, see Vehicle Editor) - Loading [kg] Vehicle loading (see Vehicle Editor) - a [m/s2] Average acceleration - a_pos [m/s2] Average acceleration in acceleration phases* - a_neg [m/s2] Average deceleration in deceleration phases* - Acc.Noise [m/s2] Acceleration noise - pAcc [%] Time share of acceleration phases* - pDec [%] Time share of deceleration phases* - pCruise [%] Time share of cruise phases* - pStop [%] Time share of stop phases* - */ } \ No newline at end of file diff --git a/VectoCore/Utils/SI.cs b/VectoCore/Utils/SI.cs index f5375c92a9c239fac2e81fc0c883124f94bdd401..f997dcfe5f36a9a9c09edc7626c4520b7d83d93a 100644 --- a/VectoCore/Utils/SI.cs +++ b/VectoCore/Utils/SI.cs @@ -435,6 +435,9 @@ namespace TUGraz.VectoCore.Utils return new SI(Val, Numerator, Denominator); } + /// <summary> + /// Returns the absolute value. + /// </summary> public SI Abs() { return new SI(Math.Abs(Val), this); diff --git a/VectoCore/Utils/VectoMath.cs b/VectoCore/Utils/VectoMath.cs index c49b7e97fab06ba2247b943408ca707b60260538..09a9a33de195a3761a0f2202047a9430d692726b 100644 --- a/VectoCore/Utils/VectoMath.cs +++ b/VectoCore/Utils/VectoMath.cs @@ -2,29 +2,55 @@ using System; namespace TUGraz.VectoCore.Utils { + /// <summary> + /// Provides helper methods for mathematical functions. + /// </summary> public class VectoMath { - public static T2 Interpolate<T1, T2>(T1 x1, T1 x2, T2 y1, T2 y2, T1 xint) where T1 : SI where T2 : SIBase<T2> + /// <summary> + /// Linearly interpolates a value between two points. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="TResult">The type of the result.</typeparam> + /// <param name="x1">First Value on the X-Axis.</param> + /// <param name="x2">Second Value on the X-Axis.</param> + /// <param name="y1">First Value on the Y-Axis.</param> + /// <param name="y2">Second Value on the Y-Axis.</param> + /// <param name="xint">Value on the X-Axis, for which the Y-Value should be interpolated.</param> + /// <returns></returns> + public static TResult Interpolate<T, TResult>(T x1, T x2, TResult y1, TResult y2, T xint) where T : SI + where TResult : SIBase<TResult> { - return ((xint - x1) * (y2 - y1) / (x2 - x1) + y1).Cast<T2>(); + return ((xint - x1) * (y2 - y1) / (x2 - x1) + y1).Cast<TResult>(); } + /// <summary> + /// Returns the absolute value. + /// </summary> public static SI Abs(SI si) { return si.Abs(); } - + /// <summary> + /// Returns the absolute value. + /// </summary> public static T Abs<T>(T si) where T : SIBase<T> { return si.Abs().Cast<T>(); } + /// <summary> + /// Returns the minimum of two values. + /// </summary> public static T Min<T>(T c1, T c2) where T : IComparable { return c1.CompareTo(c2) <= 0 ? c1 : c2; } + /// <summary> + /// Returns the maximum of two values. + /// </summary> public static T Max<T>(T c1, T c2) where T : IComparable { return c1.CompareTo(c2) >= 0 ? c1 : c2;