From 2adcd6285a55bcf19573ec79d770480dc2f07ee4 Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Fri, 4 Nov 2016 16:34:55 +0100 Subject: [PATCH] TorqueConverter: Added a better Error Message if nu is not sufficient --- .../Data/Gearbox/TorqueConverterData.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs index 485c9567d2..825c558741 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs @@ -146,11 +146,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox retVal.OutTorque = retVal.InTorque * retVal.TorqueRatio; return retVal; } - throw new VectoException( - "No solution for output speed/input speed found! n_out: {0}, n_in: {1}, nu: {2}, nu_max: {3}", outAngularVelocity, - inAngularVelocity, outAngularVelocity / inAngularVelocity, TorqueConverterEntries.Last().SpeedRatio); - } + var nu = outAngularVelocity / inAngularVelocity; + var nuMax = TorqueConverterEntries.Last().SpeedRatio; + if (nu.IsGreater(nuMax)) { + throw new VectoException( + "Torque Converter: Range of torque converter data is not sufficient. Needed nu: {0}, Got nu_max: {1}", nu, + nuMax); + } else { + throw new VectoException( + "Torque Converter: No solution for output speed/input speed found! n_out: {0}, n_in: {1}, nu: {2}, nu_max: {3}", + outAngularVelocity, inAngularVelocity, nu, nuMax); + } + } /// <summary> /// find an operating point for the torque converter -- GitLab