From a13c0e2e8f689a256d5db3a971676a6acf043944 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Tue, 26 Jul 2016 15:42:02 +0200 Subject: [PATCH] removed torqueconverter data for nu >= 1 (previous default values) --- .../Models/Declaration/DeclarationData.cs | 6 -- .../Models/Declaration/TorqueConverter.cs | 98 ------------------- .../Resources/Declaration/DefaultTC.vtcc | 12 --- .../Models/Declaration/DeclarationDataTest.cs | 42 -------- 4 files changed, 158 deletions(-) delete mode 100644 VectoCore/VectoCore/Models/Declaration/TorqueConverter.cs delete mode 100644 VectoCore/VectoCore/Resources/Declaration/DefaultTC.vtcc diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index 592758e8df..0e71f25597 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -57,7 +57,6 @@ namespace TUGraz.VectoCore.Models.Declaration private SteeringPump _steeringPump; private WHTCCorrection _whtcCorrection; private AirDrag _airDrag; - private TorqueConverter _torqueConverter; private StandardBodies _standardBodies; private Payloads _payloads; @@ -164,11 +163,6 @@ namespace TUGraz.VectoCore.Models.Declaration get { return Instance()._airDrag ?? (Instance()._airDrag = new AirDrag()); } } - public static TorqueConverter TorqueConverter - { - get { return Instance()._torqueConverter ?? (Instance()._torqueConverter = new TorqueConverter()); } - } - public static int PoweredAxle() { return 1; diff --git a/VectoCore/VectoCore/Models/Declaration/TorqueConverter.cs b/VectoCore/VectoCore/Models/Declaration/TorqueConverter.cs deleted file mode 100644 index 9aa9837f63..0000000000 --- a/VectoCore/VectoCore/Models/Declaration/TorqueConverter.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 European Union -* -* Developed by Graz University of Technology, -* Institute of Internal Combustion Engines and Thermodynamics, -* Institute of Technical Informatics -* -* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved -* by the European Commission - subsequent versions of the EUPL (the "Licence"); -* You may not use VECTO except in compliance with the Licence. -* You may obtain a copy of the Licence at: -* -* https://joinup.ec.europa.eu/community/eupl/og_page/eupl -* -* Unless required by applicable law or agreed to in writing, VECTO -* distributed under the Licence is distributed on an "AS IS" basis, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the Licence for the specific language governing permissions and -* limitations under the Licence. -* -* Authors: -* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology -* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology -* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology -* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology -* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology -* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology -*/ - -using System; -using System.Data; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; - -namespace TUGraz.VectoCore.Models.Declaration -{ - public sealed class TorqueConverter : LookupData<double, TorqueConverter.TorqueConverterEntry> - { - private const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.DefaultTC.vtcc"; - - public TorqueConverter() - { - ParseData(ReadCsvResource(ResourceId)); - } - - - [Obsolete("Default Lookup not available. Use LookupMu or LookupTorque instead.", true)] - private new TorqueConverterEntry Lookup(double key) - { - throw new InvalidOperationException( - "Default Lookup not available. Use TorqueConverter.LookupMu() or TorqueConverter.LookupTorque() instead."); - } - - - public NewtonMeter LookupTorque(double nu, PerSecond angularSpeedIn, PerSecond referenceSpeed) - { - var sec = Data.GetSection(kv => kv.Key < nu); - - if (nu < sec.Item1.Key || sec.Item2.Key < nu) { - Log.Warn(string.Format("TCextrapol: nu = {0} [n_out/n_in]", nu)); - } - - var torque = VectoMath.Interpolate(sec.Item1.Key, sec.Item2.Key, sec.Item1.Value.Torque, sec.Item2.Value.Torque, nu); - return torque * Math.Pow((angularSpeedIn / referenceSpeed).Cast<Scalar>(), 2); - } - - public double LookupMu(double nu) - { - var sec = Data.GetSection(kv => kv.Key < nu); - - if (nu < sec.Item1.Key || sec.Item2.Key < nu) { - Log.Warn(string.Format("TCextrapol: nu = {0} [n_out/n_in]", nu)); - } - - return VectoMath.Interpolate(sec.Item1.Key, sec.Item2.Key, sec.Item1.Value.Mu, sec.Item2.Value.Mu, nu); - } - - - protected override void ParseData(DataTable table) - { - Data.Clear(); - foreach (DataRow row in table.Rows) { - Data[row.ParseDouble("nue")] = new TorqueConverterEntry { - Mu = row.ParseDouble("mue"), - Torque = row.ParseDouble("MP1000 (1000/rpm)^2*Nm").SI<NewtonMeter>() - }; - } - } - - public class TorqueConverterEntry - { - public double Mu { get; set; } - public NewtonMeter Torque { get; set; } - } - } -} \ No newline at end of file diff --git a/VectoCore/VectoCore/Resources/Declaration/DefaultTC.vtcc b/VectoCore/VectoCore/Resources/Declaration/DefaultTC.vtcc deleted file mode 100644 index 3676a37ec2..0000000000 --- a/VectoCore/VectoCore/Resources/Declaration/DefaultTC.vtcc +++ /dev/null @@ -1,12 +0,0 @@ -nue,mue,MP1000 (1000/rpm)^2*Nm -1.000,1.000,0.00 -1.005,1.000,0.00 -1.100,1.000,-40.34 -1.222,1.000,-80.34 -1.375,1.000,-136.11 -1.571,1.000,-216.52 -1.833,1.000,-335.19 -2.200,1.000,-528.77 -2.750,1.000,-883.40 -4.400,1.000,-2462.17 -11.000,1.000,-16540.98 diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index d8f0fbc693..ea8d0d0f98 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -238,48 +238,6 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration crossWindCorrectionCurve.EffectiveAirDragArea(kmph.KMPHtoMeterPerSecond())); } - [ - // fixed points - TestCase(150, 1.000, 1.000, 0.00), - TestCase(150, 1.100, 1.000, -40.34), - TestCase(150, 1.222, 1.000, -80.34), - TestCase(150, 1.375, 1.000, -136.11), - TestCase(150, 1.571, 1.000, -216.52), - TestCase(150, 1.833, 1.000, -335.19), - TestCase(150, 2.200, 1.000, -528.77), - TestCase(150, 2.750, 1.000, -883.40), - TestCase(150, 4.400, 1.000, -2462.17), - TestCase(150, 11.000, 1.000, -16540.98), - // interpolated - TestCase(150, 1.0025, 1.0, 0.0), - TestCase(150, 1.0525, 1.0, -20.17), - TestCase(150, 1.161, 1.0, -60.34), - TestCase(150, 1.2985, 1.0, -108.225), - TestCase(150, 1.473, 1.0, -176.315), - TestCase(150, 1.702, 1.0, -275.855), - TestCase(150, 2.0165, 1.0, -431.98), - TestCase(150, 2.475, 1.0, -706.085), - TestCase(150, 3.575, 1.0, -1672.785), - TestCase(150, 7.7, 1.0, -9501.575), - // extrapolated - TestCase(150, 0.5, 1.0, 0.0), - TestCase(150, 12.0, 1.0, -18674.133), // = (12-4.4)*(-16540.98- -2462.17)/(11-4.4)+ -2462.17 - ] - public void DefaultTcTest(double referenceRpm, double nu, double mu, double torque) - { - var referenceSpeed = referenceRpm.SI<PerSecond>(); - - var r = new Random(); - - var muLookup = DeclarationData.TorqueConverter.LookupMu(nu); - Assert.AreEqual(muLookup, mu); - - var angularSpeed = r.Next(1000).SI<PerSecond>(); - var torqueLookup = DeclarationData.TorqueConverter.LookupTorque(nu, angularSpeed, referenceSpeed); - AssertHelper.AreRelativeEqual( - torque.SI<NewtonMeter>() * Math.Pow((angularSpeed / referenceSpeed).Cast<Scalar>(), 2), torqueLookup); - } - [Test] public void AuxElectricSystemTest() { -- GitLab