Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

implementing reader classes, testcase for reading battery and electric motor

parent dd6ef56e
No related branches found
No related tags found
No related merge requests found
Showing
with 1300 additions and 6 deletions
......@@ -708,9 +708,9 @@ namespace TUGraz.VectoCommon.InputData
Ohm InternalResistance { get; }
TableData CellVoltage { get; }
TableData Voltage { get; }
Ampere MaxCurrent { get; }
double MaxCurrentFactor { get; }
}
......
......@@ -341,6 +341,15 @@ namespace TUGraz.VectoCommon.Utils
}
}
public UnitInstance Ampere
{
get
{
_units[3] += 1 * _reciproc * _exponent;
return this;
}
}
/// <summary>
/// Takes all following terms as quadratic terms (=to the power of 2).
/// </summary>
......
using System;
using Newtonsoft.Json.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.Reader.ComponentData;
namespace TUGraz.VectoCore.InputData.FileIO.JSON {
public class JSONBatteryV1 : JSONFile, IBatteryPackEngineeringInputData
{
public JSONBatteryV1(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { }
public string Manufacturer
{
get { return Constants.NOT_AVailABLE; }
}
public string Model
{
get { return Body.GetEx<string>("Model"); }
}
public DateTime Date { get { return DateTime.MinValue; } }
public CertificationMethod CertificationMethod
{
get { return CertificationMethod.NotCertified; }
}
public string CertificationNumber
{
get { return Constants.NOT_AVailABLE; }
}
public DigestData DigestValue
{
get { return null; }
}
public double MinSOC
{
get { return Body.GetEx<double>("SOC_min"); }
}
public double MaxSOC
{
get { return Body.GetEx<double>("SOC_max"); }
}
public AmpereSecond Capacity
{
get { return Body.GetEx<double>("Capacity").SI(Unit.SI.Ampere.Hour).Cast<AmpereSecond>(); }
}
public Ohm InternalResistance
{
get { return Body.GetEx<double>("InternalResistance").SI<Ohm>(); }
}
public TableData Voltage
{
get
{
var retVal = new TableData(_sourceFile);
retVal.Columns.Add(BatterySOCReader.Fields.StateOfCharge);
retVal.Columns.Add(BatterySOCReader.Fields.BatteryVoltage);
foreach (var entries in Body["SOC"]) {
var row = retVal.NewRow();
row[BatterySOCReader.Fields.StateOfCharge] = entries[0];
row[BatterySOCReader.Fields.BatteryVoltage] = entries[1];
retVal.Rows.Add(row);
}
return retVal;
}
}
public double MaxCurrentFactor
{
get { return Body.GetEx<double>("MaxCurrentFactor"); }
}
}
}
\ No newline at end of file
using System;
using Newtonsoft.Json.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
namespace TUGraz.VectoCore.InputData.FileIO.JSON {
public class JSONElectricMotorV1 : JSONFile, IElectricMotorEngineeringInputData
{
public JSONElectricMotorV1(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { }
public string Manufacturer
{
get { return Constants.NOT_AVailABLE; }
}
public string Model
{
get { return Body.GetEx<string>("Model"); }
}
public DateTime Date { get { return DateTime.MinValue; } }
public CertificationMethod CertificationMethod
{
get { return CertificationMethod.NotCertified; }
}
public string CertificationNumber
{
get { return Constants.NOT_AVailABLE; }
}
public DigestData DigestValue
{
get { return null; }
}
public TableData FullLoadCurve
{
get { return ReadTableData(Body.GetEx<string>("FullLoadCurve"), "ElectricMotor FullLoadCurve"); }
}
public TableData EfficiencyMap
{
get { return ReadTableData(Body.GetEx<string>("EfficiencyMap"), "ElectricMotor Map"); }
}
public KilogramSquareMeter Inertia
{
get { return Body.GetEx<double>("Inertia").SI<KilogramSquareMeter>(); }
}
}
}
\ No newline at end of file
......@@ -165,5 +165,32 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
throw new VectoException("GearshiftParameter-File: Unsupported FileVersion. Got {0}", version);
}
}
public static IBatteryPackEngineeringInputData ReadBatteryData(string filename, bool tolerateMissing)
{
var json = ReadFile(filename);
var version = ReadVersion(json);
switch (version)
{
case 1:
return new JSONBatteryV1(json, filename, tolerateMissing);
default:
throw new VectoException("Battery-File: Unsupported FileVersion. Got {0}", version);
}
}
public static IElectricMotorEngineeringInputData ReadElectricMotorData(string filename, bool tolerateMissing)
{
var json = ReadFile(filename);
var version = ReadVersion(json);
switch (version)
{
case 1:
return new JSONElectricMotorV1(json, filename, tolerateMissing);
default:
throw new VectoException("ElectricMotor-File: Unsupported FileVersion. Got {0}", version);
}
}
}
}
using System.Data;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
public static class BatterySOCReader
{
public static SOCMap Create(DataTable data)
{
if (data.Columns.Count != 2)
{
throw new VectoException("SOC-Map data must contain exactly two columns: {0}, {1}", Fields.StateOfCharge, Fields.BatteryVoltage);
}
if (data.Rows.Count < 2)
{
throw new VectoException("SoC-Map data must contain at least 2 entries!");
}
if (!data.Columns.Contains(Fields.StateOfCharge) || !data.Columns.Contains(Fields.BatteryVoltage))
{
data.Columns[0].ColumnName = Fields.StateOfCharge;
data.Columns[1].ColumnName = Fields.BatteryVoltage;
LoggingObject.Logger<SOCMap>().Warn("SoC-Map Header is invalid. Expected: '{0}, {1}', Got: '{2}'. Falling back to column index.",
Fields.StateOfCharge, Fields.BatteryVoltage, string.Join(", ", data.Columns.Cast<DataColumn>().Select(c => c.ColumnName)));
}
return new SOCMap(data.Rows.Cast<DataRow>().Select(row => new SOCMap.SOCMapEntry
{
SOC = row.ParseDouble(Fields.StateOfCharge) / 100,
BatteryVolts = row.ParseDouble(Fields.BatteryVoltage).SI<Volt>()
}).OrderBy(e => e.SOC).ToArray());
}
public static class Fields
{
public const string StateOfCharge = "SoC";
public const string BatteryVoltage = "V";
}
}
}
\ No newline at end of file
using System.Data;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
public static class ElectricFullLoadCurveReader
{
public static ElectricFullLoadCurve Create(DataTable data)
{
if (data.Columns.Count < 3)
{
throw new VectoException("Motor FullLoadCurve Data must contain at least 3 columns");
}
if (data.Rows.Count < 2)
{
throw new VectoException("Motor FullLoadCurve Data must contain at least 2 rows with numeric values");
}
if (!HeaderIsValid(data.Columns))
{
data.Columns[0].ColumnName = Fields.MotorSpeed;
data.Columns[1].ColumnName = Fields.DrivingTorque;
data.Columns[2].ColumnName = Fields.GenerationTorque;
}
return new ElectricFullLoadCurve((from DataRow row in data.Rows
select new ElectricFullLoadCurve.FullLoadEntry
{
MotorSpeed = row.ParseDouble(Fields.MotorSpeed).RPMtoRad(),
FullDriveTorque = row.ParseDouble(Fields.DrivingTorque).SI<NewtonMeter>(),
FullGenerationTorque = row.ParseDouble(Fields.GenerationTorque).SI<NewtonMeter>()
}).ToList());
}
private static bool HeaderIsValid(DataColumnCollection dataColumns)
{
return dataColumns.Contains(Fields.MotorSpeed) && dataColumns.Contains(Fields.DrivingTorque) &&
dataColumns.Contains(Fields.GenerationTorque);
}
public static class Fields
{
public const string MotorSpeed = "n";
public const string DrivingTorque = "T_drive";
public const string GenerationTorque = "T_drag";
}
}
}
\ No newline at end of file
using System;
using System.Data;
using System.IO;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
public static class ElectricMotorMapReader
{
public static EfficiencyMap Create(Stream data)
{
return Create(VectoCSVFile.ReadStream(data));
}
public static EfficiencyMap Create(DataTable data)
{
var headerValid = HeaderIsValid(data.Columns);
if (!headerValid)
{
LoggingObject.Logger<FuelConsumptionMap>().Warn(
"Efficiencymap: Header Line is not valid. Expected: '{0}, {1}, {2}', Got: {3}",
FuelConsumptionMapReader.Fields.EngineSpeed, FuelConsumptionMapReader.Fields.Torque, FuelConsumptionMapReader.Fields.FuelConsumption,
string.Join(", ", data.Columns.Cast<DataColumn>().Select(c => c.ColumnName)));
data.Columns[0].ColumnName = Fields.MotorSpeed;
data.Columns[1].ColumnName = Fields.Torque;
data.Columns[2].ColumnName = Fields.PowerElectrical;
}
var delaunayMap = new DelaunayMap("ElectricMotorEfficiencyMap Mechanicla to Electric");
foreach (DataRow row in data.Rows)
{
try
{
var entry = CreateEntry(row);
delaunayMap.AddPoint(-entry.Torque.Value(), entry.MotorSpeed.Value(), -entry.PowerElectrical.Value());
}
catch (Exception e)
{
throw new VectoException(string.Format("EfficiencyMap - Line {0}: {1}", data.Rows.IndexOf(row), e.Message), e);
}
}
delaunayMap.Triangulate();
return new EfficiencyMap(delaunayMap);
}
private static EfficiencyMap.Entry CreateEntry(DataRow row)
{
return new EfficiencyMap.Entry(
speed: row.ParseDouble(Fields.MotorSpeed).RPMtoRad(),
torque: row.ParseDouble(Fields.Torque).SI<NewtonMeter>(),
powerElectrical: row.ParseDouble(Fields.PowerElectrical).SI(Unit.SI.Kilo.Watt).Cast<Watt>());
}
private static bool HeaderIsValid(DataColumnCollection columns)
{
return columns.Contains(FuelConsumptionMapReader.Fields.EngineSpeed) && columns.Contains(FuelConsumptionMapReader.Fields.Torque) &&
columns.Contains(FuelConsumptionMapReader.Fields.FuelConsumption);
}
public static class Fields
{
public const string MotorSpeed = "n";
public const string Torque = "T";
public const string PowerElectrical = "P_el";
}
}
}
\ No newline at end of file
using System.ComponentModel.DataAnnotations;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCore.InputData.Reader.ComponentData {
public class BatteryData
{
[ValidateObject]
public SOCMap SOCMap { get; internal set; }
[Range(0, 1)]
public double MinSOC { get; internal set; }
[Range(0, 1)]
public double MaxSOC { get; internal set; }
[SIRange(0, 1e9)]
public Ohm InternalResistance { get; internal set; }
public AmpereSecond Capacity { get; internal set; }
public Ampere MaxCurrent { get; internal set; }
public double InitialSoC { get; internal set; }
}
public class SOCMap
{
protected SOCMapEntry[] Entries;
public SOCMap(SOCMapEntry[] entries)
{
Entries = entries;
}
public Volt Lookup(double soc)
{
var idx = FindIndex(soc);
return VectoMath.Interpolate(Entries[idx - 1].SOC, Entries[idx].SOC, Entries[idx - 1].BatteryVolts,
Entries[idx].BatteryVolts, soc);
}
protected int FindIndex(double soc)
{
if (soc < Entries.First().SOC)
{
return 1;
}
if (soc > Entries.Last().SOC)
{
return Entries.Length - 1;
}
for (var index = 1; index < Entries.Length; index++)
{
if (soc >= Entries[index - 1].SOC && soc <= Entries[index].SOC)
{
return index;
}
}
throw new VectoException("soc {0} exceeds battery model data. min: {1} max: {2}", soc, Entries.First().SOC, Entries.Last().SOC);
}
public class SOCMapEntry
{
[Required, Range(0, 1)] public double SOC;
[Required, SIRange(0, double.MaxValue)] public Volt BatteryVolts;
}
}
}
\ No newline at end of file
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Data {
public class EfficiencyMap
{
private readonly DelaunayMap _efficiencyMapMech2El;
protected internal EfficiencyMap(DelaunayMap efficiencyMapMech2El)
{
_efficiencyMapMech2El = efficiencyMapMech2El;
}
public EfficiencyResult LookupElectricPower(PerSecond angularSpeed, NewtonMeter torque, bool allowExtrapolation = false)
{
var result = new EfficiencyResult();
result.Torque = torque;
var value = _efficiencyMapMech2El.Interpolate(torque, angularSpeed);
if (value.HasValue)
{
result.ElectricalPower = value.Value.SI<Watt>();
return result;
}
if (allowExtrapolation)
{
result.ElectricalPower = _efficiencyMapMech2El.Extrapolate(torque, angularSpeed).SI<Watt>();
result.Extrapolated = true;
return result;
}
return result;
}
public EfficiencyResult SearchMechanicalPower(Watt electricPower, PerSecond angularSpeed,
bool allowExtrapolation = false)
{
if (electricPower.IsEqual(0))
{
return new EfficiencyResult
{
ElectricalPower = electricPower,
Speed = angularSpeed,
Torque = 0.SI<NewtonMeter>()
};
}
var torque = electricPower / angularSpeed;
var response = LookupElectricPower(angularSpeed, torque, true);
var delta = response.ElectricalPower - electricPower;
torque = SearchAlgorithm.Search(torque, delta, torque * 0.1,
getYValue: result => ((EfficiencyMap.EfficiencyResult)result).ElectricalPower - electricPower,
evaluateFunction: x => LookupElectricPower(angularSpeed, x, true),
criterion: result => (((EfficiencyMap.EfficiencyResult)result).ElectricalPower - electricPower).Value());
return new EfficiencyResult
{
ElectricalPower = electricPower,
Speed = angularSpeed,
Torque = torque
};
}
public class Entry
{
public Entry(PerSecond speed, NewtonMeter torque, Watt powerElectrical)
{
MotorSpeed = speed;
Torque = torque;
PowerElectrical = powerElectrical;
}
public readonly PerSecond MotorSpeed;
public readonly NewtonMeter Torque;
public readonly Watt PowerElectrical;
}
public class EfficiencyResult
{
public PerSecond Speed;
public NewtonMeter Torque;
public Watt ElectricalPower;
public bool Extrapolated;
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Data {
public class ElectricFullLoadCurve
{
internal readonly List<FullLoadEntry> FullLoadEntries;
internal ElectricFullLoadCurve(List<FullLoadEntry> entries)
{
FullLoadEntries = entries;
}
public NewtonMeter FullLoadDriveTorque(PerSecond angularVelocity)
{
var idx = FindIndex(angularVelocity);
return -VectoMath.Interpolate(FullLoadEntries[idx - 1].MotorSpeed, FullLoadEntries[idx].MotorSpeed,
FullLoadEntries[idx - 1].FullDriveTorque, FullLoadEntries[idx].FullDriveTorque,
angularVelocity);
}
public NewtonMeter FullGenerationTorque(PerSecond angularVelocity)
{
var idx = FindIndex(angularVelocity);
return -VectoMath.Interpolate(FullLoadEntries[idx - 1].MotorSpeed, FullLoadEntries[idx].MotorSpeed,
FullLoadEntries[idx - 1].FullGenerationTorque, FullLoadEntries[idx].FullGenerationTorque,
angularVelocity);
}
protected int FindIndex(PerSecond angularVelocity)
{
if (angularVelocity < FullLoadEntries.First().MotorSpeed)
{
return 1;
}
if (angularVelocity > FullLoadEntries.Last().MotorSpeed)
{
return FullLoadEntries.Count - 1;
}
for (var index = 1; index < FullLoadEntries.Count; index++)
{
if (angularVelocity >= FullLoadEntries[index - 1].MotorSpeed && angularVelocity <= FullLoadEntries[index].MotorSpeed)
{
return index;
}
}
throw new VectoException("angular velocity {0} exceeds full-load curve. min: {1} max: {2}", angularVelocity, FullLoadEntries.First().MotorSpeed, FullLoadEntries.Last().MotorSpeed);
}
internal class FullLoadEntry
{
public PerSecond MotorSpeed { get; set; }
public NewtonMeter FullDriveTorque { get; set; }
public NewtonMeter FullGenerationTorque { get; set; }
}
}
}
\ No newline at end of file
using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Data
{
public class ElectricMotorData
{
[ValidateObject]
public EfficiencyMap EfficiencyMap { get; internal set; }
public ElectricFullLoadCurve FullLoadCurve { get; internal set; }
public KilogramSquareMeter Inertia { get; internal set; }
}
}
\ No newline at end of file
......@@ -140,7 +140,9 @@
<Compile Include="InputData\AuxiliaryFileHelper.cs" />
<Compile Include="InputData\FileIO\JSON\BusAuxiliaryInputData.cs" />
<Compile Include="InputData\FileIO\JSON\IJSONVehicleComponents.cs" />
<Compile Include="InputData\FileIO\JSON\JSONBattery.cs" />
<Compile Include="InputData\FileIO\JSON\JSONComponentInputData.cs" />
<Compile Include="InputData\FileIO\JSON\JSONElectricMotor.cs" />
<Compile Include="InputData\FileIO\JSON\JsonExtensionMethods.cs" />
<Compile Include="InputData\FileIO\JSON\JSONTCUData.cs" />
<Compile Include="InputData\FileIO\JSON\SSMInputData.cs" />
......@@ -276,6 +278,10 @@
<Compile Include="InputData\FileIO\XML\Declaration\IXMLDeclarationInputDataReader.cs" />
<Compile Include="InputData\FileIO\XML\IXMLInputDataReader.cs" />
<Compile Include="InputData\FileIO\XML\XMLInputDataNinjectModule.cs" />
<Compile Include="InputData\Reader\ComponentData\ElectricMotorMapReader.cs" />
<Compile Include="InputData\Reader\ComponentData\ElectricFullLoadCurveReader.cs" />
<Compile Include="Models\SimulationComponent\Data\Battery\BatteryData.cs" />
<Compile Include="InputData\Reader\ComponentData\BatterySOCReader.cs" />
<Compile Include="InputData\Reader\DataObjectAdapter\DeclarationDataAdapterSingleBus.cs" />
<Compile Include="Models\BusAuxiliaries\DownstreamModules\Impl\Electrics\SimpleBattery.cs" />
<Compile Include="Models\BusAuxiliaries\Interfaces\DownstreamModules\Electrics\ISimpleBattery.cs" />
......@@ -364,6 +370,9 @@
<Compile Include="Models\Declaration\BusSegments.cs" />
<Compile Include="Models\Declaration\HVACCoolingPower.cs" />
<Compile Include="Models\Declaration\SteeringPumpBus.cs" />
<Compile Include="Models\SimulationComponent\Data\ElectricMotor\EfficiencyMap.cs" />
<Compile Include="Models\SimulationComponent\Data\ElectricMotor\ElectricFullLoadCurve.cs" />
<Compile Include="Models\SimulationComponent\Data\ElectricMotor\ElectricMotorData.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\WHRPowerMap.cs" />
<Compile Include="InputData\Reader\ComponentData\WHRPowerReader.cs" />
<Compile Include="Models\SimulationComponent\Impl\StopStartCombustionEngine.cs" />
......
using System.IO;
using NUnit.Framework;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.InputData.Reader.ComponentData;
namespace TUGraz.VectoCore.Tests.FileIO
{
[TestFixture]
public class JsonReadHybridTest
{
[OneTimeSetUp]
public void RunBeforeAnyTests()
{
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
}
[TestCase()]
public void TestReadBatteryPack()
{
var inputProvider = JSONInputDataFactory.ReadBatteryData(@"TestData\Hybrids\Battery\GenericBattery.vbat", false);
Assert.AreEqual(14.SI(Unit.SI.Ampere.Hour), inputProvider.Capacity);
var soc = inputProvider.Voltage;
Assert.AreEqual("0", soc.Rows[0][BatterySOCReader.Fields.StateOfCharge]);
Assert.AreEqual("590", soc.Rows[0][BatterySOCReader.Fields.BatteryVoltage]);
Assert.AreEqual(20, inputProvider.MinSOC);
Assert.AreEqual(80, inputProvider.MaxSOC);
Assert.AreEqual(5, inputProvider.MaxCurrentFactor);
var socMap = BatterySOCReader.Create(soc);
Assert.AreEqual(590, socMap.Lookup(0).Value());
Assert.AreEqual(658, socMap.Lookup(1).Value());
Assert.AreEqual(640, socMap.Lookup(0.5).Value());
Assert.AreEqual(639, socMap.Lookup(0.45).Value());
}
[TestCase()]
public void TestReadElectricMotor()
{
var inputProvider =
JSONInputDataFactory.ReadElectricMotorData(@"TestData\Hybrids\ElectricMotor\GenericEMotor.vem", false);
Assert.AreEqual(0.15, inputProvider.Inertia.Value(), 1e-6);
var fld = inputProvider.FullLoadCurve;
Assert.AreEqual("0", fld.Rows[0][ElectricFullLoadCurveReader.Fields.MotorSpeed]);
Assert.AreEqual("401.07", fld.Rows[0][ElectricFullLoadCurveReader.Fields.DrivingTorque]);
Assert.AreEqual("-401.07", fld.Rows[0][ElectricFullLoadCurveReader.Fields.GenerationTorque]);
var fldMap = ElectricFullLoadCurveReader.Create(fld);
Assert.AreEqual(401.07, fldMap.FullLoadDriveTorque(0.RPMtoRad()).Value());
Assert.AreEqual(-407.07, fldMap.FullGenerationTorque(0.RPMtoRad()).Value());
var pwr = inputProvider.EfficiencyMap;
Assert.AreEqual("0", pwr.Rows[0][ElectricMotorMapReader.Fields.MotorSpeed]);
Assert.AreEqual("-800", pwr.Rows[0][ElectricMotorMapReader.Fields.Torque]);
Assert.AreEqual("9.8449", pwr.Rows[0][ElectricMotorMapReader.Fields.PowerElectrical]);
var pwrMap = ElectricMotorMapReader.Create(pwr);
Assert.AreEqual(9844.9, pwrMap.LookupElectricPower(-0.RPMtoRad(), -800.SI<NewtonMeter>()).ElectricalPower.Value());
}
}
}
\ No newline at end of file
......@@ -10,9 +10,9 @@
"Model": "Generic Battery",
"SOC_min": 20,
"SOC_max": 80,
"Capacity": 2.5,
"InternalResistance": 0.0068,
"MaxCurrentFactor": 50,
"Capacity": 14,
"InternalResistance": 0.12,
"MaxCurrentFactor": 5,
"SOC": [
[ 0, 590 ],
[ 10, 614 ],
......
n [rpm], T [Nm], P_bat [kW]
n [rpm], T [Nm], P_el [kW]
0, -800, 9.8449
0, -775, 9.2719
0, -750, 8.7161
......
engine speed [1/min], full load torque [Nm], motoring torque [Nm]
600,478,-35
608,485.52,-35.31693
616,493.04,-35.63385
624,500.56,-35.95077
632,508.08,-36.26769
640,515.6,-36.58462
648,523.12,-36.90154
656,530.64,-37.21846
664,538.16,-37.53539
672,545.68,-37.85231
680,553.2,-38.16923
688,560.72,-38.48615
696,568.24,-38.80308
704,575.76,-39.12
712,583.28,-39.43692
720,590.8,-39.75385
728,598.32,-40.07077
736,605.84,-40.3877
744,613.36,-40.70462
752,620.88,-41.02154
760,628.4,-41.33846
768,635.92,-41.65539
776,643.44,-41.97231
784,650.96,-42.28923
792,658.48,-42.60616
800,666,-42.92308
808,673.44,-43.24
816,680.88,-43.48
824,688.32,-43.72
832,695.76,-43.96
840,703.2,-44.2
848,710.64,-44.44
856,718.08,-44.68
864,725.52,-44.92
872,732.96,-45.16
880,740.4,-45.4
888,747.84,-45.64
896,755.28,-45.88
904,762.72,-46.12
912,770.16,-46.36
920,777.6,-46.6
928,785.04,-46.84
936,792.48,-47.08
944,799.92,-47.32
952,807.36,-47.56
960,814.8,-47.8
968,822.24,-48.04
976,829.68,-48.28
984,837.12,-48.52
992,844.56,-48.76
1000,852,-49
1008,856.16,-49.4
1016,860.32,-49.8
1024,864.48,-50.19579
1032,868.64,-50.59098
1040,872.8,-50.98618
1048,876.96,-51.38137
1056,881.12,-51.77656
1064,885.28,-52.17175
1072,889.44,-52.56694
1080,893.6,-52.96214
1088,897.76,-53.35733
1096,901.92,-53.75252
1104,906.08,-54.14772
1112,910.24,-54.54291
1120,914.4,-54.9381
1128,918.56,-55.33329
1136,922.72,-55.72849
1144,926.88,-56.12368
1152,931.04,-56.51887
1160,935.2,-56.91406
1168,939.36,-57.30925
1176,943.52,-57.70444
1184,947.68,-58.09964
1192,951.84,-58.49483
1200,956,-58.89002
1208,956,-59.28522
1216,956,-59.68041
1224,956,-60.0756
1232,956,-60.44
1240,956,-60.8
1248,956,-61.16
1256,956,-61.52
1264,956,-61.88
1272,956,-62.24
1280,956,-62.6
1288,956,-62.96
1296,956,-63.32
1304,956,-63.68
1312,956,-64.04
1320,956,-64.4
1328,956,-64.76
1336,956,-65.12
1344,956,-65.48
1352,956,-65.84
1360,956,-66.2
1368,956,-66.56
1376,956,-66.92
1384,956,-67.28
1392,956,-67.64
1400,956,-68
1408,956,-68.36
1416,956,-68.72
1424,956,-69.08
1432,956,-69.44
1440,956,-69.76736
1448,956,-70.08386
1456,956,-70.40035
1464,956,-70.71684
1472,956,-71.03333
1480,956,-71.34982
1488,956,-71.66631
1496,956,-71.9828
1504,956,-72.2993
1512,956,-72.61579
1520,956,-72.93228
1528,956,-73.24877
1536,956,-73.56526
1544,956,-73.88175
1552,956,-74.19825
1560,956,-74.51474
1568,956,-74.83123
1576,956,-75.14772
1584,956,-75.46421
1592,956,-75.7807
1600,956,-76.0972
1608,953.56,-76.41369
1616,951.12,-76.73018
1624,948.68,-77.04667
1632,946.24,-77.36316
1640,943.8,-77.67965
1648,941.36,-77.99614
1656,938.92,-78.31264
1664,936.48,-78.6
1672,934.04,-78.8
1680,931.6,-79
1688,929.16,-79.2
1696,926.72,-79.4
1704,924.28,-79.6
1712,921.84,-79.8
1720,919.4,-80
1728,916.96,-80.2
1736,914.52,-80.4
1744,912.08,-80.6
1752,909.64,-80.8
1760,907.2,-81
1768,904.76,-81.2
1776,902.32,-81.4
1784,899.88,-81.6
1792,897.44,-81.8
1800,895,-82
1808,892.24,-82.24
1816,889.48,-82.48
1824,886.72,-82.72
1832,883.96,-82.96
1840,881.2,-83.2
1848,878.44,-83.44
1856,875.68,-83.68
1864,872.92,-83.92
1872,870.16,-84.16
1880,867.4,-84.4
1888,864.64,-84.64
1896,861.88,-84.88
1904,859.12,-85.12
1912,856.36,-85.36
1920,853.6,-85.6
1928,850.84,-85.84
1936,848.08,-86.08
1944,845.32,-86.32
1952,842.56,-86.56
1960,839.8,-86.8
1968,837.04,-87.04
1976,834.28,-87.28
1984,831.52,-87.52
1992,828.76,-87.76
2000,826,-88
2008,823.36,-88.44
2016,820.72,-88.88
2024,818.08,-89.32
2032,815.44,-89.76
2040,812.8,-90.2
2048,810.16,-90.64
2056,807.52,-91.08
2064,804.88,-91.52
2072,802.24,-91.96
2080,799.6,-92.4
2088,796.96,-92.84
2096,794.32,-93.28
2104,791.68,-93.72
2112,789.04,-94.16
2120,786.4,-94.6
2128,783.76,-95.04
2136,781.12,-95.48
2144,778.48,-95.92
2152,775.84,-96.36
2160,773.2,-96.8
2168,770.56,-97.24
2176,767.92,-97.68
2184,765.28,-98.06694
2192,762.64,-98.40081
2200,760,-98.73468
2208,755.56,-99.06856
2216,751.12,-99.40243
2224,746.68,-99.73631
2232,742.24,-100.0702
2240,737.8,-100.404
2248,733.36,-100.7379
2256,728.92,-101.0718
2264,724.48,-101.4057
2272,720.04,-101.7395
2280,715.6,-102.0734
2288,711.16,-102.4073
2296,706.72,-102.7412
2304,702.28,-103.075
2312,697.84,-103.4089
2320,693.4,-103.7428
2328,688.96,-104.0767
2336,684.52,-104.4105
2344,680.08,-104.7444
2352,675.64,-105.0783
2360,671.2,-105.4
2368,666.76,-105.72
2376,662.32,-106.04
2384,657.88,-106.36
2392,653.44,-106.68
2400,649,-107
2408,642.36,-107.32
2416,635.72,-107.64
2424,629.08,-107.96
2432,622.44,-108.28
2440,615.8,-108.6
2448,609.16,-108.92
2456,602.52,-109.24
2464,595.88,-109.56
2472,589.24,-109.88
2480,582.6,-110.2
2488,575.96,-110.52
2496,569.32,-110.84
2504,543.36,-111.16
2512,498.08,-111.48
2520,452.8,-111.8
2528,407.52,-112.12
2536,362.24,-112.44
2544,316.96,-112.76
2552,271.68,-113.08
2560,226.4,-113.4
2568,181.12,-113.72
2576,135.84,-114.04
2584,90.56,-114.36
2592,45.28,-114.68
2600,0,-115
engine speed [rpm], torque [Nm], fuel consumption [g/h]
500,-31,0
500,0,508
500,95.6,1814.959
500,191.2,3075.43
500,286.8,4327.79
500,382.4,6036.866
500,478,7983
500,573.6,9771.095
600,-35,0
600,0,508
600,95.6,1814.959
600,191.2,3075.43
600,286.8,4327.79
600,382.4,6036.866
600,478,7983
600,573.6,9771.095
808,-43.24,0
808.5,0,737.35
808.5,95.6,2156.667
808.5,191.2,3750.051
808.5,286.8,5348.091
808.5,382.4,7281.769
808.5,478,9331.995
808.5,573.6,11361.22
808.5,669.2,13292.96
808.5,673.905,13387.96
808,769.505,15319.69
1017,-49.85,0
1017,0,966.7
1017,95.6,2499.359
1017,191.2,4425.586
1017,286.8,6368.761
1017,382.4,8527.475
1017,478,10681.08
1017,573.6,12806.98
1017,669.2,14926.89
1017,764.8,17075.42
1017,860.4,19211.62
1017,860.84,19221.39
1017,956.44,21357.58
1225,-60.125,0
1225.4,0,1216.133
1225.4,95.6,2867.396
1225.4,191.2,5129.114
1225.4,286.8,7421.546
1225.4,382.4,9808.684
1225.4,478,12096.76
1225.4,573.6,14371.23
1225.4,669.2,16697.39
1225.4,764.8,19043.79
1225.4,860.4,21380.34
1225.4,956,23976.15
1225,1051.6,26399.12
1434,-69.53,0
1433.9,0,1607.511
1433.9,95.6,3422.282
1433.9,191.2,6045.75
1433.9,286.8,8717.55
1433.9,382.4,11388.84
1433.9,478,14040.14
1433.9,573.6,16812.16
1433.9,669.2,19499.88
1433.9,764.8,22089.68
1433.9,860.4,24706.84
1433.9,956,27415.66
1434,1051.6,30063.37
1662,-78.55,0
1661.8,0,2026.982
1661.8,95.6,4054.852
1661.8,191.2,7064.631
1661.8,286.8,10168.59
1661.8,382.4,13313.27
1661.8,478,16389.77
1661.8,573.6,19514.32
1661.8,669.2,22625.12
1661.8,764.8,25652.52
1661.8,860.4,28788.1
1661.8,937.151,31372.42
1662,1032.751,34529.97
1835,-83.05,0
1834.7,0,2385.627
1834.7,95.6,4596.783
1834.7,191.2,7871.156
1834.7,286.8,11300.52
1834.7,382.4,14757.68
1834.7,478,18117.38
1834.7,573.6,21557.68
1834.7,669.2,25079.78
1834.7,764.8,28600.34
1834.7,860.4,32191.22
1834.7,883.0285,33047.82
1835,978.6285,36639.92
2008,-88.44,0
2007.5,0,2806.425
2007.5,95.6,5238.11
2007.5,191.2,8755.323
2007.5,286.8,12501.62
2007.5,382.4,16278.62
2007.5,478,20040.57
2007.5,573.6,23826.03
2007.5,669.2,27760.66
2007.5,764.8,31692.9
2007.5,823.525,34019.71
2008,919.125,37924.6
2180,-97.9,0
2180.3,0,3323.097
2180.3,95.6,5859.055
2180.3,191.2,9668.133
2180.3,286.8,13730.37
2180.3,382.4,17786.81
2180.3,478,21943.1
2180.3,573.6,26354.73
2180.3,669.2,30668.08
2180.3,764.8,34924.28
2180.3,766.501,35000.3
2180,862.101,39256.51
2353,-105.12,0
2353.2,0,3807.896
2353.2,95.6,6495.978
2353.2,191.2,10634.86
2353.2,286.8,15048
2353.2,382.4,19654.95
2353.2,478,24298.67
2353.2,573.6,29311.43
2353.2,669.2,34144.93
2353,764.8,39097.94
2453,-109.12,0
2453.2,0,3807.896
2453.2,95.6,6495.978
2453.2,191.2,10634.86
2453.2,286.8,15048
2453.2,382.4,19654.95
2453.2,478,24298.67
2453.2,573.6,29311.43
2453.2,669.2,34144.93
2453,764.8,39097.94
{
"Header": {
"CreatedBy": " ()",
"Date": "2016-10-13T08:52:52.1686119Z",
"AppVersion": "3",
"FileVersion": 6
},
"Body": {
"SavedInDeclMode": false,
"ModelName": "tractor_12gear_example",
"Inertia": 0.0,
"TracInt": 1.0,
"Gears": [
{
"Ratio": 2.64,
"LossMap": "Axle_4x2.vtlm"
},
{
"Ratio": 14.93,
"LossMap": "Gear_1.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 11.64,
"LossMap": "Gear_2.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 9.02,
"LossMap": "Gear_3.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 7.04,
"LossMap": "Gear_4.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 5.64,
"LossMap": "Gear_5.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 4.4,
"LossMap": "Gear_6.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 3.39,
"LossMap": "Gear_7.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 2.65,
"LossMap": "Gear_8.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 2.05,
"LossMap": "Gear_9.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.6,
"LossMap": "Gear_10.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.28,
"LossMap": "Gear_11.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
},
{
"Ratio": 1.0,
"LossMap": "Gear_12.vtlm",
"ShiftPolygon": "",
"MaxTorque": ""
}
],
"TqReserve": 20.0,
"ShiftTime": 2.0,
"StartTqReserve": 20.0,
"StartSpeed": 2.0,
"StartAcc": 0.6,
"GearboxType": "AMT",
"TorqueConverter": {
"Enabled": false
},
"DownshiftAferUpshiftDelay": 10.0,
"UpshiftAfterDownshiftDelay": 10.0,
"UpshiftMinAcceleration": 0.1
}
}
\ No newline at end of file
Input Speed [rpm],Input Torque [Nm],Torque Loss [Nm]
0,-1000,25
0,0,5
0,1000,25
0,2000,45
0,3000,65
0,4000,85
0,5000,105
0,6000,125
0,7000,145
0,8000,165
0,9000,185
0,10000,205
238,-1000,25.2
238,0,5.2
238,1000,25.2
238,2000,45.2
238,3000,65.2
238,4000,85.2
238,5000,105.2
238,6000,125.2
238,7000,145.2
238,8000,165.2
238,9000,185.2
238,10000,205.2
475,-1000,25.5
475,0,5.5
475,551,16.5
475,1102,27.5
475,1653,38.5
475,2204,49.5
475,2755,60.6
475,3306,71.6
475,3857,82.6
475,4408,93.6
475,4959,104.6
475,5510,115.7
713,-1000,25.7
713,0,5.7
713,346,12.6
713,692,19.5
713,1038,26.5
713,1384,33.4
713,1730,40.3
713,2076,47.2
713,2422,54.1
713,2768,61
713,3114,68
713,3460,74.9
950,-1000,25.9
950,0,5.9
950,278,11.5
950,555,17
950,833,22.6
950,1111,28.1
950,1389,33.7
950,1666,39.3
950,1944,44.8
950,2222,50.4
950,2500,55.9
950,2777,61.5
1188,-1000,26.2
1188,0,6.2
1188,221,10.6
1188,443,15
1188,664,19.4
1188,886,23.9
1188,1107,28.3
1188,1329,32.7
1188,1550,37.2
1188,1772,41.6
1188,1993,46
1188,2215,50.4
1425,-1000,26.4
1425,0,6.4
1425,180,10
1425,361,13.6
1425,541,17.2
1425,721,20.8
1425,902,24.4
1425,1082,28
1425,1262,31.6
1425,1443,35.2
1425,1623,38.8
1425,1804,42.5
1663,-1000,26.6
1663,0,6.6
1663,146,9.5
1663,292,12.4
1663,437,15.4
1663,583,18.3
1663,729,21.2
1663,875,24.1
1663,1020,27
1663,1166,29.9
1663,1312,32.9
1663,1458,35.8
1900,-1000,26.8
1900,0,6.8
1900,130,9.4
1900,260,12
1900,390,14.6
1900,520,17.2
1900,650,19.8
1900,780,22.4
1900,909,25
1900,1039,27.6
1900,1169,30.2
1900,1299,32.8
2138,-1000,27.1
2138,0,7.1
2138,114,9.4
2138,228,11.6
2138,342,13.9
2138,456,16.2
2138,570,18.5
2138,684,20.8
2138,798,23
2138,912,25.3
2138,1026,27.6
2138,1140,29.9
2375,-1000,27.3
2375,0,7.3
2375,110,9.5
2375,220,11.7
2375,330,13.9
2375,440,16.1
2375,550,18.3
2375,660,20.5
2375,770,22.7
2375,880,24.9
2375,990,27.1
2375,1100,29.3
2613,-1000,27.5
2613,0,7.5
2613,110,9.7
2613,220,11.9
2613,330,14.1
2613,440,16.3
2613,550,18.5
2613,660,20.7
2613,770,22.9
2613,880,25.1
2613,990,27.3
2613,1100,29.5
3088,-1000,28
3088,0,8
3088,110,10.2
3088,220,12.4
3088,330,14.6
3088,440,16.8
3088,550,19
3088,660,21.2
3088,770,23.4
3088,880,25.6
3088,990,27.8
3088,1100,30
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